Skip to content

Commit 82d6b52

Browse files
committed
Auto-generated commit
1 parent c6e1438 commit 82d6b52

File tree

8 files changed

+105
-572
lines changed

8 files changed

+105
-572
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,7 @@ A total of 45 issues were closed in this release:
818818

819819
<details>
820820

821+
- [`2db5404`](https://github.com/stdlib-js/stdlib/commit/2db5404d6a12f2d0c20fb61a5ce047daea72ea3f) - **refactor:** improve type specificity and use accessors for resolving ndarray meta data _(by Athan Reines)_
821822
- [`8dbfe60`](https://github.com/stdlib-js/stdlib/commit/8dbfe608b990c4e12c729daa01489de8f6b56ac3) - **feat:** add support for dtype instances _(by Athan Reines)_
822823
- [`3c6b016`](https://github.com/stdlib-js/stdlib/commit/3c6b01628169badc19aed4201cb66a5265c5d378) - **refactor:** improve type specificity _(by Athan Reines)_
823824
- [`2bc2d8b`](https://github.com/stdlib-js/stdlib/commit/2bc2d8b3568550581f6574843480eccd40c7589a) - **test:** use accessors to resolve ndarray meta data _(by Athan Reines)_

base/reverse-dimension/README.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,31 +45,25 @@ var reverseDimension = require( '@stdlib/ndarray/base/reverse-dimension' );
4545
Returns a view of an input ndarray in which the order of elements along a specified dimension is reversed.
4646

4747
```javascript
48+
var getShape = require( '@stdlib/ndarray/shape' );
4849
var ndarray = require( '@stdlib/ndarray/ctor' );
49-
var ndarray2array = require( '@stdlib/ndarray/to-array' );
5050

5151
var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
5252
var shape = [ 3, 2 ];
5353
var strides = [ 2, 1 ];
5454
var offset = 0;
5555

5656
var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' );
57-
// returns <ndarray>
57+
// returns <ndarray>[ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
5858

59-
var sh = x.shape;
59+
var sh = getShape( x );
6060
// returns [ 3, 2 ]
6161

62-
var arr = ndarray2array( x );
63-
// returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
64-
6562
var y = reverseDimension( x, 0, false );
66-
// returns <ndarray>
63+
// returns <ndarray>[ [ 5.0, 6.0 ], [ 3.0, 4.0 ], [ 1.0, 2.0 ] ]
6764

68-
sh = y.shape;
65+
sh = getShape( y );
6966
// returns [ 3, 2 ]
70-
71-
arr = ndarray2array( y );
72-
// returns [ [ 5.0, 6.0 ], [ 3.0, 4.0 ], [ 1.0, 2.0 ] ]
7367
```
7468

7569
The function accepts the following arguments:

base/reverse-dimension/benchmark/benchmark.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ bench( pkg+'::1d,non-base', function benchmark( b ) {
6363
var v;
6464
var i;
6565

66-
/* eslint-disable object-curly-newline */
66+
/* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */
6767

6868
values = [
6969
empty( [ 2 ], { 'dtype': 'float64' } ),
@@ -73,7 +73,7 @@ bench( pkg+'::1d,non-base', function benchmark( b ) {
7373
empty( [ 2 ], { 'dtype': 'generic' } )
7474
];
7575

76-
/* eslint-enable object-curly-newline */
76+
/* eslint-enable object-curly-newline, stdlib/line-closing-bracket-spacing */
7777

7878
b.tic();
7979
for ( i = 0; i < b.iterations; i++ ) {
@@ -123,7 +123,7 @@ bench( pkg+'::2d,non-base', function benchmark( b ) {
123123
var v;
124124
var i;
125125

126-
/* eslint-disable object-curly-newline */
126+
/* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */
127127

128128
values = [
129129
empty( [ 2, 2 ], { 'dtype': 'float64' } ),
@@ -133,7 +133,7 @@ bench( pkg+'::2d,non-base', function benchmark( b ) {
133133
empty( [ 2, 2 ], { 'dtype': 'generic' } )
134134
];
135135

136-
/* eslint-enable object-curly-newline */
136+
/* eslint-enable object-curly-newline, stdlib/line-closing-bracket-spacing */
137137

138138
b.tic();
139139
for ( i = 0; i < b.iterations; i++ ) {
@@ -183,7 +183,7 @@ bench( pkg+'::3d,non-base', function benchmark( b ) {
183183
var v;
184184
var i;
185185

186-
/* eslint-disable object-curly-newline */
186+
/* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */
187187

188188
values = [
189189
empty( [ 2, 2, 2 ], { 'dtype': 'float64' } ),
@@ -193,7 +193,7 @@ bench( pkg+'::3d,non-base', function benchmark( b ) {
193193
empty( [ 2, 2, 2 ], { 'dtype': 'generic' } )
194194
];
195195

196-
/* eslint-enable object-curly-newline */
196+
/* eslint-enable object-curly-newline, stdlib/line-closing-bracket-spacing */
197197

198198
b.tic();
199199
for ( i = 0; i < b.iterations; i++ ) {
@@ -243,7 +243,7 @@ bench( pkg+'::4d,non-base', function benchmark( b ) {
243243
var v;
244244
var i;
245245

246-
/* eslint-disable object-curly-newline */
246+
/* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */
247247

248248
values = [
249249
empty( [ 2, 2, 2, 2 ], { 'dtype': 'float64' } ),
@@ -253,7 +253,7 @@ bench( pkg+'::4d,non-base', function benchmark( b ) {
253253
empty( [ 2, 2, 2, 2 ], { 'dtype': 'generic' } )
254254
];
255255

256-
/* eslint-enable object-curly-newline */
256+
/* eslint-enable object-curly-newline, stdlib/line-closing-bracket-spacing */
257257

258258
b.tic();
259259
for ( i = 0; i < b.iterations; i++ ) {
@@ -303,7 +303,7 @@ bench( pkg+'::5d,non-base', function benchmark( b ) {
303303
var v;
304304
var i;
305305

306-
/* eslint-disable object-curly-newline */
306+
/* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */
307307

308308
values = [
309309
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'float64' } ),
@@ -313,7 +313,7 @@ bench( pkg+'::5d,non-base', function benchmark( b ) {
313313
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'generic' } )
314314
];
315315

316-
/* eslint-enable object-curly-newline */
316+
/* eslint-enable object-curly-newline, stdlib/line-closing-bracket-spacing */
317317

318318
b.tic();
319319
for ( i = 0; i < b.iterations; i++ ) {

base/reverse-dimension/docs/repl.txt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,10 @@
2626
Examples
2727
--------
2828
> var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] )
29-
<ndarray>
30-
> x.shape
31-
[ 2, 2 ]
29+
<ndarray>[ [ 1, 2 ], [ 3, 4 ] ]
3230
> var y = {{alias}}( x, 0, false )
33-
<ndarray>
34-
> y.shape
35-
[ 2, 2 ]
36-
> {{alias:@stdlib/ndarray/to-array}}( y )
37-
[ [ 3, 4 ], [ 1, 2 ] ]
31+
<ndarray>[ [ 3, 4 ], [ 1, 2 ] ]
32+
3833

3934
See Also
4035
--------

0 commit comments

Comments
 (0)