Skip to content

Commit c91cf63

Browse files
committed
docs: update examples docs and README
--- 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: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - 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 1ef0ea4 commit c91cf63

File tree

5 files changed

+29
-31
lines changed

5 files changed

+29
-31
lines changed

lib/node_modules/@stdlib/stats/base/nanminabs/README.md

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
@license Apache-2.0
44
5-
Copyright (c) 2025 The Stdlib Authors.
5+
Copyright (c) 2020 The Stdlib Authors.
66
77
Licensed under the Apache License, Version 2.0 (the "License");
88
you may not use this file except in compliance with the License.
@@ -38,13 +38,12 @@ var nanminabs = require( '@stdlib/stats/base/nanminabs' );
3838

3939
#### nanminabs( N, x, strideX )
4040

41-
Computes the minimum absolute value of a strided array `x`, ignoring `NaN` values.
41+
Computes the minimum absolute value of a strided array, ignoring `NaN` values.
4242

4343
```javascript
4444
var x = [ 1.0, -2.0, NaN, 2.0 ];
45-
var N = x.length;
4645

47-
var v = nanminabs( N, x, 1 );
46+
var v = nanminabs( x.length, x, 1 );
4847
// returns 1.0
4948
```
5049

@@ -54,15 +53,12 @@ The function has the following parameters:
5453
- **x**: input [`Array`][mdn-array] or [`typed array`][mdn-typed-array].
5554
- **strideX**: stride length for `x`.
5655

57-
The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the minimum absolute value of every other element in `x`,
56+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the minimum absolute value of every other element in `x`,
5857

5958
```javascript
60-
var floor = require( '@stdlib/math/base/special/floor' );
61-
6259
var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ];
63-
var N = floor( x.length / 2 );
6460

65-
var v = nanminabs( N, x, 2 );
61+
var v = nanminabs( 5, x, 2 );
6662
// returns 1.0
6763
```
6864

@@ -72,14 +68,11 @@ Note that indexing is relative to the first index. To introduce an offset, use [
7268

7369
```javascript
7470
var Float64Array = require( '@stdlib/array/float64' );
75-
var floor = require( '@stdlib/math/base/special/floor' );
7671

7772
var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 4.0 ] );
7873
var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
7974

80-
var N = floor( x0.length / 2 );
81-
82-
var v = nanminabs( N, x1, 2 );
75+
var v = nanminabs( 4, x1, 2 );
8376
// returns 1.0
8477
```
8578

@@ -89,25 +82,21 @@ Computes the minimum absolute value of a strided array, ignoring `NaN` values an
8982

9083
```javascript
9184
var x = [ 1.0, -2.0, NaN, 2.0 ];
92-
var N = x.length;
9385

94-
var v = nanminabs.ndarray( N, x, 1, 0 );
86+
var v = nanminabs.ndarray( x.length, x, 1, 0 );
9587
// returns 1.0
9688
```
9789

9890
The function has the following additional parameters:
9991

10092
- **offsetX**: starting index for `x`.
10193

102-
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the minimum absolute value for every other value in `x` starting from the second value
94+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the minimum absolute value for every other element in `x` starting from the second element
10395

10496
```javascript
105-
var floor = require( '@stdlib/math/base/special/floor' );
106-
10797
var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, NaN, NaN, 2.0, 3.0, 4.0 ];
108-
var N = floor( x.length / 2 );
10998

110-
var v = nanminabs.ndarray( N, x, 2, 1 );
99+
var v = nanminabs.ndarray( 5, x, 2, 1 );
111100
// returns 1.0
112101
```
113102

@@ -180,15 +169,21 @@ console.log( v );
180169
<section class="links">
181170

182171
[mdn-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
172+
183173
[@stdlib/array/base/accessor]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/accessor
174+
184175
[mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
185176

186177
<!-- <related-links> -->
187178

188179
[@stdlib/stats/strided/dnanminabs]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/strided/dnanminabs
180+
189181
[@stdlib/stats/base/minabs]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/base/minabs
182+
190183
[@stdlib/stats/base/nanmaxabs]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/base/nanmaxabs
184+
191185
[@stdlib/stats/base/nanmin]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/base/nanmin
186+
192187
[@stdlib/stats/strided/snanminabs]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/strided/snanminabs
193188

194189

lib/node_modules/@stdlib/stats/base/nanminabs/docs/repl.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11

22
{{alias}}( N, x, strideX )
3-
Computes the minimum absolute value of a strided array, ignoring
4-
`NaN` values.
3+
Computes the minimum absolute value of a strided array, ignoring `NaN`
4+
values.
55

6-
The `N` and stride parameters determine which elements in the
7-
stridedarray are accessed at runtime.
6+
The `N` and stride parameters determine which elements in the strided array
7+
are accessed at runtime.
88

9-
Indexing is relative to the first index. To introduce an offset,
10-
use a typed array view.
9+
Indexing is relative to the first index. To introduce an offset, use a typed
10+
array view.
1111

1212
If `N <= 0`, the function returns `NaN`.
1313

@@ -34,7 +34,7 @@
3434
> {{alias}}( x.length, x, 1 )
3535
1.0
3636

37-
// Using `N` and `stride` parameters:
37+
// Using `N` and stride parameters:
3838
> x = [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0, NaN, NaN ];
3939
> {{alias}}( 4, x, 2 )
4040
1.0

lib/node_modules/@stdlib/stats/base/nanminabs/docs/types/index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2020 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@
2222

2323

2424
import { NumericArray, Collection, AccessorArrayLike } from '@stdlib/types/array';
25+
2526
/**
2627
* Input array.
2728
*/

lib/node_modules/@stdlib/stats/base/nanminabs/docs/types/test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2020 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -16,15 +16,16 @@
1616
* limitations under the License.
1717
*/
1818

19-
import nanminabs = require( './index' );
2019
import AccessorArray = require( '@stdlib/array/base/accessor' );
20+
import nanminabs = require( './index' );
2121

2222
// TESTS //
2323

2424
// The function returns a number...
2525
{
2626
const x = new Float64Array( 10 );
2727

28+
nanminabs( x.length, x, 1 ); // $ExpectType number
2829
nanminabs( x.length, new AccessorArray( x ), 1 ); // $ExpectType number
2930
}
3031

@@ -84,6 +85,7 @@ import AccessorArray = require( '@stdlib/array/base/accessor' );
8485
{
8586
const x = new Float64Array( 10 );
8687

88+
nanminabs.ndarray( x.length, x, 1, 0 ); // $ExpectType number
8789
nanminabs.ndarray( x.length, new AccessorArray( x ), 1, 0 ); // $ExpectType number
8890
}
8991

lib/node_modules/@stdlib/stats/base/nanminabs/examples/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2020 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)