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
feat!: move optional argument to options object in ndarray/concat
This commit moves an optional `dim` argument to an options object. The motivation for doing this is to allow future API expansion with additional options (e.g., a `dtype` option to specify the output value dtype, etc).
BREAKING CHANGE: move `dim` argument to options object
To migrate, users should replace any usage of an optional `dim` argument with an options object with a `dim` property (e.g., `{'dim': -1}`).
PR-URL: #9480Closes: stdlib-js/metr-issue-tracker#144
Co-authored-by: Athan Reines <kgryte@gmail.com>
Reviewed-by: Athan Reines <kgryte@gmail.com>
-**arrays**: a list of input [ndarrays][@stdlib/ndarray/ctor]. Must be [broadcast compatible][@stdlib/ndarray/base/broadcast-shapes] except for the dimension along which to concatenate. The data type of the output [ndarray][@stdlib/ndarray/ctor] is determined by applying [type promotion rules][@stdlib/ndarray/promotion-rules] to the list of input [ndarrays][@stdlib/ndarray/ctor]. If provided [ndarrays][@stdlib/ndarray/ctor] having different [memory layouts][@stdlib/ndarray/orders], the output [ndarray][@stdlib/ndarray/ctor] has the [default order][@stdlib/ndarray/defaults].
64
-
-**dim**: dimension along which to concatenate input [ndarrays][@stdlib/ndarray/ctor] (_optional_). Must be a negative integer. The index of the dimension along which to concatenate is resolved relative to the last dimension, with the last dimension corresponding to the value `-1`. Default: `-1`.
62
+
-**options**: function options (_optional_).
63
+
64
+
The function accepts the following `options`:
65
+
66
+
-**dim**: dimension along which to concatenate input [ndarrays][@stdlib/ndarray/ctor]. Must be a negative integer. The index of the dimension along which to concatenate is resolved relative to the last dimension, with the last dimension corresponding to the value `-1`. Default: `-1`.
65
67
66
-
#### concat.assign( arrays, out\[, dim] )
68
+
#### concat.assign( arrays, out\[, options] )
67
69
68
70
Concatenates a list of ndarrays along a specified ndarray dimension and assigns results to an output ndarray.
69
71
70
72
```javascript
71
73
var array =require( '@stdlib/ndarray/array' );
72
74
var zeros =require( '@stdlib/ndarray/zeros' );
73
-
var ndarray2array =require( '@stdlib/ndarray/to-array' );
74
75
75
76
var x =array( [ [ -1.0, 2.0 ], [ -3.0, 4.0 ] ] );
76
77
var y =array( [ [ -5.0, 6.0, -7.0 ], [ 8.0, -9.0, 10.0 ] ] );
-**arrays**: a list of input [ndarrays][@stdlib/ndarray/ctor]. Must be [broadcast compatible][@stdlib/ndarray/base/broadcast-shapes] except for the dimension along which to concatenate. Must [promote][@stdlib/ndarray/promotion-rules] to a [data type][@stdlib/ndarray/dtypes] which can be (mostly) [safely cast][@stdlib/ndarray/mostly-safe-casts] to the [data type][@stdlib/ndarray/dtypes] of the output [ndarray][@stdlib/ndarray/ctor].
93
93
-**out**: output [ndarray][@stdlib/ndarray/ctor].
94
-
-**dim**: dimension along which to concatenate input [ndarrays][@stdlib/ndarray/ctor] (_optional_). Must be a negative integer. The index of the dimension along which to concatenate is resolved relative to the last dimension, with the last dimension corresponding to the value `-1`. Default: `-1`.
94
+
-**options**: function options (_optional_).
95
+
96
+
The function accepts the following `options`:
97
+
98
+
-**dim**: dimension along which to concatenate input [ndarrays][@stdlib/ndarray/ctor]. Must be a negative integer. The index of the dimension along which to concatenate is resolved relative to the last dimension, with the last dimension corresponding to the value `-1`. Default: `-1`.
0 commit comments