Skip to content

Commit 77566c2

Browse files
committed
Auto-generated commit
1 parent 79b04c9 commit 77566c2

File tree

8 files changed

+44
-48
lines changed

8 files changed

+44
-48
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-14)
7+
## Unreleased (2025-04-29)
88

99
<section class="features">
1010

@@ -34,6 +34,7 @@ A total of 2 issues were closed in this release:
3434

3535
<details>
3636

37+
- [`e658ffd`](https://github.com/stdlib-js/stdlib/commit/e658ffd3c46b5cb1ba33c0be61e55bf6995237ca) - **bench:** update random value generation [(#6856)](https://github.com/stdlib-js/stdlib/pull/6856) _(by Harsh)_
3738
- [`a1e230f`](https://github.com/stdlib-js/stdlib/commit/a1e230f29297caa89880e9c194c615a0400fb7bc) - **chore:** clean up cppcheck-suppress comments _(by Karan Anand)_
3839
- [`7fc07a2`](https://github.com/stdlib-js/stdlib/commit/7fc07a2122bb9e862ae7e2237dd48096051199dd) - **docs:** fix missing section tags in various READMEs [(#5322)](https://github.com/stdlib-js/stdlib/pull/5322) _(by Saurabh Singh)_
3940
- [`c45b0ba`](https://github.com/stdlib-js/stdlib/commit/c45b0ba1e520ffe95e231d4e634cbcc26dfd5242) - **chore:** address commit comments [(#5219)](https://github.com/stdlib-js/stdlib/pull/5219) _(by Saurabh Singh)_
@@ -50,8 +51,9 @@ A total of 2 issues were closed in this release:
5051

5152
### Contributors
5253

53-
A total of 4 people contributed to this release. Thank you to the following contributors:
54+
A total of 5 people contributed to this release. Thank you to the following contributors:
5455

56+
- Harsh
5557
- Karan Anand
5658
- Philipp Burckhardt
5759
- Prashant Kumar Yadav

CONTRIBUTORS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Dorrin Sotoudeh <dorrinsotoudeh123@gmail.com>
5151
EuniceSim142 <77243938+EuniceSim142@users.noreply.github.com>
5252
Frank Kovacs <fran70kk@gmail.com>
5353
GK Bishnoi <gkishan1kyt@gmail.com>
54+
GURU PRASAD SHARMA <168292003+GURUPRASADSHARMA@users.noreply.github.com>
5455
Gaurav <gaurav70380@gmail.com>
5556
Gautam sharma <gautamkrishnasharma1@gmail.com>
5657
Golden Kumar <103646877+AuenKr@users.noreply.github.com>
@@ -105,6 +106,7 @@ Naveen Kumar <stupiddint@gmail.com>
105106
Neeraj Pathak <neerajrpathak710@gmail.com>
106107
NirvedMishra <139633597+NirvedMishra@users.noreply.github.com>
107108
Nishant Shinde <97207366+nishant-s7@users.noreply.github.com>
109+
Nishant singh <38534128+Nishantsingh11@users.noreply.github.com>
108110
Nishchay Rajput <121144841+NishchayRajput@users.noreply.github.com>
109111
Nithin Katta <88046362+nithinkatta@users.noreply.github.com>
110112
Nourhan Hasan <109472010+TheNourhan@users.noreply.github.com>
@@ -177,9 +179,11 @@ Yaswanth Kosuru <116426380+yaswanthkosuru@users.noreply.github.com>
177179
Yernar Yergaziyev <yernar.yergaziyev@erg.kz>
178180
Yugal Kaushik <yugalkaushik14@gmail.com>
179181
Yuvi Mittal <128018763+yuvi-mittal@users.noreply.github.com>
182+
devshree-bhati <147095250+devshree-bhati@users.noreply.github.com>
180183
ditsu <170345142+ditsus@users.noreply.github.com>
181184
ekambains <bainsinbusiness@gmail.com>
182185
fadiothman22 <48636283+fadiothman22@users.noreply.github.com>
186+
iraandrushko <71790513+iraandrushko@users.noreply.github.com>
183187
lohithganni <116790357+lohithganni@users.noreply.github.com>
184188
olenkabilonizhka <62379231+olenkabilonizhka@users.noreply.github.com>
185189
pranav-1720 <123018993+pranav-1720@users.noreply.github.com>

benchmark/benchmark.js

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

2323
var bench = require( '@stdlib/bench-harness' );
24-
var Float64Array = require( '@stdlib/array-float64' );
25-
var uniform = require( '@stdlib/random-base-uniform' );
26-
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' );
2726
var isnan = require( '@stdlib/math-base-assert-is-nan' );
2827
var pkg = require( './../package.json' ).name;
2928
var mean = require( './../lib' );
@@ -32,23 +31,21 @@ var mean = require( './../lib' );
3231
// MAIN //
3332

3433
bench( pkg, function benchmark( b ) {
35-
var len;
34+
var opts;
3635
var n;
3736
var p;
3837
var y;
3938
var i;
4039

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

4946
b.tic();
5047
for ( i = 0; i < b.iterations; i++ ) {
51-
y = mean( n[ i % len ], p[ i % len ] );
48+
y = mean( n[ i % n.length ], p[ i % p.length ] );
5249
if ( isnan( y ) ) {
5350
b.fail( 'should not return NaN' );
5451
}

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 = mean( n[ i % len ], p[ i % len ] );
57+
y = mean( 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,14 +47,12 @@
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-ninf": "^0.2.2",
5351
"@stdlib/math-base-special-ceil": "^0.2.2",
5452
"@stdlib/math-base-special-round": "^0.3.0",
55-
"@stdlib/random-base-discrete-uniform": "^0.2.1",
53+
"@stdlib/random-array-discrete-uniform": "^0.2.1",
54+
"@stdlib/random-array-uniform": "^0.2.1",
5655
"@stdlib/random-base-randu": "^0.2.1",
57-
"@stdlib/random-base-uniform": "^0.2.1",
5856
"@stdlib/utils-try-require": "^0.2.2",
5957
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
6058
"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 = mean( NaN, 0.5 );
45-
t.equal( isnan( v ), true, 'returns NaN' );
45+
t.equal( isnan( v ), true, 'returns expected value' );
4646

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

5050
v = mean( 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 = mean( 1.5, 0.5 );
60-
t.equal( isnan( v ), true, 'returns NaN' );
60+
t.equal( isnan( v ), true, 'returns expected value' );
6161

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

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

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

7171
v = mean( 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 = mean( 20, -1.0 );
81-
t.equal( isnan( v ), true, 'returns NaN' );
81+
t.equal( isnan( v ), true, 'returns expected value' );
8282

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

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

8989
v = mean( 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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ tape( 'if provided `NaN` for `p`, the function returns `NaN`', opts, function te
5151
var v;
5252

5353
v = mean( 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,13 +60,13 @@ tape( 'if provided `n < 0` or success probability `p` outside of `[0,1]`, the fu
6060
var v;
6161

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

6565
v = mean( 10, -0.1 );
66-
t.equal( isnan( v ), true, 'returns NaN' );
66+
t.equal( isnan( v ), true, 'returns expected value' );
6767

6868
v = mean( 10, 1.5 );
69-
t.equal( isnan( v ), true, 'returns NaN' );
69+
t.equal( isnan( v ), true, 'returns expected value' );
7070

7171
t.end();
7272
});

0 commit comments

Comments
 (0)