Skip to content

Commit 7958b0a

Browse files
committed
Auto-generated commit
1 parent 0be2cfd commit 7958b0a

File tree

8 files changed

+48
-50
lines changed

8 files changed

+48
-50
lines changed

.github/.keepalive

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-04-07)
7+
## Unreleased (2025-04-29)
88

99
<section class="features">
1010

@@ -34,6 +34,7 @@ This release closes the following issue:
3434

3535
<details>
3636

37+
- [`c1acd4b`](https://github.com/stdlib-js/stdlib/commit/c1acd4bf3ed08b40d6d4e93ee245f03c9eef8472) - **bench:** update random value generation [(#6858)](https://github.com/stdlib-js/stdlib/pull/6858) _(by Harsh, Athan Reines)_
3738
- [`a1e230f`](https://github.com/stdlib-js/stdlib/commit/a1e230f29297caa89880e9c194c615a0400fb7bc) - **chore:** clean up cppcheck-suppress comments _(by Karan Anand)_
3839
- [`d53a818`](https://github.com/stdlib-js/stdlib/commit/d53a8184c029c3df7c45a7a1a2da9ff90b4f883e) - **docs:** fix errors in the structure of READMEs in `stats/base/*` [(#5138)](https://github.com/stdlib-js/stdlib/pull/5138) _(by Aayush Khanna)_
3940
- [`af55f0d`](https://github.com/stdlib-js/stdlib/commit/af55f0d6d6b4d06c36f46357740ea89a4639ab5b) - **bench:** refactor random number generation in `stats/base/dists/binomial` [(#4841)](https://github.com/stdlib-js/stdlib/pull/4841) _(by Karan Anand)_
@@ -49,10 +50,11 @@ This release closes the following issue:
4950

5051
### Contributors
5152

52-
A total of 5 people contributed to this release. Thank you to the following contributors:
53+
A total of 6 people contributed to this release. Thank you to the following contributors:
5354

5455
- Aayush Khanna
5556
- Athan Reines
57+
- Harsh
5658
- Karan Anand
5759
- Philipp Burckhardt
5860
- Prashant Kumar Yadav

CONTRIBUTORS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Dorrin Sotoudeh <[email protected]>
5151
EuniceSim142 <[email protected]>
5252
Frank Kovacs <[email protected]>
5353
GK Bishnoi <[email protected]>
54+
GURU PRASAD SHARMA <[email protected]>
5455
5556
Gautam sharma <[email protected]>
5657
Golden Kumar <[email protected]>
@@ -77,6 +78,7 @@ Joris Labie <[email protected]>
7778
Justin Dennison <[email protected]>
7879
Justyn Shelby <[email protected]>
7980
Karan Anand <[email protected]>
81+
Karan Yadav <[email protected]>
8082
Karthik Prakash <[email protected]>
8183
Kaushikgtm <[email protected]>
8284
Kavyansh-Bagdi <[email protected]>
@@ -86,6 +88,7 @@ Krishnendu Das <[email protected]>
8688
Kshitij-Dale <[email protected]>
8789
Lovelin Dhoni J B <[email protected]>
8890
91+
Mahfuza Humayra Mohona <[email protected]>
8992
Manik Sharma <[email protected]>
9093
Manvith M <[email protected]>
9194
Marcus Fantham <[email protected]>
@@ -103,6 +106,7 @@ Naveen Kumar <[email protected]>
103106
Neeraj Pathak <[email protected]>
104107
NirvedMishra <[email protected]>
105108
Nishant Shinde <[email protected]>
109+
Nishant singh <[email protected]>
106110
Nishchay Rajput <[email protected]>
107111
Nithin Katta <[email protected]>
108112
Nourhan Hasan <[email protected]>
@@ -118,6 +122,7 @@ Prashant Kumar Yadav <[email protected]>
118122
PrathamBhamare <[email protected]>
119123
Pratik Singh <[email protected]>
120124
Pratyush Kumar Chouhan <[email protected]>
125+
Pravesh Kunwar <[email protected]>
121126
Priyansh Prajapati <[email protected]>
122127
Priyanshu Agarwal <[email protected]>
123128
Pulkit Gupta <[email protected]>
@@ -174,9 +179,11 @@ Yaswanth Kosuru <[email protected]>
174179
Yernar Yergaziyev <[email protected]>
175180
Yugal Kaushik <[email protected]>
176181
Yuvi Mittal <[email protected]>
182+
devshree-bhati <[email protected]>
177183
178184
ekambains <[email protected]>
179185
fadiothman22 <[email protected]>
186+
iraandrushko <[email protected]>
180187
lohithganni <[email protected]>
181188
olenkabilonizhka <[email protected]>
182189
pranav-1720 <[email protected]>

benchmark/benchmark.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench-harness' );
24-
var Int32Array = require( '@stdlib/array-int32' );
25-
var Float64Array = require( '@stdlib/array-float64' );
26-
var uniform = require( '@stdlib/random-base-uniform' );
27-
var discreteUniform = require( '@stdlib/random-base-discrete-uniform' );
24+
var uniform = require( '@stdlib/random-array-uniform' );
25+
var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
2826
var isnan = require( '@stdlib/math-base-assert-is-nan' );
2927
var pkg = require( './../package.json' ).name;
3028
var variance = require( './../lib' );
@@ -33,23 +31,21 @@ var variance = require( './../lib' );
3331
// MAIN //
3432

3533
bench( pkg, function benchmark( b ) {
36-
var len;
3734
var n;
3835
var p;
3936
var y;
4037
var i;
4138

42-
len = 100;
43-
n = new Int32Array( len );
44-
p = new Float64Array( len );
45-
for ( i = 0; i < len; i++ ) {
46-
n[ i ] = discreteUniform( 1, 100 );
47-
p[ i ] = uniform( 0.0, 1.0 );
48-
}
39+
n = discreteUniform( 100, 1, 100, {
40+
'dtype': 'int32'
41+
});
42+
p = uniform( 100, 0.0, 1.0, {
43+
'dtype': 'float64'
44+
});
4945

5046
b.tic();
5147
for ( i = 0; i < b.iterations; i++ ) {
52-
y = variance( n[ i % len ], p[ i % len ] );
48+
y = variance( n[ i % n.length ], p[ i % p.length ] );
5349
if ( isnan( y ) ) {
5450
b.fail( 'should not return NaN' );
5551
}

benchmark/benchmark.native.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@
2222

2323
var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench-harness' );
25-
var Int32Array = require( '@stdlib/array-int32' );
26-
var Float64Array = require( '@stdlib/array-float64' );
2725
var tryRequire = require( '@stdlib/utils-try-require' );
28-
var uniform = require( '@stdlib/random-base-uniform' );
29-
var discreteUniform = require( '@stdlib/random-base-discrete-uniform' );
26+
var uniform = require( '@stdlib/random-array-uniform' );
27+
var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
3028
var isnan = require( '@stdlib/math-base-assert-is-nan' );
3129
var pkg = require( './../package.json' ).name;
3230

@@ -42,23 +40,21 @@ var opts = {
4240
// MAIN //
4341

4442
bench( pkg+'::native', opts, function benchmark( b ) {
45-
var len;
4643
var n;
4744
var p;
4845
var y;
4946
var i;
5047

51-
len = 100;
52-
n = new Int32Array( len );
53-
p = new Float64Array( len );
54-
for ( i = 0; i < len; i++ ) {
55-
n[ i ] = discreteUniform( 1, 100 );
56-
p[ i ] = uniform( 0.0, 1.0 );
57-
}
48+
n = discreteUniform( 100, 1, 100, {
49+
'dtype': 'int32'
50+
});
51+
p = uniform( 100, 0.0, 1.0, {
52+
'dtype': 'float64'
53+
});
5854

5955
b.tic();
6056
for ( i = 0; i < b.iterations; i++ ) {
61-
y = variance( n[ i % len ], p[ i % len ] );
57+
y = variance( n[ i % n.length ], p[ i % p.length ] );
6258
if ( isnan( y ) ) {
6359
b.fail( 'should not return NaN' );
6460
}

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,14 @@
4747
"@stdlib/utils-library-manifest": "^0.2.2"
4848
},
4949
"devDependencies": {
50-
"@stdlib/array-float64": "^0.2.2",
51-
"@stdlib/array-int32": "^0.2.2",
5250
"@stdlib/constants-float64-eps": "^0.2.2",
5351
"@stdlib/constants-float64-ninf": "^0.2.2",
5452
"@stdlib/math-base-special-abs": "^0.2.2",
5553
"@stdlib/math-base-special-ceil": "^0.2.2",
5654
"@stdlib/math-base-special-round": "^0.3.0",
57-
"@stdlib/random-base-discrete-uniform": "^0.2.1",
55+
"@stdlib/random-array-discrete-uniform": "^0.2.1",
56+
"@stdlib/random-array-uniform": "^0.2.1",
5857
"@stdlib/random-base-randu": "^0.2.1",
59-
"@stdlib/random-base-uniform": "^0.2.1",
6058
"@stdlib/utils-try-require": "^0.2.2",
6159
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
6260
"istanbul": "^0.4.1",

test/test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ tape( 'main export is a function', function test( t ) {
4242

4343
tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) {
4444
var v = variance( NaN, 0.5 );
45-
t.equal( isnan( v ), true, 'returns NaN' );
45+
t.equal( isnan( v ), true, 'returns expected value' );
4646

4747
v = variance( 10, NaN );
48-
t.equal( isnan( v ), true, 'returns NaN' );
48+
t.equal( isnan( v ), true, 'returns expected value' );
4949

5050
v = variance( NaN, NaN );
51-
t.equal( isnan( v ), true, 'returns NaN' );
51+
t.equal( isnan( v ), true, 'returns expected value' );
5252

5353
t.end();
5454
});
@@ -57,19 +57,19 @@ tape( 'if provided an `n` which is not a nonnegative integer, the function retur
5757
var v;
5858

5959
v = variance( 1.5, 0.5 );
60-
t.equal( isnan( v ), true, 'returns NaN' );
60+
t.equal( isnan( v ), true, 'returns expected value' );
6161

6262
v = variance( -2, 0.5 );
63-
t.equal( isnan( v ), true, 'returns NaN' );
63+
t.equal( isnan( v ), true, 'returns expected value' );
6464

6565
v = variance( -1, 0.5 );
66-
t.equal( isnan( v ), true, 'returns NaN' );
66+
t.equal( isnan( v ), true, 'returns expected value' );
6767

6868
v = variance( 2.5, 0.5 );
69-
t.equal( isnan( v ), true, 'returns NaN' );
69+
t.equal( isnan( v ), true, 'returns expected value' );
7070

7171
v = variance( PINF, 0.5 );
72-
t.equal( isnan( v ), true, 'returns NaN' );
72+
t.equal( isnan( v ), true, 'returns expected value' );
7373

7474
t.end();
7575
});
@@ -78,16 +78,16 @@ tape( 'if provided a success probability `p` outside of `[0,1]`, the function re
7878
var v;
7979

8080
v = variance( 20, -1.0 );
81-
t.equal( isnan( v ), true, 'returns NaN' );
81+
t.equal( isnan( v ), true, 'returns expected value' );
8282

8383
v = variance( 20, 1.5 );
84-
t.equal( isnan( v ), true, 'returns NaN' );
84+
t.equal( isnan( v ), true, 'returns expected value' );
8585

8686
v = variance( 20, NINF );
87-
t.equal( isnan( v ), true, 'returns NaN' );
87+
t.equal( isnan( v ), true, 'returns expected value' );
8888

8989
v = variance( 20, PINF );
90-
t.equal( isnan( v ), true, 'returns NaN' );
90+
t.equal( isnan( v ), true, 'returns expected value' );
9191

9292
t.end();
9393
});

test/test.native.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ tape( 'main export is a function', opts, function test( t ) {
5151

5252
tape( 'if provided `NaN` for any parameter, the function returns `NaN`', opts, function test( t ) {
5353
var v = variance( 10, NaN );
54-
t.equal( isnan( v ), true, 'returns NaN' );
54+
t.equal( isnan( v ), true, 'returns expected value' );
5555

5656
t.end();
5757
});
@@ -60,10 +60,10 @@ tape( 'if provided an `n` which is not a nonnegative integer, the function retur
6060
var v;
6161

6262
v = variance( -2, 0.5 );
63-
t.equal( isnan( v ), true, 'returns NaN' );
63+
t.equal( isnan( v ), true, 'returns expected value' );
6464

6565
v = variance( -1, 0.5 );
66-
t.equal( isnan( v ), true, 'returns NaN' );
66+
t.equal( isnan( v ), true, 'returns expected value' );
6767

6868
t.end();
6969
});
@@ -72,10 +72,10 @@ tape( 'if provided `p < 0` or `p > 1`, the function returns `NaN`', opts, functi
7272
var y;
7373

7474
y = variance( 10, -0.1 );
75-
t.equal( isnan( y ), true, 'returns NaN' );
75+
t.equal( isnan( y ), true, 'returns expected value' );
7676

7777
y = variance( 10, 1.1 );
78-
t.equal( isnan( y ), true, 'returns NaN' );
78+
t.equal( isnan( y ), true, 'returns expected value' );
7979

8080
t.end();
8181
});

0 commit comments

Comments
 (0)