Skip to content

Commit afc5695

Browse files
committed
test: update tests and documentation
1 parent faaf065 commit afc5695

12 files changed

Lines changed: 30 additions & 32 deletions

File tree

lib/node_modules/@stdlib/random/array/chi/docs/repl.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@
5757
Returns a function for creating arrays containing pseudorandom numbers drawn
5858
from a chi distribution.
5959

60-
If provided `k`, the returned function returns random variates drawn from
61-
the specified distribution.
60+
If provided a distribution parameter, the returned function returns random
61+
variates drawn from the specified distribution.
6262

63-
If not provided `k`, the returned function requires that `k` be provided at
64-
each invocation.
63+
If not provided a distribution parameter, the returned function requires
64+
that distribution parameters be provided at each invocation.
6565

6666
The returned function accepts the following options:
6767

lib/node_modules/@stdlib/random/array/chi/docs/types/test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ import random = require( './index' );
2525
// The function returns an array...
2626
{
2727
random( 10, 2.0 ); // $ExpectType RandomArray
28-
random( 10, 1.0 ); // $ExpectType RandomArray
29-
random( 10, 1.0, {} ); // $ExpectType RandomArray
28+
random( 10, 2.0, {} ); // $ExpectType RandomArray
3029
}
3130

3231
// The compiler throws an error if the function is provided a first argument which is not a number...

lib/node_modules/@stdlib/random/array/chi/test/test.factory.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ tape( 'the function returns a function for creating arrays containing pseudorand
736736
t.strictEqual( actual.length, 10, 'returns expected value' );
737737

738738
for ( i = 0; i < actual.length; i++ ) {
739-
t.strictEqual( typeof actual[ i ], 'number', 'returns expected value for index '+i );
739+
t.strictEqual( actual[ i ], actual[ i ], 'returns expected value for index '+i );
740740
}
741741

742742
random = factory();
@@ -746,7 +746,7 @@ tape( 'the function returns a function for creating arrays containing pseudorand
746746
t.strictEqual( actual.length, 10, 'returns expected value' );
747747

748748
for ( i = 0; i < actual.length; i++ ) {
749-
t.strictEqual( typeof actual[ i ], 'number', 'returns expected value for index '+i );
749+
t.strictEqual( actual[ i ], actual[ i ], 'returns expected value for index '+i );
750750
}
751751
t.end();
752752
});

lib/node_modules/@stdlib/random/array/chi/test/test.main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ tape( 'the function returns an array containing pseudorandom numbers (default)',
161161
t.strictEqual( actual.length, 10, 'returns expected value' );
162162

163163
for ( i = 0; i < actual.length; i++ ) {
164-
t.strictEqual( typeof actual[ i ], 'number', 'returns expected value for index '+i );
164+
t.strictEqual( actual[ i ], actual[ i ], 'returns expected value for index '+i );
165165
}
166166
t.end();
167167
});

lib/node_modules/@stdlib/random/array/geometric/benchmark/benchmark.float32.factory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var bench = require( '@stdlib/bench' );
2424
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
2525
var pow = require( '@stdlib/math/base/special/pow' );
2626
var pkg = require( './../package.json' ).name;
27-
var random = require('./../lib');
27+
var random = require( './../lib' );
2828

2929

3030
// FUNCTIONS //

lib/node_modules/@stdlib/random/array/geometric/benchmark/benchmark.float32.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var bench = require( '@stdlib/bench' );
2424
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
2525
var pow = require( '@stdlib/math/base/special/pow' );
2626
var pkg = require( './../package.json' ).name;
27-
var random = require('./../lib');
27+
var random = require( './../lib' );
2828

2929

3030
// FUNCTIONS //

lib/node_modules/@stdlib/random/array/geometric/docs/repl.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Output array length.
1010

1111
p: number
12-
Success probability (i.e., a value on the interval [0,1]).
12+
Success probability.
1313

1414
options: Object (optional)
1515
Options.
@@ -35,7 +35,7 @@
3535
Parameters
3636
----------
3737
p: number
38-
Success probability (i.e., a value on the interval [0,1]).
38+
Success probability.
3939

4040
out: Array<number>|TypedArray
4141
Output array.
@@ -58,11 +58,11 @@
5858
Returns a function for creating arrays containing pseudorandom numbers drawn
5959
from a geometric distribution.
6060

61-
If provided `p`, the returned function returns random variates drawn from
62-
the specified distribution.
61+
If provided a distribution parameter, the returned function returns random
62+
variates drawn from the specified distribution.
6363

64-
If not provided `p`, the returned function requires that `p` be provided at
65-
each invocation.
64+
If not provided a distribution parameter, the returned function requires
65+
that distribution parameters be provided at each invocation.
6666

6767
The returned function accepts the following options:
6868

@@ -72,7 +72,7 @@
7272
Parameters
7373
----------
7474
p: number (optional)
75-
Success probability (i.e., a value on the interval [0,1]).
75+
Success probability.
7676

7777
options: Object (optional)
7878
Options.

lib/node_modules/@stdlib/random/array/geometric/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ interface Random extends PRNG {
202202
*
203203
* @param p - success probability
204204
* @param options - function options
205-
* @throws `p` must be a probability
205+
* @throws `p` must be a probability (i.e., a number on the interval [0,1])
206206
* @throws must provide a valid state
207207
* @returns function for creating arrays
208208
*

lib/node_modules/@stdlib/random/array/geometric/lib/factory.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,28 @@ var DTYPES = dtypes( 'real_and_generic' );
3838
*
3939
* @name factory
4040
* @type {Function}
41-
* @param {Probability} [p] - success probability
41+
* @param {PositiveNumber} [p] - success probability
4242
* @param {Options} [options] - function options
4343
* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers
4444
* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed
4545
* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state
4646
* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state
4747
* @param {string} [options.dtype="float64"] - default data type
48-
* @throws {TypeError} `p` must be a probability
48+
* @throws {TypeError} `p` must be a probability (i.e., a number on the interval [0,1])
4949
* @throws {TypeError} options argument must be an object
5050
* @throws {TypeError} must provide valid options
5151
* @throws {Error} must provide a valid state
5252
* @returns {Function} function for creating arrays
5353
*
5454
* @example
55-
* var geometric = factory( 0.3 );
55+
* var geometric = factory( 0.01 );
5656
* // returns <Function>
5757
*
5858
* var arr = geometric( 10 );
5959
* // returns <Float64Array>
6060
*
6161
* @example
62-
* var geometric = factory( 0.3 );
62+
* var geometric = factory( 0.01 );
6363
* // returns <Function>
6464
*
6565
* var arr = geometric( 10, {

lib/node_modules/@stdlib/random/array/rayleigh/docs/repl.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929

3030

3131
{{alias}}.assign( sigma, out )
32-
Fills an array with pseudorandom numbers drawn from a Rayleigh
33-
distribution.
32+
Fills an array with pseudorandom numbers drawn from a Rayleigh distribution.
3433

3534
Parameters
3635
----------
@@ -58,11 +57,11 @@
5857
Returns a function for creating arrays containing pseudorandom numbers drawn
5958
from a Rayleigh distribution.
6059

61-
If provided `sigma`, the returned function returns random variates drawn
62-
from the specified distribution.
60+
If provided a distribution parameter, the returned function returns random
61+
variates drawn from the specified distribution.
6362

64-
If not provided `sigma`, the returned function requires that `sigma` be
65-
provided at each invocation.
63+
If not provided a distribution parameter, the returned function requires
64+
that distribution parameters be provided at each invocation.
6665

6766
The returned function accepts the following options:
6867

0 commit comments

Comments
 (0)