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
thrownewTypeError(format('invalid argument. Must provide either a valid data source, options argument, or both. Value: `%s`.',options));
144
+
thrownewTypeError(format('0hT56',options));
145
145
}
146
146
if(hasOwnProp(options,'buffer')){
147
147
buffer=options.buffer;
148
148
if(!isArrayLikeObject(buffer)){// weak test
149
-
thrownewTypeError(format('invalid option. `%s` option must be an array-like object, typed-array-like, a Buffer, or an ndarray. Option: `%s`.','buffer',buffer));
// TODO: validate that minimum number of dimensions does not exceed the maximum number of possible dimensions (in theory, infinite; in practice, determined by max array length; see https://github.com/stdlib-js/stdlib/blob/ac350059877c036640775d6b30d0e98e840d07cf/lib/node_modules/%40stdlib/ndarray/ctor/lib/main.js#L57)
199
199
}else{
@@ -204,10 +204,10 @@ function array() {
204
204
if(hasOwnProp(options,'dtype')){
205
205
dtype=options.dtype;
206
206
if(!isDataType(dtype)){
207
-
thrownewTypeError(format('invalid option. `%s` option must be a recognized data type. Option: `%s`.','dtype',dtype));
// TODO: reconcile difference in behavior when provided a generic array and no `dtype` option. Currently, we cast here, but do not allow casting a generic array (by default) when explicitly providing a `dtype` option.
@@ -245,7 +245,7 @@ function array() {
245
245
order=defaults.order;
246
246
}
247
247
}elseif(!isOrder(order)){
248
-
thrownewTypeError(format('invalid option. `%s` option must be a recognized order. Option: `%s`.','order',order));
248
+
thrownewTypeError(format('0hT5C','order',order));
249
249
}
250
250
}else{
251
251
order=defaults.order;
@@ -268,7 +268,7 @@ function array() {
268
268
if(hasOwnProp(options,'copy')){
269
269
opts.copy=options.copy;
270
270
if(!isBoolean(opts.copy)){
271
-
thrownewTypeError(format('invalid option. `%s` option must be a boolean. Option: `%s`.','copy',opts.copy));
thrownewTypeError(format('invalid option. `%s` option must be an array-like object containing nonnegative integers. Option: `%s`.','shape',shape));
280
+
thrownewTypeError(format('0hT5D','shape',shape));
281
281
}
282
282
ndims=shape.length;
283
283
len=numel(shape);
@@ -297,7 +297,7 @@ function array() {
297
297
shape=[len];// assume a 1-dimensional array (vector)
298
298
}
299
299
}else{
300
-
thrownewError('invalid arguments. Must provide either a data source, array shape, or both.');
300
+
thrownewError(format('0hT0X'));
301
301
}
302
302
// Adjust the array shape to satisfy the minimum number of dimensions...
303
303
if(ndims<opts.ndmin){
@@ -307,7 +307,7 @@ function array() {
307
307
// If not provided a data buffer, create it; otherwise, see if we need to cast a provided data buffer to another data type or perform a copy...
308
308
if(FLG){
309
309
if(numel(buffer.shape)!==len){
310
-
thrownewRangeError('invalid arguments. Array shape is incompatible with provided data source. Number of data source elements does not match array shape.');
thrownewRangeError('invalid arguments. Array shape is incompatible with provided data source. Number of data source elements does not match array shape.');
0 commit comments