Skip to content

Commit 327cda9

Browse files
authored
feat!: update ndarray TypeScript declarations
This commit updates the `concat` API to accept an options argument rather than a `dim` argument. To specify a dimension, one should pass in an options object with a `dim` property. BREAKING CHANGE: move `dim` argument to option To migrate, users wanting to specify a dimension along which to concatenate input arrays should provide an object containing a `dim` property. PR-URL: #9508 Reviewed-by: Athan Reines <kgryte@gmail.com>
1 parent c026135 commit 327cda9

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

  • lib/node_modules/@stdlib/ndarray/docs/types

lib/node_modules/@stdlib/ndarray/docs/types/index.d.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,10 @@ interface Namespace {
489489
* Concatenates a list of ndarrays along a specified ndarray dimension.
490490
*
491491
* @param arrays - array-like object containing input ndarrays
492-
* @param dim - dimension along which to concatenate input ndarrays
492+
* @param options - function options
493493
* @returns output ndarray
494494
*
495495
* @example
496-
* var ndarray2array = require( '@stdlib/ndarray/to-array' );
497496
* var Float64Array = require( '@stdlib/array/float64' );
498497
* var ndarray = require( '@stdlib/ndarray/ctor' );
499498
*
@@ -503,14 +502,12 @@ interface Namespace {
503502
* var ybuf = new Float64Array( [ -5.0, 6.0, -7.0, 8.0, -9.0, 10.0 ] );
504503
* var y = new ndarray( 'float64', ybuf, [ 2, 3 ], [ 3, 1 ], 0, 'row-major' );
505504
*
506-
* var out = ns.concat( [ x, y ], -1 );
507-
* // returns <ndarray>
508-
*
509-
* var arr = ndarray2array( out );
510-
* // returns [ [ -1.0, 2.0, -5.0, 6.0, -7.0 ], [ -3.0, 4.0, 8.0, -9.0, 10.0 ] ]
505+
* var out = ns.concat( [ x, y ], {
506+
* 'dim': -1
507+
* });
508+
* // returns <ndarray>[ [ -1.0, 2.0, -5.0, 6.0, -7.0 ], [ -3.0, 4.0, 8.0, -9.0, 10.0 ] ]
511509
*
512510
* @example
513-
* var ndarray2array = require( '@stdlib/ndarray/to-array' );
514511
* var Float64Array = require( '@stdlib/array/float64' );
515512
* var ndarray = require( '@stdlib/ndarray/ctor' );
516513
*
@@ -522,13 +519,13 @@ interface Namespace {
522519
*
523520
* var z = new ndarray( 'float64', new Float64Array( 10 ), [ 2, 5 ], [ 5, 1 ], 0, 'row-major' );
524521
*
525-
* var out = ns.concat.assign( [ x, y ], z, -1 );
522+
* var out = ns.concat.assign( [ x, y ], z, {
523+
* 'dim': -1
524+
* });
525+
* // returns <ndarray>[ [ -1.0, 2.0, -5.0, 6.0, -7.0 ], [ -3.0, 4.0, 8.0, -9.0, 10.0 ] ]
526526
*
527527
* var bool = ( out === z );
528528
* // returns true
529-
*
530-
* var arr = ndarray2array( z );
531-
* // returns [ [ -1.0, 2.0, -5.0, 6.0, -7.0 ], [ -3.0, 4.0, 8.0, -9.0, 10.0 ] ]
532529
*/
533530
concat: typeof concat;
534531

0 commit comments

Comments
 (0)