Skip to content

Commit 821ed4a

Browse files
committed
Auto-generated commit
1 parent 5322117 commit 821ed4a

File tree

9 files changed

+157
-916
lines changed

9 files changed

+157
-916
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,10 @@ A total of 44 issues were closed in this release:
807807

808808
<details>
809809

810+
- [`ff1c6e2`](https://github.com/stdlib-js/stdlib/commit/ff1c6e2ff7d740b54dab525047eb5d7786854276) - **docs:** update docs and examples to accommodate dtype instances _(by Athan Reines)_
811+
- [`8112cea`](https://github.com/stdlib-js/stdlib/commit/8112cea1ed134b3070555a08d76ffb7b334f58ef) - **refactor:** remove overloads and use generic _(by Athan Reines)_
812+
- [`8b2b591`](https://github.com/stdlib-js/stdlib/commit/8b2b591c7511b405d069d9c4361ea3cfd796c4c6) - **refactor:** remove unnecessary offset calculation _(by Athan Reines)_
813+
- [`15b0d66`](https://github.com/stdlib-js/stdlib/commit/15b0d6624fb1dcbfb63b43291354c1ef6fbbd75b) - **refactor:** remove unnecessary offset calculation _(by Athan Reines)_
810814
- [`f759b2b`](https://github.com/stdlib-js/stdlib/commit/f759b2b5ed4db16f35f0544fb65ed38a957f9f7b) - **refactor:** remove overloads and use generic _(by Athan Reines)_
811815
- [`e00d73a`](https://github.com/stdlib-js/stdlib/commit/e00d73a3cb8c5355a46771ed5630d178e25ec0f4) - **feat:** add `onesLike` to namespace _(by Athan Reines)_
812816
- [`d200536`](https://github.com/stdlib-js/stdlib/commit/d200536a79672d3a31022f894a63acdf08b79159) - **feat:** add `ndarray/base/ones-like` _(by Athan Reines)_

empty-like/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ var getDType = require( '@stdlib/ndarray/dtype' );
5050
var zeros = require( '@stdlib/ndarray/zeros' );
5151

5252
var x = zeros( [ 2, 2 ] );
53-
// returns <ndarray>
53+
// returns <ndarray>[ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]
5454

5555
var y = emptyLike( x );
5656
// returns <ndarray>
@@ -67,8 +67,8 @@ The function supports the following `options`:
6767
- **dtype**: output [ndarray][@stdlib/ndarray/ctor] [data type][@stdlib/ndarray/dtypes]. Overrides the input ndarray's inferred [data type][@stdlib/ndarray/dtypes].
6868
- **shape**: output [ndarray][@stdlib/ndarray/ctor] shape. Overrides the input ndarray's inferred shape.
6969
- **order**: specifies whether the output [ndarray][@stdlib/ndarray/ctor] should be `'row-major'` (C-style) or `'column-major'` (Fortran-style). Overrides the input ndarray's inferred order.
70-
- **mode**: specifies how to handle indices which exceed array dimensions (see [`ndarray`][@stdlib/ndarray/ctor]). Default: `'throw'`.
71-
- **submode**: a mode array which specifies for each dimension how to handle subscripts which exceed array dimensions (see [`ndarray`][@stdlib/ndarray/ctor]). If provided fewer modes than dimensions, the constructor recycles modes using modulo arithmetic. Default: `[ options.mode ]`.
70+
- **mode**: specifies how to handle indices which exceed array dimensions (see [ndarray][@stdlib/ndarray/ctor]). Default: `'throw'`.
71+
- **submode**: a mode array which specifies for each dimension how to handle subscripts which exceed array dimensions (see [ndarray][@stdlib/ndarray/ctor]). If provided fewer modes than dimensions, the constructor recycles modes using modulo arithmetic. Default: `[ options.mode ]`.
7272

7373
To override either the `dtype`, `shape`, or `order`, specify the corresponding option. For example, to override the inferred [data type][@stdlib/ndarray/dtypes],
7474

@@ -78,7 +78,7 @@ var getDType = require( '@stdlib/ndarray/dtype' );
7878
var zeros = require( '@stdlib/ndarray/zeros' );
7979

8080
var x = zeros( [ 2, 2 ] );
81-
// returns <ndarray>
81+
// returns <ndarray>[ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]
8282

8383
var dt = String( getDType( x ) );
8484
// returns 'float64'
@@ -121,9 +121,9 @@ dt = String( getDType( y ) );
121121
<!-- eslint no-undef: "error" -->
122122

123123
```javascript
124-
var getData = require( '@stdlib/ndarray/data-buffer' );
125124
var dtypes = require( '@stdlib/ndarray/dtypes' );
126125
var empty = require( '@stdlib/ndarray/empty' );
126+
var ndarray2array = require( '@stdlib/ndarray/to-array' );
127127
var emptyLike = require( '@stdlib/ndarray/empty-like' );
128128

129129
// Get a list of data types:
@@ -138,7 +138,7 @@ for ( i = 0; i < dt.length; i++ ) {
138138
'dtype': dt[ i ]
139139
});
140140
y = emptyLike( x );
141-
console.log( getData( y ) );
141+
console.log( ndarray2array( y ) );
142142
}
143143
```
144144

empty-like/docs/repl.txt

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
options.shape: ArrayLikeObject<integer>|integer (optional)
2929
Array shape. Overrides the input array's inferred shape.
3030

31-
options.dtype: string (optional)
31+
options.dtype: string|DataType (optional)
3232
Array data type. Overrides the input array's inferred data type.
3333

3434
options.order: string (optional)
@@ -65,18 +65,10 @@
6565

6666
Examples
6767
--------
68-
> var x = {{alias:@stdlib/ndarray/base/zeros}}( 'float64', [ 2, 2 ], 'row-major' )
69-
<ndarray>
70-
> var sh = {{alias:@stdlib/ndarray/shape}}( x )
71-
[ 2, 2 ]
72-
> var dt = {{alias:@stdlib/ndarray/dtype}}( x ).toString()
73-
'float64'
68+
> var x = {{alias:@stdlib/ndarray/zeros}}( [ 2, 2 ] )
69+
<ndarray>[ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]
7470
> var y = {{alias}}( x )
7571
<ndarray>
76-
> sh = {{alias:@stdlib/ndarray/shape}}( y )
77-
[ 2, 2 ]
78-
> dt = {{alias:@stdlib/ndarray/dtype}}( y ).toString()
79-
'float64'
8072

8173
See Also
8274
--------

0 commit comments

Comments
 (0)