Skip to content

Commit 8a36cf3

Browse files
committed
Auto-generated commit
1 parent 47c06d0 commit 8a36cf3

File tree

6 files changed

+24
-82
lines changed

6 files changed

+24
-82
lines changed

CHANGELOG.md

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

35253525
<details>
35263526

3527+
- [`9b9affd`](https://github.com/stdlib-js/stdlib/commit/9b9affd9c11e06703872cf8b6a6c5ac17d65665b) - **docs:** update return annotations to use ndarray instance notation for `stats/nanmax-by` [(#9148)](https://github.com/stdlib-js/stdlib/pull/9148) _(by Sachin Pangal)_
35273528
- [`f5ac8bf`](https://github.com/stdlib-js/stdlib/commit/f5ac8bf84a07bc581e7be667b9548c1dfe185eaf) - **docs:** update return annotations to use ndarray instance notation for `stats/nanmax` [(#9122)](https://github.com/stdlib-js/stdlib/pull/9122) _(by Sachin Pangal)_
35283529
- [`6ef2522`](https://github.com/stdlib-js/stdlib/commit/6ef252265ac04446eb43ea78093b0caac5f04bce) - **docs:** update return annotations to use ndarray instance notation for `stats/meankbn` [(#9093)](https://github.com/stdlib-js/stdlib/pull/9093) _(by Pratik, Athan Reines)_
35293530
- [`e23bad7`](https://github.com/stdlib-js/stdlib/commit/e23bad75d0635153bd643441192b3d3817bc33f3) - **docs:** update return annotations to use ndarray instance notation for `stats/mean` [(#9092)](https://github.com/stdlib-js/stdlib/pull/9092) _(by Pratik, Athan Reines)_

nanmax-by/README.md

Lines changed: 12 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ function clbk( v ) {
4444
}
4545

4646
var y = nanmaxBy( x, clbk );
47-
// returns <ndarray>
48-
49-
var v = y.get();
50-
// returns 4.0
47+
// returns <ndarray>[ 4.0 ]
5148
```
5249

5350
The function has the following parameters:
@@ -81,10 +78,7 @@ var ctx = {
8178
'count': 0
8279
};
8380
var y = nanmaxBy( x, clbk, ctx );
84-
// returns <ndarray>
85-
86-
var v = y.get();
87-
// returns 4.0
81+
// returns <ndarray>[ 4.0 ]
8882

8983
var count = ctx.count;
9084
// returns 3
@@ -99,7 +93,6 @@ The function accepts the following options:
9993
By default, the function performs a reduction over all elements in a provided input [ndarray][@stdlib/ndarray/ctor]. To perform a reduction over specific dimensions, provide a `dims` option.
10094

10195
```javascript
102-
var ndarray2array = require( '@stdlib/ndarray/to-array' );
10396
var array = require( '@stdlib/ndarray/array' );
10497

10598
function clbk( v ) {
@@ -110,41 +103,30 @@ var x = array( [ -1.0, 2.0, NaN, 4.0 ], {
110103
'shape': [ 2, 2 ],
111104
'order': 'row-major'
112105
});
113-
var v = ndarray2array( x );
114-
// returns [ [ -1.0, 2.0 ], [ NaN, 4.0 ] ]
106+
// returns <ndarray>[ [ -1.0, 2.0 ], [ NaN, 4.0 ] ]
115107

116108
var opts = {
117109
'dims': [ 0 ]
118110
};
119111
var y = nanmaxBy( x, opts, clbk );
120-
// returns <ndarray>
121-
122-
v = ndarray2array( y );
123-
// returns [ -100.0, 400.0 ]
112+
// returns <ndarray>[ -100.0, 400.0 ]
124113

125114
opts = {
126115
'dims': [ 1 ]
127116
};
128117
y = nanmaxBy( x, opts, clbk );
129-
// returns <ndarray>
130-
131-
v = ndarray2array( y );
132-
// returns [ 200.0, 400.0 ]
118+
// returns <ndarray>[ 200.0, 400.0 ]
133119

134120
opts = {
135121
'dims': [ 0, 1 ]
136122
};
137123
y = nanmaxBy( x, opts, clbk );
138-
// returns <ndarray>
139-
140-
v = y.get();
141-
// returns 400.0
124+
// returns <ndarray>[ 400.0 ]
142125
```
143126

144127
By default, the function excludes reduced dimensions from the output [ndarray][@stdlib/ndarray/ctor]. To include the reduced dimensions as singleton dimensions, set the `keepdims` option to `true`.
145128

146129
```javascript
147-
var ndarray2array = require( '@stdlib/ndarray/to-array' );
148130
var array = require( '@stdlib/ndarray/array' );
149131

150132
function clbk( v ) {
@@ -155,39 +137,28 @@ var x = array( [ -1.0, 2.0, NaN, 4.0 ], {
155137
'shape': [ 2, 2 ],
156138
'order': 'row-major'
157139
});
158-
159-
var v = ndarray2array( x );
160-
// returns [ [ -1.0, 2.0 ], [ NaN, 4.0 ] ]
140+
// returns <ndarray>[ [ -1.0, 2.0 ], [ NaN, 4.0 ] ]
161141

162142
var opts = {
163143
'dims': [ 0 ],
164144
'keepdims': true
165145
};
166146
var y = nanmaxBy( x, opts, clbk );
167-
// returns <ndarray>
168-
169-
v = ndarray2array( y );
170-
// returns [ [ -100.0, 400.0 ] ]
147+
// returns <ndarray>[ [ -100.0, 400.0 ] ]
171148

172149
opts = {
173150
'dims': [ 1 ],
174151
'keepdims': true
175152
};
176153
y = nanmaxBy( x, opts, clbk );
177-
// returns <ndarray>
178-
179-
v = ndarray2array( y );
180-
// returns [ [ 200.0 ], [ 400.0 ] ]
154+
// returns <ndarray>[ [ 200.0 ], [ 400.0 ] ]
181155

182156
opts = {
183157
'dims': [ 0, 1 ],
184158
'keepdims': true
185159
};
186160
y = nanmaxBy( x, opts, clbk );
187-
// returns <ndarray>
188-
189-
v = ndarray2array( y );
190-
// returns [ [ 400.0 ] ]
161+
// returns <ndarray>[ [ 400.0 ] ]
191162
```
192163

193164
By default, the function returns an [ndarray][@stdlib/ndarray/ctor] having a [data type][@stdlib/ndarray/dtypes] determined by the function's output data type [policy][@stdlib/ndarray/output-dtype-policies]. To override the default behavior, set the `dtype` option.
@@ -208,7 +179,7 @@ var opts = {
208179
'dtype': 'float64'
209180
};
210181
var y = nanmaxBy( x, opts, clbk );
211-
// returns <ndarray>
182+
// returns <ndarray>[ 200.0 ]
212183

213184
var dt = String( getDType( y ) );
214185
// returns 'float64'
@@ -230,10 +201,7 @@ var x = array( [ -1.0, 2.0, NaN ] );
230201
var y = zeros( [] );
231202

232203
var out = nanmaxBy.assign( x, y, clbk );
233-
// returns <ndarray>
234-
235-
var v = out.get();
236-
// returns 200.0
204+
// returns <ndarray>[ 200.0 ]
237205

238206
var bool = ( out === y );
239207
// returns true

nanmax-by/docs/repl.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,8 @@
5151
--------
5252
> var x = {{alias:@stdlib/ndarray/array}}( [ -1.0, 2.0, NaN, -4.0 ] );
5353
> function clbk( v ) { return v * 2.0; };
54-
> var y = {{alias}}( x, clbk );
55-
> var v = y.get()
56-
4.0
54+
> var y = {{alias}}( x, clbk )
55+
<ndarray>[ 4.0 ]
5756

5857

5958
{{alias}}.assign( x, out[, options], clbk[, thisArg] )
@@ -107,11 +106,9 @@
107106
> var out = {{alias:@stdlib/ndarray/zeros}}( [] );
108107
> function clbk( v ) { return v * 2.0; };
109108
> var y = {{alias}}.assign( x, out, clbk )
110-
<ndarray>
109+
<ndarray>[ 4.0 ]
111110
> var bool = ( out === y )
112111
true
113-
> var v = out.get()
114-
4.0
115112

116113
See Also
117114
--------

nanmax-by/docs/types/index.d.ts

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,7 @@ interface Unary {
124124
* var x = array( [ -1.0, 2.0, NaN ] );
125125
*
126126
* var y = nanmaxBy( x, clbk );
127-
* // returns <ndarray>
128-
*
129-
* var v = y.get();
130-
* // returns 4.0
127+
* // returns <ndarray>[ 4.0 ]
131128
*/
132129
<T = unknown, U extends InputArray<T> = InputArray<T>, ThisArg = unknown>( x: U, clbk: Callback<T, U, ThisArg>, thisArg?: ThisParameterType<Callback<T, U, ThisArg>> ): OutputArray<number>; // NOTE: we lose type specificity here, but retaining specificity would likely be difficult and/or tedious to completely enumerate, as the output ndarray data type is dependent on how `x` interacts with output data type policy and whether that policy has been overridden by `options.dtype`.
133130

@@ -150,10 +147,7 @@ interface Unary {
150147
* var x = array( [ -1.0, 2.0, NaN ] );
151148
*
152149
* var y = nanmaxBy( x, {}, clbk );
153-
* // returns <ndarray>
154-
*
155-
* var v = y.get();
156-
* // returns 4.0
150+
* // returns <ndarray>[ 4.0 ]
157151
*/
158152
<T = unknown, U extends InputArray<T> = InputArray<T>, ThisArg = unknown>( x: U, options: Options, clbk: Callback<T, U, ThisArg>, thisArg?: ThisParameterType<Callback<T, U, ThisArg>> ): OutputArray<number>; // NOTE: we lose type specificity here, but retaining specificity would likely be difficult and/or tedious to completely enumerate, as the output ndarray data type is dependent on how `x` interacts with output data type policy and whether that policy has been overridden by `options.dtype`.
159153

@@ -178,10 +172,7 @@ interface Unary {
178172
* }
179173
*
180174
* var out = nanmaxBy.assign( x, y, clbk );
181-
* // returns <ndarray>
182-
*
183-
* var v = out.get();
184-
* // returns 4.0
175+
* // returns <ndarray>[ 4.0 ]
185176
*
186177
* var bool = ( out === y );
187178
* // returns true
@@ -210,10 +201,7 @@ interface Unary {
210201
* }
211202
*
212203
* var out = nanmaxBy.assign( x, y, {}, clbk );
213-
* // returns <ndarray>
214-
*
215-
* var v = out.get();
216-
* // returns 4.0
204+
* // returns <ndarray>[ 4.0 ]
217205
*
218206
* var bool = ( out === y );
219207
* // returns true
@@ -240,10 +228,7 @@ interface Unary {
240228
* }
241229
*
242230
* var y = nanmaxBy( x, clbk );
243-
* // returns <ndarray>
244-
*
245-
* var v = y.get();
246-
* // returns 4.0
231+
* // returns <ndarray>[ 4.0 ]
247232
*
248233
* @example
249234
* var array = require( '@stdlib/ndarray/array' );
@@ -257,10 +242,7 @@ interface Unary {
257242
* }
258243
*
259244
* var out = nanmaxBy.assign( x, y, clbk );
260-
* // returns <ndarray>
261-
*
262-
* var v = out.get();
263-
* // returns 4.0
245+
* // returns <ndarray>[ 4.0 ]
264246
*
265247
* var bool = ( out === y );
266248
* // returns true

nanmax-by/lib/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@
5050
*
5151
* // Perform reduction:
5252
* var out = nanmaxBy( x, clbk );
53-
* // returns <ndarray>
54-
*
55-
* var v = out.get();
56-
* // returns 22.0
53+
* // returns <ndarray>[ 22.0 ]
5754
*/
5855

5956
// MODULES //

nanmax-by/lib/main.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,7 @@ var table = {
8686
*
8787
* // Perform reduction:
8888
* var out = nanmaxBy( x, clbk );
89-
* // returns <ndarray>
90-
*
91-
* var v = out.get();
92-
* // returns 22.0
89+
* // returns <ndarray>[ 22.0 ]
9390
*/
9491
var nanmaxBy = factory( table, [ idtypes ], odtypes, policies );
9592

0 commit comments

Comments
 (0)