Skip to content

Commit 784ead4

Browse files
committed
Auto-generated commit
1 parent 3a95753 commit 784ead4

File tree

6 files changed

+32
-141
lines changed

6 files changed

+32
-141
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2026-01-13)
7+
## Unreleased (2026-01-14)
88

99
<section class="features">
1010

@@ -709,6 +709,7 @@ A total of 40 issues were closed in this release:
709709

710710
<details>
711711

712+
- [`571b88f`](https://github.com/stdlib-js/stdlib/commit/571b88f7e7b93c3578efc017cb8e3bd9b6b99954) - **docs:** improve doctests for ndarray instances in `ndarray/map` [(#9676)](https://github.com/stdlib-js/stdlib/pull/9676) _(by Shreelaxmi Hegde, Athan Reines)_
712713
- [`709563c`](https://github.com/stdlib-js/stdlib/commit/709563c0d7337b5c0632d1988fb263cf39305f86) - **feat:** update `ndarray/base` TypeScript declarations [(#9716)](https://github.com/stdlib-js/stdlib/pull/9716) _(by stdlib-bot)_
713714
- [`6aee8e2`](https://github.com/stdlib-js/stdlib/commit/6aee8e232a2cebd57d5246d76ffe08e67941c0a4) - **docs:** move content to notes _(by Athan Reines)_
714715
- [`93e0c79`](https://github.com/stdlib-js/stdlib/commit/93e0c79faa246da751b6d7a640b5133fefad00f2) - **refactor:** return the input ndarray and update examples _(by Athan Reines)_

map/README.md

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ Applies a callback function to elements in an input [ndarray][@stdlib/ndarray/ct
4545
```javascript
4646
var Float64Array = require( '@stdlib/array/float64' );
4747
var ndarray = require( '@stdlib/ndarray/ctor' );
48-
var ndarray2array = require( '@stdlib/ndarray/to-array' );
4948

5049
function scale( z ) {
5150
return z * 10.0;
@@ -60,10 +59,7 @@ var x = ndarray( 'float64', buffer, shape, strides, offset, 'row-major' );
6059
// returns <ndarray>
6160

6261
var y = map( x, scale );
63-
// returns <ndarray>
64-
65-
var arr = ndarray2array( y );
66-
// returns [ [ 20.0, 30.0, 40.0 ], [ 80.0, 90.0, 100.0 ] ]
62+
// returns <ndarray>[ [ 20.0, 30.0, 40.0 ], [ 80.0, 90.0, 100.0 ] ]
6763
```
6864

6965
The function accepts the following arguments:
@@ -85,7 +81,6 @@ By default, the output ndarray [data type][@stdlib/ndarray/dtypes] is inferred f
8581
var Float64Array = require( '@stdlib/array/float64' );
8682
var ndarray = require( '@stdlib/ndarray/ctor' );
8783
var dtype = require( '@stdlib/ndarray/dtype' );
88-
var ndarray2array = require( '@stdlib/ndarray/to-array' );
8984

9085
function scale( z ) {
9186
return z * 10.0;
@@ -103,13 +98,10 @@ var opts = {
10398
'dtype': 'float32'
10499
};
105100
var y = map( x, opts, scale );
106-
// returns <ndarray>
101+
// returns <ndarray>[ [ 20.0, 30.0, 40.0 ], [ 80.0, 90.0, 100.0 ] ]
107102

108-
var dt = dtype( y );
103+
var dt = String( dtype( y ) );
109104
// returns 'float32'
110-
111-
var arr = ndarray2array( y );
112-
// returns [ [ 20.0, 30.0, 40.0 ], [ 80.0, 90.0, 100.0 ] ]
113105
```
114106

115107
To set the callback function execution context, provide a `thisArg`.
@@ -119,7 +111,6 @@ To set the callback function execution context, provide a `thisArg`.
119111
```javascript
120112
var Float64Array = require( '@stdlib/array/float64' );
121113
var ndarray = require( '@stdlib/ndarray/ctor' );
122-
var ndarray2array = require( '@stdlib/ndarray/to-array' );
123114

124115
function scale( z ) {
125116
this.count += 1;
@@ -138,10 +129,7 @@ var ctx = {
138129
'count': 0
139130
};
140131
var y = map( x, scale, ctx );
141-
// returns <ndarray>
142-
143-
var arr = ndarray2array( y );
144-
// returns [ [ 20.0, 30.0, 40.0 ], [ 80.0, 90.0, 100.0 ] ]
132+
// returns <ndarray>[ [ 20.0, 30.0, 40.0 ], [ 80.0, 90.0, 100.0 ] ]
145133

146134
var count = ctx.count;
147135
// returns 6
@@ -169,7 +157,6 @@ The callback function is provided the following arguments:
169157
var Float64Array = require( '@stdlib/array/float64' );
170158
var ndarray = require( '@stdlib/ndarray/ctor' );
171159
var Complex128 = require( '@stdlib/complex/float64/ctor' );
172-
var ndarray2array = require( '@stdlib/ndarray/to-array' );
173160

174161
function toComplex( z ) {
175162
return new Complex128( z, 0.0 );

map/docs/repl.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@
3131
--------
3232
> var x = {{alias:@stdlib/ndarray/array}}( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] );
3333
> function f( v ) { return v*10.0; };
34-
> var y = {{alias}}( x, f );
35-
> {{alias:@stdlib/ndarray/to-array}}( y )
36-
[ [ 10.0, 20.0 ], [ 30.0, 40.0 ] ]
34+
> var y = {{alias}}( x, f )
35+
<ndarray>[ [ 10.0, 20.0 ], [ 30.0, 40.0 ] ]
3736

3837
See Also
3938
--------

0 commit comments

Comments
 (0)