You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
<section class="release" id="unreleased">
6
6
7
-
## Unreleased (2026-04-07)
7
+
## Unreleased (2026-04-08)
8
8
9
9
<section class="features">
10
10
@@ -820,7 +820,16 @@ A total of 45 issues were closed in this release:
820
820
821
821
<details>
822
822
823
+
- [`c8df03c`](https://github.com/stdlib-js/stdlib/commit/c8df03cfe4cb5362cfff5f981aff4c0abc6d0e5a) - **refactor:** add support for ancilliary ndarrays which decompose into subarrays _(by Athan Reines)_
- [`a467bf0`](https://github.com/stdlib-js/stdlib/commit/a467bf0083da8f346611e53a684a78212f76d426) - **chore:** fix typos and incorrect test values [(#11270)](https://github.com/stdlib-js/stdlib/pull/11270) _(by Philipp Burckhardt)_
thrownewError('invalid argument. First argument specifies an unexpected number of types. Two input ndarray data types must be specified for each provided strided function.');
178
179
}
179
-
this._idtypes=idtypes;
180
-
this._odtypes=odtypes;
180
+
this._idtypes=idt;
181
+
this._odtypes=odt;
181
182
this._policies={
182
183
'output': policies.output,
183
184
'casting': policies.casting
@@ -240,6 +241,8 @@ setReadOnly( BinaryStrided1dDispatch.prototype, 'apply', function apply( x, y )
240
241
varordx;
241
242
varordy;
242
243
varordz;
244
+
varxdte;
245
+
varydte;
243
246
varerr;
244
247
varidx;
245
248
varshx;
@@ -265,12 +268,14 @@ setReadOnly( BinaryStrided1dDispatch.prototype, 'apply', function apply( x, y )
265
268
thrownewTypeError(format('invalid argument. Second argument must be an ndarray-like object. Value: `%s`.',y));
266
269
}
267
270
xdt=getDType(x);
268
-
if(!contains(this._idtypes[0],resolveStr(xdt))){
269
-
thrownewTypeError(format('invalid argument. First argument must have one of the following data types: "%s". Data type: `%s`.',join(this._idtypes[0],'", "'),xdt));
271
+
xdte=resolveEnum(xdt);
272
+
if(!contains(this._idtypes[0],xdte)){
273
+
thrownewTypeError(format('invalid argument. First argument must have one of the following data types: "%s". Data type: `%s`.',join(dtypes2strings(this._idtypes[0]),'", "'),xdt));
270
274
}
271
275
ydt=getDType(y);
272
-
if(!contains(this._idtypes[1],resolveStr(ydt))){
273
-
thrownewTypeError(format('invalid argument. Second argument must have one of the following data types: "%s". Data type: `%s`.',join(this._idtypes[1],'", "'),ydt));
276
+
ydte=resolveEnum(ydt);
277
+
if(!contains(this._idtypes[1],ydte)){
278
+
thrownewTypeError(format('invalid argument. Second argument must have one of the following data types: "%s". Data type: `%s`.',join(dtypes2strings(this._idtypes[1]),'", "'),ydt));
274
279
}
275
280
args=[x,y];
276
281
for(i=2;i<nargs;i++){
@@ -279,10 +284,10 @@ setReadOnly( BinaryStrided1dDispatch.prototype, 'apply', function apply( x, y )
279
284
break;
280
285
}
281
286
dt=getDType(arr);
282
-
if(!contains(this._idtypes[i],resolveStr(dt))){
283
-
thrownewTypeError(format('invalid argument. Argument %d must have one of the following data types: "%s". Data type: `%s`.',i,join(this._idtypes[i],'", "'),dt));
287
+
if(!contains(this._idtypes[i],resolveEnum(dt))){
288
+
thrownewTypeError(format('invalid argument. Argument %d must have one of the following data types: "%s". Data type: `%s`.',i,join(dtypes2strings(this._idtypes[i]),'", "'),dt));
284
289
}
285
-
// Note: we don't type promote additional ndarray arguments, as they are passed as scalars to the underlying strided reduction function...
290
+
// Note: we don't type promote additional ndarray arguments...
286
291
args.push(arr);
287
292
}
288
293
// If we didn't make it up until the last argument, this means that we found a non-options argument which was not an ndarray...
@@ -338,23 +343,23 @@ setReadOnly( BinaryStrided1dDispatch.prototype, 'apply', function apply( x, y )
338
343
339
344
// Determine whether we need to cast the input ndarrays...
@@ -430,6 +435,8 @@ setReadOnly( BinaryStrided1dDispatch.prototype, 'assign', function assign( x, y
430
435
varnargs;
431
436
varopts;
432
437
varargs;
438
+
varxdte;
439
+
varydte;
433
440
vararr;
434
441
varerr;
435
442
varflg;
@@ -455,12 +462,14 @@ setReadOnly( BinaryStrided1dDispatch.prototype, 'assign', function assign( x, y
455
462
}
456
463
// Validate the input ndarray data types in order to maintain similar behavior to `apply` above...
457
464
xdt=getDType(x);
458
-
if(!contains(this._idtypes[0],resolveStr(xdt))){
459
-
thrownewTypeError(format('invalid argument. First argument must have one of the following data types: "%s". Data type: `%s`.',join(this._idtypes[0],'", "'),xdt));
465
+
xdte=resolveEnum(xdt);
466
+
if(!contains(this._idtypes[0],xdte)){
467
+
thrownewTypeError(format('invalid argument. First argument must have one of the following data types: "%s". Data type: `%s`.',join(dtypes2strings(this._idtypes[0]),'", "'),xdt));
460
468
}
461
469
ydt=getDType(y);
462
-
if(!contains(this._idtypes[1],resolveStr(ydt))){
463
-
thrownewTypeError(format('invalid argument. Second argument must have one of the following data types: "%s". Data type: `%s`.',join(this._idtypes[1],'", "'),ydt));
470
+
ydte=resolveEnum(ydt);
471
+
if(!contains(this._idtypes[1],ydte)){
472
+
thrownewTypeError(format('invalid argument. Second argument must have one of the following data types: "%s". Data type: `%s`.',join(dtypes2strings(this._idtypes[1]),'", "'),ydt));
464
473
}
465
474
// Verify that both input arrays have the same shape:
466
475
shx=getShape(x);
@@ -500,11 +509,11 @@ setReadOnly( BinaryStrided1dDispatch.prototype, 'assign', function assign( x, y
500
509
// Cache a reference to the output ndarray:
501
510
z=args.pop();
502
511
503
-
// Verify that additional ndarray arguments have expected dtypes (note: we intentionally don't validate the output ndarray dtype in order to provide an escape hatch for a user wanting to have an output ndarray having a specific dtype that `apply` does not support; note: we don't type promote additional ndarray arguments, as they are passed as scalars to the underlying strided reduction function)...
512
+
// Verify that additional ndarray arguments have expected dtypes (note: we intentionally don't validate the output ndarray dtype in order to provide an escape hatch for a user wanting to have an output ndarray having a specific dtype that `apply` does not support; note: we don't type promote additional ndarray arguments)...
504
513
for(i=2;i<args.length;i++){
505
514
dt=getDType(args[i]);
506
-
if(!contains(this._idtypes[i],resolveStr(dt))){
507
-
thrownewTypeError(format('invalid argument. Argument %d must have one of the following data types: "%s". Data type: `%s`.',i,join(this._idtypes[i],'", "'),dt));
515
+
if(!contains(this._idtypes[i],resolveEnum(dt))){
516
+
thrownewTypeError(format('invalid argument. Argument %d must have one of the following data types: "%s". Data type: `%s`.',i,join(dtypes2strings(this._idtypes[i]),'", "'),dt));
508
517
}
509
518
}
510
519
// Validate any provided options...
@@ -523,23 +532,23 @@ setReadOnly( BinaryStrided1dDispatch.prototype, 'assign', function assign( x, y
523
532
// Determine whether we need to cast the input ndarrays...
returnnewTypeError(format('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.','dtype',join(dtypes,'", "'),options.dtype));
89
+
opts.dtype=options.dtype;
90
+
if(!contains(dtypes,resolveEnum(opts.dtype))){
91
+
returnnewTypeError(format('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.','dtype',join(dtypes2strings(dtypes),'", "'),options.dtype));
Copy file name to clipboardExpand all lines: base/unary-reduce-strided1d-dispatch-by-factory/lib/main.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -31,10 +31,10 @@ var UnaryStrided1dDispatchBy = require( './../../../base/unary-reduce-strided1d-
31
31
*
32
32
* @param {Object} table - dispatch table
33
33
* @param {Function} table.default - default strided reduction function
34
-
* @param {StringArray} [table.types] - one-dimensional list of ndarray data types describing specialized input ndarray argument signatures
34
+
* @param {ArrayLikeObject} [table.types] - one-dimensional list of ndarray data types describing specialized input ndarray argument signatures
35
35
* @param {ArrayLikeObject<Function>} [table.fcns] - list of strided reduction functions which are specific to specialized input ndarray argument signatures
36
-
* @param {ArrayLikeObject<StringArray>} idtypes - list containing lists of supported input data types for each ndarray argument
37
-
* @param {StringArray} odtypes - list of supported output data types
36
+
* @param {ArrayLikeObject<ArrayLikeObject>} idtypes - list containing lists of supported input data types for each ndarray argument
37
+
* @param {ArrayLikeObject} odtypes - list of supported output data types
38
38
* @param {Object} policies - policies
39
39
* @param {string} policies.output - output data type policy
* @param {IntegerArray} [options.dims] - list of dimensions over which to perform a reduction
127
127
* @param {boolean} [options.keepdims=false] - boolean indicating whether the reduced dimensions should be included in the returned ndarray as singleton dimensions
128
-
* @param {string} [options.dtype] - output ndarray data type
128
+
* @param {*} [options.dtype] - output ndarray data type
129
129
* @param {Function} clbk - callback function
130
130
* @param {*} [thisArg] - callback function execution context
131
131
* @throws {TypeError} first argument must be an ndarray
0 commit comments