Skip to content

Commit 302f85f

Browse files
committed
test: use functional accessors and update examples
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent 2b2ae6a commit 302f85f

File tree

7 files changed

+74
-524
lines changed

7 files changed

+74
-524
lines changed

lib/node_modules/@stdlib/ndarray/base/flipud/README.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,30 +46,24 @@ Returns a view of an input ndarray in which the order of elements along the seco
4646

4747
```javascript
4848
var ndarray = require( '@stdlib/ndarray/ctor' );
49-
var ndarray2array = require( '@stdlib/ndarray/to-array' );
49+
var getShape = require( '@stdlib/ndarray/shape' );
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 = flipud( x, 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:
@@ -120,7 +114,7 @@ var x = array( buf, {
120114
var y = flipud( x, false );
121115
// returns <ndarray>
122116

123-
var a = ndarray2array( y );
117+
var arr = ndarray2array( y );
124118
// returns [ [ [ 6, 7 ], [ 4, 5 ], [ 2, 3 ], [ 0, 1 ] ], [ [ 14, 15 ], [ 12, 13 ], [ 10, 11 ], [ 8, 9 ] ] ]
125119
```
126120

lib/node_modules/@stdlib/ndarray/base/flipud/docs/repl.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,13 @@
2828
--------
2929
> var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] )
3030
<ndarray>
31-
> x.shape
31+
> {{alias:@stdlib/ndarray/shape}}( x )
3232
[ 2, 2 ]
3333
> var y = {{alias}}( x, false )
34-
<ndarray>
35-
> y.shape
34+
<ndarray>[ [ 3, 4 ], [ 1, 2 ] ]
35+
> {{alias:@stdlib/ndarray/shape}}( y )
3636
[ 2, 2 ]
37-
> {{alias:@stdlib/ndarray/to-array}}( y )
38-
[ [ 3, 4 ], [ 1, 2 ] ]
37+
3938

4039
See Also
4140
--------

0 commit comments

Comments
 (0)