Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions lib/node_modules/@stdlib/blas/ext/circshift/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
var nonCoreShape = require( '@stdlib/ndarray/base/complement-shape' );
var getShape = require( '@stdlib/ndarray/shape' );
var getOrder = require( '@stdlib/ndarray/order' );
var defaults = require( '@stdlib/ndarray/defaults' );

Check warning on line 31 in lib/node_modules/@stdlib/blas/ext/circshift/lib/main.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

only the `get` property of the required module is used; require the property directly
var format = require( '@stdlib/string/format' );
var base = require( './base.js' );

Expand Down Expand Up @@ -81,12 +81,12 @@
if ( nargs === 2 ) {
// Case: circshift( x, k_scalar )
if ( isInteger( k ) ) {
return base( x, broadcastScalar( k, DEFAULT_DTYPE, [], getOrder( x ) ) );

Check warning on line 84 in lib/node_modules/@stdlib/blas/ext/circshift/lib/main.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

This line has a length of 85. Maximum allowed is 80
}
// Case: circshift( x, k_ndarray )
if ( isndarrayLike( k ) ) {
// As the operation is performed across all dimensions, `k` is assumed to be a zero-dimensional ndarray...
return base( x, k );
// As the operation is performed across all dimensions, `k` must be broadcast-compatible with a zero-dimensional ndarray...
return base( x, maybeBroadcastArray( k, [] ) );
}
throw new TypeError( format( 'invalid argument. Second argument must be either an ndarray or an integer. Value: `%s`.', k ) );
}
Expand All @@ -104,12 +104,13 @@
}
// Case: circshift( x, k_ndarray, opts )
else if ( isndarrayLike( k ) ) {
// When not provided `dims`, the operation is performed across all dimensions and `k` is assumed to be a zero-dimensional ndarray; when `dims` is provided, we need to broadcast `k` to match the shape of the non-core dimensions...
// When not provided `dims`, the operation is performed across all dimensions and `k` must be broadcast-compatible with a zero-dimensional ndarray; when `dims` is provided, we need to broadcast `k` to match the shape of the non-core dimensions...
if ( hasOwnProp( opts, 'dims' ) ) {
ka = maybeBroadcastArray( k, nonCoreShape( getShape( x ), opts.dims ) ); // eslint-disable-line max-len
sh = nonCoreShape( getShape( x ), opts.dims );
} else {
ka = k;
sh = [];
}
ka = maybeBroadcastArray( k, sh );
} else {
throw new TypeError( format( 'invalid argument. Second argument must be either an ndarray or an integer. Value: `%s`.', k ) );
}
Expand Down
11 changes: 7 additions & 4 deletions lib/node_modules/@stdlib/blas/ext/sort/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ function sort( x ) {
}
// Case: sort( x, sortOrder_ndarray )
if ( isndarrayLike( o ) ) {
// As the operation is performed across all dimensions, `o` is assumed to be a zero-dimensional ndarray...
return base( x, o );
// As the operation is performed across all dimensions, `o` must be broadcast-compatible with a zero-dimensional ndarray...
return base( x, maybeBroadcastArray( o, [] ) );
}
// Case: sort( x, opts )
opts = o;
Expand All @@ -201,10 +201,13 @@ function sort( x ) {
}
// Case: sort( x, sortOrder_ndarray, opts )
else if ( isndarrayLike( o ) ) {
// When not provided `dims`, the operation is performed across all dimensions and `o` is assumed to be a zero-dimensional ndarray; when `dims` is provided, we need to broadcast `o` to match the shape of the non-core dimensions...
// When not provided `dims`, the operation is performed across all dimensions and `o` must be broadcast-compatible with a zero-dimensional ndarray; when `dims` is provided, we need to broadcast `o` to match the shape of the non-core dimensions...
if ( hasOwnProp( opts, 'dims' ) ) {
o = maybeBroadcastArray( o, nonCoreShape( getShape( x ), opts.dims ) );
sh = nonCoreShape( getShape( x ), opts.dims );
} else {
sh = [];
}
o = maybeBroadcastArray( o, sh );
} else {
throw new TypeError( format( 'invalid argument. Second argument must be either an ndarray, a numeric scalar value, or a supported string. Value: `%s`.', o ) );
}
Expand Down
11 changes: 7 additions & 4 deletions lib/node_modules/@stdlib/blas/ext/sorthp/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ function sorthp( x ) {
}
// Case: sorthp( x, sortOrder_ndarray )
if ( isndarrayLike( o ) ) {
// As the operation is performed across all dimensions, `o` is assumed to be a zero-dimensional ndarray...
return base( x, o );
// As the operation is performed across all dimensions, `o` must be broadcast-compatible with a zero-dimensional ndarray...
return base( x, maybeBroadcastArray( o, [] ) );
}
// Case: sorthp( x, opts )
opts = o;
Expand All @@ -201,10 +201,13 @@ function sorthp( x ) {
}
// Case: sorthp( x, sortOrder_ndarray, opts )
else if ( isndarrayLike( o ) ) {
// When not provided `dims`, the operation is performed across all dimensions and `o` is assumed to be a zero-dimensional ndarray; when `dims` is provided, we need to broadcast `o` to match the shape of the non-core dimensions...
// When not provided `dims`, the operation is performed across all dimensions and `o` must be broadcast-compatible with a zero-dimensional ndarray; when `dims` is provided, we need to broadcast `o` to match the shape of the non-core dimensions...
if ( hasOwnProp( opts, 'dims' ) ) {
o = maybeBroadcastArray( o, nonCoreShape( getShape( x ), opts.dims ) );
sh = nonCoreShape( getShape( x ), opts.dims );
} else {
sh = [];
}
o = maybeBroadcastArray( o, sh );
} else {
throw new TypeError( format( 'invalid argument. Second argument must be either an ndarray, a numeric scalar value, or a supported string. Value: `%s`.', o ) );
}
Expand Down