Skip to content

Commit

Permalink
Merge branch 'stdlib-js:develop' into feat/ndarray_sdsnanmeanors
Browse files Browse the repository at this point in the history
  • Loading branch information
DhruvArvindSingh authored Jan 13, 2025
2 parents 10d1d28 + f257760 commit 5e74a4e
Show file tree
Hide file tree
Showing 269 changed files with 3,434 additions and 466 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint_changed_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
# Cache dependencies:
- name: 'Cache dependencies'
# Pin action to full length commit SHA
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
id: cache
with:
path: |
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/run_affected_benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,21 @@ jobs:
node-version: '20' # 'lts/*'
timeout-minutes: 5

# Cache dependencies:
- name: 'Cache dependencies'
# Pin action to full length commit SHA
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
id: cache
with:
path: |
${{ github.workspace }}/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
# Install dependencies (accounting for possible network failures, etc, when installing node module dependencies):
- name: 'Install dependencies'
if: steps.cache.outputs.cache-hit != 'true'
run: |
make install-node-modules || make install-node-modules || make install-node-modules
timeout-minutes: 15
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/run_affected_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,21 @@ jobs:
node-version: '20' # 'lts/*'
timeout-minutes: 5

# Cache dependencies:
- name: 'Cache dependencies'
# Pin action to full length commit SHA
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
id: cache
with:
path: |
${{ github.workspace }}/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
# Install dependencies (accounting for possible network failures, etc, when installing node module dependencies):
- name: 'Install dependencies'
if: steps.cache.outputs.cache-hit != 'true'
run: |
make install-node-modules || make install-node-modules || make install-node-modules
timeout-minutes: 15
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/run_affected_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,21 @@ jobs:
node-version: '20' # 'lts/*'
timeout-minutes: 5

# Cache dependencies:
- name: 'Cache dependencies'
# Pin action to full length commit SHA
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
id: cache
with:
path: |
${{ github.workspace }}/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
# Install dependencies (accounting for possible network failures, etc, when installing node module dependencies):
- name: 'Install dependencies'
if: steps.cache.outputs.cache-hit != 'true'
run: |
make install-node-modules || make install-node-modules || make install-node-modules
timeout-minutes: 15
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/run_tests_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,21 @@ jobs:
node-version: 20 # 'lts/*'
timeout-minutes: 5

# Cache dependencies:
- name: 'Cache dependencies'
# Pin action to full length commit SHA
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
id: cache
with:
path: |
${{ github.workspace }}/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
# Install dependencies (accounting for possible network failures, etc, when installing node module dependencies):
- name: 'Install dependencies'
if: steps.cache.outputs.cache-hit != 'true'
run: |
make install-node-modules || make install-node-modules || make install-node-modules
timeout-minutes: 15
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function accessors( x, out, stride, offset, predicate, thisArg ) {
*
* @example
* function isPositive( value ) {
* return ( value > 0 );
* return ( value > 0 );
* }
*
* var x = [ 1, 1, 1, 0, 1 ];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function accessors( x, out, stride, offset, predicate, thisArg ) {
*
* @example
* function fcn( value ) {
* return ( value > 0 );
* return ( value > 0 );
* }
*
* var x = [ 1, 1, 0, 0 ];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* var cusomeByRight = require( '@stdlib/array/base/cusome-by-right' );
*
* function fcn( value ) {
* return ( value > 0 );
* return ( value > 0 );
* }
*
* var x = [ 1, 1, 0, 0, 0 ];
Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/array/base/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3365,10 +3365,10 @@ interface Namespace {
*
* @example
* var x = [ 1, 2, 3, 4 ];
* var idx = [ 5, 6, 7, 8 ];
* var y = [ 5, 6, 7, 8 ];
* var mask = [ 0, 1, 0, 1 ];
*
* var out = ns.mskfilter2( x, idx, mask );
* var out = ns.mskfilter2( x, y, mask );
* // returns [ [ 2, 4 ], [ 6, 8 ] ]
*/
mskfilter2: typeof mskfilter2;
Expand Down
10 changes: 5 additions & 5 deletions lib/node_modules/@stdlib/array/base/mskfilter2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ Returns new arrays by applying a mask to two provided input arrays in a single p

```javascript
var x = [ 1, 2, 3, 4 ];
var idx = [ 0, 1, 2, 3 ];
var y = [ 0, 1, 2, 3 ];

var out = mskfilter2( x, idx, [ 0, 1, 0, 1 ] );
var out = mskfilter2( x, y, [ 0, 1, 0, 1 ] );
// returns [ [ 2, 4 ], [ 1, 3 ] ]
```

Expand Down Expand Up @@ -79,8 +79,8 @@ var mskfilter2 = require( '@stdlib/array/base/mskfilter2' );
var x = zeroTo( 20 );
console.log( x );

var idx = zeroTo( x.length );
console.log( idx );
var y = zeroTo( x.length );
console.log( y );

// Generate a random mask:
var mask = bernoulli( x.length, 0.5, {
Expand All @@ -89,7 +89,7 @@ var mask = bernoulli( x.length, 0.5, {
console.log( mask );

// Filter both arrays using the mask:
var out = mskfilter2( x, idx, mask );
var out = mskfilter2( x, y, mask );
console.log( out );
```

Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/array/base/mskfilter2/docs/repl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
Examples
--------
> var x = [ 1, 2, 3, 4 ];
> var idx = [ 0, 1, 2, 3 ];
> var out = {{alias}}( x, idx, [ 0, 1, 0, 1 ] )
> var y = [ 0, 1, 2, 3 ];
> var out = {{alias}}( x, y, [ 0, 1, 0, 1 ] )
[ [ 2, 4 ], [ 1, 3 ] ]

See Also
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ import { Collection } from '@stdlib/types/array';
*
* @example
* var x = [ 1, 2, 3, 4 ];
* var idx = [ 5, 6, 7, 8 ];
* var y = [ 5, 6, 7, 8 ];
* var mask = [ 0, 1, 0, 1 ];
*
* var out = mskfilter2( x, idx, mask );
* var out = mskfilter2( x, y, mask );
* // returns [ [ 2, 4 ], [ 6, 8 ] ]
*/
declare function mskfilter2<T = unknown, U = unknown>( x: Collection<T>, y: Collection<U>, mask: Collection ): [ Array<T>, Array<U> ];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ var mskfilter2 = require( './../lib' );
var x = zeroTo( 20 );
console.log( x );

var idx = zeroTo( x.length );
console.log( idx );
var y = zeroTo( x.length );
console.log( y );

// Generate a random mask:
var mask = bernoulli( x.length, 0.5, {
Expand All @@ -36,5 +36,5 @@ var mask = bernoulli( x.length, 0.5, {
console.log( mask );

// Filter both arrays using the mask:
var out = mskfilter2( x, idx, mask );
var out = mskfilter2( x, y, mask );
console.log( out );
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/array/base/mskfilter2/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
* var mskfilter2 = require( '@stdlib/array/base/mskfilter2' );
*
* var x = [ 1, 2, 3, 4 ];
* var idx = [ 5, 6, 7, 8 ];
* var y = [ 5, 6, 7, 8 ];
* var mask = [ 0, 1, 0, 1 ];
*
* var out = mskfilter2( x, idx, mask );
* var out = mskfilter2( x, y, mask );
* // returns [ [ 2, 4 ], [ 6, 8 ] ]
*/

Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/array/base/mskfilter2/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ var resolveGetter = require( '@stdlib/array/base/resolve-getter' );
*
* @example
* var x = [ 1, 2, 3, 4 ];
* var idx = [ 5, 6, 7, 8 ];
* var y = [ 5, 6, 7, 8 ];
* var mask = [ 0, 1, 0, 1 ];
*
* var out = mskfilter2( x, idx, mask );
* var out = mskfilter2( x, y, mask );
* // returns [ [ 2, 4 ], [ 6, 8 ] ]
*/
function mskfilter2( x, y, mask ) {
Expand Down
30 changes: 15 additions & 15 deletions lib/node_modules/@stdlib/array/base/mskfilter2/test/test.main.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ tape( 'the function filters array elements', function test( t ) {
var expected;
var actual;
var mask;
var idx;
var y;
var x;

x = [ 1, 2, 3, 4 ];
idx = [ 0, 1, 2, 3 ];
y = [ 0, 1, 2, 3 ];

mask = [ 0, 1, 0, 1 ];
actual = mskfilter2( x, idx, mask );
actual = mskfilter2( x, y, mask );

t.strictEqual( isArray( actual ), true, 'returns expected value' );
t.strictEqual( actual.length, 2, 'returns expected value' );
Expand All @@ -59,11 +59,11 @@ tape( 'the function filters array elements', function test( t ) {
t.deepEqual( actual[ 0 ], expected, 'returns expected value' );

expected = [ 1, 3 ];
t.notEqual( actual[ 1 ], idx, 'returns expected value' );
t.notEqual( actual[ 1 ], y, 'returns expected value' );
t.deepEqual( actual[ 1 ], expected, 'returns expected value' );

mask = [ 0, 0, 0, 0 ];
actual = mskfilter2( x, idx, mask );
actual = mskfilter2( x, y, mask );

t.strictEqual( isArray( actual ), true, 'returns expected value' );
t.strictEqual( actual.length, 2, 'returns expected value' );
Expand All @@ -75,11 +75,11 @@ tape( 'the function filters array elements', function test( t ) {
t.deepEqual( actual[ 0 ], expected, 'returns expected value' );

expected = [];
t.notEqual( actual[ 1 ], idx, 'returns expected value' );
t.notEqual( actual[ 1 ], y, 'returns expected value' );
t.deepEqual( actual[ 1 ], expected, 'returns expected value' );

mask = [ 0, 0, 0, 1 ];
actual = mskfilter2( x, idx, mask );
actual = mskfilter2( x, y, mask );

t.strictEqual( isArray( actual ), true, 'returns expected value' );
t.strictEqual( actual.length, 2, 'returns expected value' );
Expand All @@ -91,11 +91,11 @@ tape( 'the function filters array elements', function test( t ) {
t.deepEqual( actual[ 0 ], expected, 'returns expected value' );

expected = [ 3 ];
t.notEqual( actual[ 1 ], idx, 'returns expected value' );
t.notEqual( actual[ 1 ], y, 'returns expected value' );
t.deepEqual( actual[ 1 ], expected, 'returns expected value' );

mask = [ 1, 1, 1, 1 ];
actual = mskfilter2( x, idx, mask );
actual = mskfilter2( x, y, mask );

t.strictEqual( isArray( actual ), true, 'returns expected value' );
t.strictEqual( actual.length, 2, 'returns expected value' );
Expand All @@ -107,7 +107,7 @@ tape( 'the function filters array elements', function test( t ) {
t.deepEqual( actual[ 0 ], expected, 'returns expected value' );

expected = [ 0, 1, 2, 3 ];
t.notEqual( actual[ 1 ], idx, 'returns expected value' );
t.notEqual( actual[ 1 ], y, 'returns expected value' );
t.deepEqual( actual[ 1 ], expected, 'returns expected value' );

t.end();
Expand All @@ -117,14 +117,14 @@ tape( 'the function filters array elements (accessors)', function test( t ) {
var expected;
var actual;
var mask;
var idx;
var y;
var x;
var i;

x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
idx = [ 0, 1, 2, 3 ];
y = [ 0, 1, 2, 3 ];
mask = [ 0, 1, 0, 1 ];
actual = mskfilter2( x, idx, mask );
actual = mskfilter2( x, y, mask );

t.strictEqual( isArray( actual ), true, 'returns expected value' );
t.strictEqual( actual.length, 2, 'returns expected value' );
Expand All @@ -139,9 +139,9 @@ tape( 'the function filters array elements (accessors)', function test( t ) {
t.deepEqual( actual[ 1 ], expected, 'returns expected value' );

x = new BooleanArray( [ true, false, false, true ] );
idx = [ 0, 1, 2, 3 ];
y = [ 0, 1, 2, 3 ];
mask = [ 0, 1, 0, 1 ];
actual = mskfilter2( x, idx, mask );
actual = mskfilter2( x, y, mask );

t.strictEqual( isArray( actual ), true, 'returns expected value' );
t.strictEqual( actual.length, 2, 'returns expected value' );
Expand Down
10 changes: 5 additions & 5 deletions lib/node_modules/@stdlib/array/base/mskfiltern/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ Returns new arrays by applying a mask to one or more provided input arrays in a

```javascript
var x = [ 1, 2, 3, 4 ];
var idx = [ 0, 1, 2, 3 ];
var y = [ 0, 1, 2, 3 ];

var out = mskfiltern( x, idx, [ 0, 1, 0, 1 ] );
var out = mskfiltern( x, y, [ 0, 1, 0, 1 ] );
// returns [ [ 2, 4 ], [ 1, 3 ] ]
```

Expand Down Expand Up @@ -79,8 +79,8 @@ var mskfiltern = require( '@stdlib/array/base/mskfiltern' );
var x = zeroTo( 20 );
console.log( x );

var idx = zeroTo( x.length );
console.log( idx );
var y = zeroTo( x.length );
console.log( y );

// Generate a random mask:
var mask = bernoulli( x.length, 0.5, {
Expand All @@ -89,7 +89,7 @@ var mask = bernoulli( x.length, 0.5, {
console.log( mask );

// Filter both arrays using the mask:
var out = mskfiltern( x, idx, mask );
var out = mskfiltern( x, y, mask );
console.log( out );
```

Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/array/base/mskfiltern/docs/repl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
Examples
--------
> var x = [ 1, 2, 3, 4 ];
> var idx = [ 0, 1, 2, 3 ];
> var out = {{alias}}( x, idx, [ 0, 1, 0, 1 ] )
> var y = [ 0, 1, 2, 3 ];
> var out = {{alias}}( x, y, [ 0, 1, 0, 1 ] )
[ [ 2, 4 ], [ 1, 3 ] ]

See Also
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ var mskfiltern = require( './../lib' );
var x = zeroTo( 20 );
console.log( x );

var idx = zeroTo( x.length );
console.log( idx );
var y = zeroTo( x.length );
console.log( y );

// Generate a random mask:
var mask = bernoulli( x.length, 0.5, {
Expand All @@ -36,5 +36,5 @@ var mask = bernoulli( x.length, 0.5, {
console.log( mask );

// Filter both arrays using the mask:
var out = mskfiltern( x, idx, mask );
var out = mskfiltern( x, y, mask );
console.log( out );
Loading

0 comments on commit 5e74a4e

Please sign in to comment.