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));
137
+
thrownewTypeError(format('0Le5K',options));
138
138
}
139
139
if(hasOwnProp(options,'buffer')){
140
140
buffer=options.buffer;
141
141
if(!isArrayLikeObject(buffer)){// weak test
142
-
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)
192
192
}else{
@@ -197,10 +197,10 @@ function array() {
197
197
if(hasOwnProp(options,'dtype')){
198
198
dtype=options.dtype;
199
199
if(!isDataType(dtype)){
200
-
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.
@@ -238,7 +238,7 @@ function array() {
238
238
order=defaults.order;
239
239
}
240
240
}elseif(!isOrder(order)){
241
-
thrownewTypeError(format('invalid option. `%s` option must be a recognized order. Option: `%s`.','order',order));
241
+
thrownewTypeError(format('0Le5Q','order',order));
242
242
}
243
243
}else{
244
244
order=defaults.order;
@@ -261,7 +261,7 @@ function array() {
261
261
if(hasOwnProp(options,'copy')){
262
262
opts.copy=options.copy;
263
263
if(!isBoolean(opts.copy)){
264
-
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));
273
+
thrownewTypeError(format('0Le5R','shape',shape));
274
274
}
275
275
ndims=shape.length;
276
276
len=numel(shape);
@@ -290,7 +290,7 @@ function array() {
290
290
shape=[len];// assume a 1-dimensional array (vector)
291
291
}
292
292
}else{
293
-
thrownewError('invalid arguments. Must provide either a data source, array shape, or both.');
293
+
thrownewError(format('0Le0X'));
294
294
}
295
295
// Adjust the array shape to satisfy the minimum number of dimensions...
296
296
if(ndims<opts.ndmin){
@@ -300,7 +300,7 @@ function array() {
300
300
// 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...
301
301
if(FLG){
302
302
if(buffer.length!==len){
303
-
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