Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Mar 28, 2022
1 parent 55716f0 commit dfe4f7b
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cancel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#/

# Workflow name:
name: Cancel Workflow Runs
name: cancel

# Workflow triggers:
on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#/

# Workflow name:
name: Publish Package
name: publish

# Workflow triggers:
on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#/

# Workflow name:
name: build
name: test

# Workflow triggers:
on:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_bundles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
#/

# Workflow name:
name: Test Loading Bundles
name: test_bundles

# Workflow triggers:
on:
workflow_run:
workflows: ["bundle"]
workflows: ["test"]
types: [completed]
workflow_dispatch:

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
#/

# Workflow name:
name: coverage
name: test_coverage

# Workflow triggers:
on:
workflow_run:
workflows: ["build"]
workflows: ["test"]
types: [completed]
workflow_dispatch:

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
#/

# Workflow name:
name: Test Installing Dependencies
name: test_install

# Workflow triggers:
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '30 1 * * 6'
workflow_run:
workflows: ["Publish Package"]
workflows: ["publish"]
types: [completed]
workflow_dispatch:

Expand Down
22 changes: 11 additions & 11 deletions complex128/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function Complex128Array() {
if ( buf === null ) {
// We failed and we are now forced to allocate a new array :-(
if ( !isEven( len ) ) {
throw new RangeError( 'invalid argument. Array-like object input arguments must have a length which is a multiple of two. Length: `'+len+'`.' );
throw new RangeError( format( 'invalid argument. Array-like object input arguments must have a length which is a multiple of two. Length: `%u`.', len ) );
}
// We failed, so fall back to directly setting values...
buf = new Float64Array( arguments[0] );
Expand All @@ -247,20 +247,20 @@ function Complex128Array() {
} else if ( isComplex128Array( buf ) ) {
buf = reinterpret128( buf, 0 );
} else if ( !isEven( len ) ) {
throw new RangeError( 'invalid argument. Array-like object and typed array input arguments must have a length which is a multiple of two. Length: `'+len+'`.' );
throw new RangeError( format( 'invalid argument. Array-like object and typed array input arguments must have a length which is a multiple of two. Length: `%u`.', len ) );
}
buf = new Float64Array( buf );
}
} else if ( isArrayBuffer( arguments[0] ) ) {
buf = arguments[ 0 ];
if ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {
throw new RangeError( 'invalid argument. ArrayBuffer byte length must be a multiple of '+BYTES_PER_ELEMENT+'. Byte length: `'+buf.byteLength+'`.' );
throw new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of `%u`. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );
}
buf = new Float64Array( buf );
} else if ( isObject( arguments[0] ) ) {
buf = arguments[ 0 ];
if ( HAS_ITERATOR_SYMBOL === false ) {
throw new TypeError( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `'+buf+'`.' );
throw new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) );
}
if ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {
throw new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );
Expand All @@ -275,7 +275,7 @@ function Complex128Array() {
}
buf = new Float64Array( buf );
} else {
throw new TypeError( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `'+arguments[0]+'`.' );
throw new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );
}
} else {
buf = arguments[ 0 ];
Expand All @@ -287,12 +287,12 @@ function Complex128Array() {
throw new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );
}
if ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {
throw new RangeError( 'invalid argument. Byte offset must be a multiple of '+BYTES_PER_ELEMENT+'. Value: `'+byteOffset+'`.' );
throw new RangeError( format( 'invalid argument. Byte offset must be a multiple of `%u`. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );
}
if ( nargs === 2 ) {
len = buf.byteLength - byteOffset;
if ( !isInteger( len/BYTES_PER_ELEMENT ) ) {
throw new RangeError( 'invalid arguments. ArrayBuffer view byte length must be a multiple of '+BYTES_PER_ELEMENT+'. View byte length: `'+len+'`.' );
throw new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of `%u`. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );
}
buf = new Float64Array( buf, byteOffset );
} else {
Expand All @@ -301,7 +301,7 @@ function Complex128Array() {
throw new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );
}
if ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {
throw new RangeError( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `'+(len*BYTES_PER_ELEMENT)+'`.' );
throw new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );
}
buf = new Float64Array( buf, byteOffset, len*2 );
}
Expand Down Expand Up @@ -459,7 +459,7 @@ setReadOnly( Complex128Array, 'from', function from( src ) {
// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...
if ( flg ) {
if ( !isEven( len ) ) {
throw new RangeError( 'invalid argument. First argument must have a length which is a multiple of two. Length: `'+len+'`.' );
throw new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.', len ) );
}
out = new this( len/2 );
buf = out._buffer; // eslint-disable-line no-underscore-dangle
Expand Down Expand Up @@ -946,7 +946,7 @@ setReadOnly( Complex128Array.prototype, 'set', function set( value ) {
}
if ( isComplexLike( value ) ) {
if ( idx >= this._length ) {
throw new RangeError( 'invalid argument. Index argument is out-of-bounds. Value: `'+idx+'`.' );
throw new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );
}
idx *= 2;
buf[ idx ] = real( value );
Expand Down Expand Up @@ -998,7 +998,7 @@ setReadOnly( Complex128Array.prototype, 'set', function set( value ) {
// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...
if ( flg ) {
if ( !isEven( N ) ) {
throw new RangeError( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `'+N+'`.' );
throw new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );
}
if ( idx+(N/2) > this._length ) {
throw new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );
Expand Down
22 changes: 11 additions & 11 deletions complex64/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function Complex64Array() {
if ( buf === null ) {
// We failed and we are now forced to allocate a new array :-(
if ( !isEven( len ) ) {
throw new RangeError( 'invalid argument. Array-like object input arguments must have a length which is a multiple of two. Length: `'+len+'`.' );
throw new RangeError( format( 'invalid argument. Array-like object input arguments must have a length which is a multiple of two. Length: `%u`.', len ) );
}
// We failed, so fall back to directly setting values...
buf = new Float32Array( arguments[0] );
Expand All @@ -247,20 +247,20 @@ function Complex64Array() {
} else if ( isComplex128Array( buf ) ) {
buf = reinterpret128( buf, 0 );
} else if ( !isEven( len ) ) {
throw new RangeError( 'invalid argument. Array-like object and typed array input arguments must have a length which is a multiple of two. Length: `'+len+'`.' );
throw new RangeError( format( 'invalid argument. Array-like object and typed array input arguments must have a length which is a multiple of two. Length: `%u`.', len ) );
}
buf = new Float32Array( buf );
}
} else if ( isArrayBuffer( arguments[0] ) ) {
buf = arguments[ 0 ];
if ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {
throw new RangeError( 'invalid argument. ArrayBuffer byte length must be a multiple of '+BYTES_PER_ELEMENT+'. Byte length: `'+buf.byteLength+'`.' );
throw new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of `%u`. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );
}
buf = new Float32Array( buf );
} else if ( isObject( arguments[0] ) ) {
buf = arguments[ 0 ];
if ( HAS_ITERATOR_SYMBOL === false ) {
throw new TypeError( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `'+buf+'`.' );
throw new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) );
}
if ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {
throw new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );
Expand All @@ -275,7 +275,7 @@ function Complex64Array() {
}
buf = new Float32Array( buf );
} else {
throw new TypeError( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `'+arguments[0]+'`.' );
throw new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );
}
} else {
buf = arguments[ 0 ];
Expand All @@ -287,12 +287,12 @@ function Complex64Array() {
throw new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );
}
if ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {
throw new RangeError( 'invalid argument. Byte offset must be a multiple of '+BYTES_PER_ELEMENT+'. Value: `'+byteOffset+'`.' );
throw new RangeError( format( 'invalid argument. Byte offset must be a multiple of `%u`. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );
}
if ( nargs === 2 ) {
len = buf.byteLength - byteOffset;
if ( !isInteger( len/BYTES_PER_ELEMENT ) ) {
throw new RangeError( 'invalid arguments. ArrayBuffer view byte length must be a multiple of '+BYTES_PER_ELEMENT+'. View byte length: `'+len+'`.' );
throw new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of `%u`. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );
}
buf = new Float32Array( buf, byteOffset );
} else {
Expand All @@ -301,7 +301,7 @@ function Complex64Array() {
throw new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );
}
if ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {
throw new RangeError( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `'+(len*BYTES_PER_ELEMENT)+'`.' );
throw new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );
}
buf = new Float32Array( buf, byteOffset, len*2 );
}
Expand Down Expand Up @@ -459,7 +459,7 @@ setReadOnly( Complex64Array, 'from', function from( src ) {
// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...
if ( flg ) {
if ( !isEven( len ) ) {
throw new RangeError( 'invalid argument. First argument must have a length which is a multiple of two. Length: `'+len+'`.' );
throw new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.', len ) );
}
out = new this( len/2 );
buf = out._buffer; // eslint-disable-line no-underscore-dangle
Expand Down Expand Up @@ -946,7 +946,7 @@ setReadOnly( Complex64Array.prototype, 'set', function set( value ) {
}
if ( isComplexLike( value ) ) {
if ( idx >= this._length ) {
throw new RangeError( 'invalid argument. Index argument is out-of-bounds. Value: `'+idx+'`.' );
throw new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );
}
idx *= 2;
buf[ idx ] = realf( value );
Expand Down Expand Up @@ -998,7 +998,7 @@ setReadOnly( Complex64Array.prototype, 'set', function set( value ) {
// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...
if ( flg ) {
if ( !isEven( N ) ) {
throw new RangeError( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `'+N+'`.' );
throw new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );
}
if ( idx+(N/2) > this._length ) {
throw new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );
Expand Down
3 changes: 2 additions & 1 deletion convert-same/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

var getType = require( './../../dtype' );
var convert = require( './../../convert' );
var format = require( '@stdlib/string/format' );


// MAIN //
Expand All @@ -47,7 +48,7 @@ var convert = require( './../../convert' );
function convertSame( x, y ) {
var dtype = getType( y );
if ( dtype === null ) {
throw new TypeError( 'invalid argument. Second argument must have a recognized/supported data type. Type: `' + dtype + '`. Value: `' + y + '`.' );
throw new TypeError( format( 'invalid argument. Second argument must have a recognized/supported data type. Type: `%s`. Value: `%s`.', dtype, y ) );
}
return convert( x, dtype );
}
Expand Down
2 changes: 1 addition & 1 deletion linspace/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function linspace( start, stop, len ) {
}
ctor = ctors( opts.dtype );
if ( ctor === null ) {
throw new TypeError( 'invalid argument. `dtype` option must be a real or complex floating-point data type or "generic". Option: `' + opts.dtype + '`.' );
throw new TypeError( format( 'invalid argument. `%s` option must be a real or complex floating-point data type or "generic". Option: `%s`.', 'dtype', opts.dtype ) );
}
out = new ctor( len );
if ( opts.dtype === 'complex64' ) {
Expand Down

0 comments on commit dfe4f7b

Please sign in to comment.