Skip to content

Commit 4ae8a4b

Browse files
committed
fix:lint_changed_files / Lint Changed Files (pull_request) and also fix:run_affected_examples / Run changed examples (pull_request)
1 parent f7c0075 commit 4ae8a4b

File tree

6 files changed

+72
-72
lines changed

6 files changed

+72
-72
lines changed

lib/node_modules/@stdlib/stats/incr/nanmmeanvar/README.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,37 +88,34 @@ If provided an input value `x`, the accumulator function updates and returns the
8888

8989
```javascript
9090
var incrnanmmeanvar = require( '@stdlib/stats/incr/nanmmeanvar' );
91-
9291
var accumulator = incrnanmmeanvar( 3 );
93-
9492
var out = accumulator();
95-
// returns null
9693

9794
// Fill the window (no NaNs yet)...
9895
out = accumulator( 2.0 ); // [2.0]
99-
// returns [ 2.0, 0.0 ]
96+
// => [ 2.0, 0.0 ]
10097

10198
out = accumulator( NaN ); // NaN is ignored [2.0]
102-
// returns [ 2.0, 0.0 ]
99+
// => [ 2.0, 0.0 ]
103100

104101
out = accumulator( 1.0 ); // [2.0, 1.0]
105-
// returns [ 1.5, 0.5 ]
102+
// => [ 1.5, 0.5 ]
106103

107104
out = accumulator( 3.0 ); // [2.0, 1.0, 3.0]
108-
// returns [ 2.0, 1.0 ]
105+
// => [ 2.0, 1.0 ]
109106

110107
// Window begins sliding...
111108
out = accumulator( -7.0 ); // [1.0, 3.0, -7.0]
112-
// returns [ -1.0, 28.0 ]
109+
// => [ -1.0, 28.0 ]
113110

114111
out = accumulator( NaN ); // NaN ignored [1.0, 3.0, -7.0]
115-
// returns [ -1.0, 28.0 ]
112+
// => [ -1.0, 28.0 ]
116113

117114
out = accumulator( -5.0 ); // [3.0, -7.0, -5.0]
118-
// returns [ -3.0, 28.0 ]
115+
// => [ -3.0, 28.0 ]
119116

120117
out = accumulator();
121-
// returns [ -3.0, 28.0 ]
118+
// => [ -3.0, 28.0 ]
122119
```
123120

124121
</section>
@@ -141,7 +138,6 @@ out = accumulator();
141138
## Examples
142139

143140
<!-- eslint no-undef: "error" -->
144-
145141
```javascript
146142
var randu = require( '@stdlib/random/base/randu' );
147143
var Float64Array = require( '@stdlib/array/float64' );

lib/node_modules/@stdlib/stats/incr/nanmmeanvar/benchmark/benchmark.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ bench( pkg+'::accumulator', function benchmark( b ) {
6666
}
6767
b.pass( 'benchmark finished' );
6868
b.end();
69-
});
69+
});

lib/node_modules/@stdlib/stats/incr/nanmmeanvar/docs/repl.txt

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
values. If not provided a value, the accumulator function returns the
1111
current moving accumulated values.
1212

13-
NaN values are ignored and do not affect the accumulator state.
13+
NaN values are ignored
14+
and do not affect the accumulator state.
1415

15-
Until the window contains at least one valid (non-NaN) value, the accumulator
16-
returns `null`. If the window contains only one valid value, the sample
16+
Until the window contains at least one valid (non-NaN) value, the
17+
accumulator returns `null`.
18+
If the window contains only one valid value, the sample
1719
variance is `0.0`.
1820

1921
Parameters
@@ -35,18 +37,17 @@
3537
> var v = accumulator()
3638
null
3739
> v = accumulator( 2.0 )
38-
[ 2.0, 0.0 ]
39-
> v = accumulator( NaN )
40-
[ 2.0, 0.0 ]
40+
[ 2, 0 ]
41+
> v = accumulator( NaN )
42+
[ 2, 0 ]
4143
> v = accumulator( 4.0 )
42-
[ 3.0, 2.0 ]
44+
[ 3, 2 ]
4345
> v = accumulator( 6.0 )
44-
[ 4.0, 4.0 ]
45-
> v = accumulator( NaN )
46-
[ 4.0, 4.0 ]
46+
[ 4, 4 ]
47+
> v = accumulator( NaN )
48+
[ 4, 4 ]
4749
> v = accumulator()
48-
[ 4.0, 4.0 ]
50+
[ 4, 4 ]
4951

5052
See Also
5153
--------
52-

lib/node_modules/@stdlib/stats/incr/nanmmeanvar/docs/types/index.d.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { ArrayLike } from '@stdlib/types/array';
3030
* - If provided `NaN`, the value is **ignored** and the accumulator state is **not updated**.
3131
*
3232
* @param x - input value
33+
*
3334
* @returns output array or null
3435
*/
3536
type accumulator = ( x?: number ) => ArrayLike<number> | null;
@@ -47,6 +48,7 @@ type accumulator = ( x?: number ) => ArrayLike<number> | null;
4748
* @param window - window size
4849
* @throws window size must be a positive integer
4950
* @returns accumulator function
51+
*
5052
*/
5153
declare function incrnanmmeanvar( out: ArrayLike<number>, window: number ): accumulator;
5254

@@ -62,6 +64,7 @@ declare function incrnanmmeanvar( out: ArrayLike<number>, window: number ): accu
6264
* @param window - window size
6365
* @throws window size must be a positive integer
6466
* @returns accumulator function
67+
*
6568
* @example
6669
* var incrnanmmeanvar = require( '@stdlib/stats/incr/nanmmeanvar' );
6770
*
@@ -71,27 +74,27 @@ declare function incrnanmmeanvar( out: ArrayLike<number>, window: number ): accu
7174
* // returns null
7275
*
7376
* v = accumulator( 2.0 );
74-
* // returns [ 2.0, 0.0 ]
77+
* // returns [ 2, 0 ]
7578
*
7679
* v = accumulator( NaN );
77-
* // returns [ 2.0, 0.0 ]
80+
* // returns [ 2, 0 ]
7881
*
7982
* v = accumulator( 4.0 );
80-
* // returns [ 3.0, 2.0 ]
83+
* // returns [ 3, 2 ]
8184
*
8285
* v = accumulator( 6.0 );
83-
* // returns [ 4.0, 4.0 ]
86+
* // returns [ 4, 4 ]
8487
*
8588
* v = accumulator( NaN );
86-
* // returns [ 4.0, 4.0 ]
89+
* // returns [ 4, 4 ]
8790
*
8891
* v = accumulator( 8.0 );
8992
* // Window is [4,6,8]
9093
* // mean = 6, variance = ((4-6)^2+(6-6)^2+(8-6)^2) / 2 = 4
91-
* // returns [ 6.0, 4.0 ]
94+
* // returns [ 6, 4 ]
9295
*
9396
* v = accumulator();
94-
* // returns [ 6.0, 4.0 ]
97+
* // returns [ 6, 4 ]
9598
*/
9699
declare function incrnanmmeanvar( window: number ): accumulator;
97100

lib/node_modules/@stdlib/stats/incr/nanmmeanvar/lib/main.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ var isArrayLike = require( '@stdlib/assert/is-array-like' );
3636
*
3737
* @example
3838
* var acc = incrnanmmeanvar( 3 );
39-
* acc( 2.0 ); // => [ 2.0, 0.0 ]
40-
* acc( NaN ); // => [ 2.0, 0.0 ] (NaN skipped)
41-
* acc( 4.0 ); // => [ 3.0, 2.0 ]
39+
* acc( 2.0 ); // returns [ 2, 0 ]
40+
* acc( NaN ); // returns [ 2, 0 ] (NaN skipped)
41+
* acc( 4.0 ); // returns [ 3, 2 ]
4242
*
4343
* @example
4444
* var out = [ 0.0, 0.0 ];
4545
* var acc = incrnanmmeanvar( out, 3 );
4646
* acc( 2.0 );
47-
* console.log( out ); // => [ 2.0, 0.0 ]
47+
* console.log( out ); // returns [ 2, 0 ]
4848
*/
4949
function incrnanmmeanvar( out, W ) {
5050
var mmeanvar;
@@ -63,6 +63,7 @@ function incrnanmmeanvar( out, W ) {
6363
*
6464
* @param {number} [x] - input value
6565
* @returns {(Array|null)} current mean and variance
66+
* @private
6667
*/
6768
function accumulator( x ) {
6869
// If no arguments → return current state:

lib/node_modules/@stdlib/stats/incr/nanmmeanvar/test/test.js

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -308,46 +308,46 @@ tape( 'if provided `NaN`, the accumulator skips the value and returns the previo
308308
3.14,
309309
NaN,
310310
3.14,
311-
3.14,
312-
NaN,
313-
NaN,
314-
NaN,
315-
NaN,
316-
3.14
311+
3.14,
312+
NaN,
313+
NaN,
314+
NaN,
315+
NaN,
316+
3.14
317317
];
318318
expected = [
319319
null,
320-
[ 3.14, 0.0 ],
321-
[ 3.14, 0.0 ],
322-
[ 3.14, 0.0 ],
323-
[ 3.14, 0.0 ],
324-
[ 3.14, 0.0 ],
325-
[ 3.14, 0.0 ],
326-
[ 3.14, 0.0 ],
327-
[ 3.14, 0.0 ],
328-
[ 3.14, 0.0 ],
329-
[ 3.14, 0.0 ],
330-
[ 3.14, 0.0 ],
331-
[ 3.14, 0.0 ],
332-
[ 3.14, 0.0 ],
333-
[ 3.14, 0.0 ],
334-
[ 3.14, 0.0 ],
335-
[ 3.14, 0.0 ],
336-
[ 3.14, 0.0 ],
337-
[ 3.14, 0.0 ]
320+
[ 3.14, 0.0 ],
321+
[ 3.14, 0.0 ],
322+
[ 3.14, 0.0 ],
323+
[ 3.14, 0.0 ],
324+
[ 3.14, 0.0 ],
325+
[ 3.14, 0.0 ],
326+
[ 3.14, 0.0 ],
327+
[ 3.14, 0.0 ],
328+
[ 3.14, 0.0 ],
329+
[ 3.14, 0.0 ],
330+
[ 3.14, 0.0 ],
331+
[ 3.14, 0.0 ],
332+
[ 3.14, 0.0 ],
333+
[ 3.14, 0.0 ],
334+
[ 3.14, 0.0 ],
335+
[ 3.14, 0.0 ],
336+
[ 3.14, 0.0 ],
337+
[ 3.14, 0.0 ]
338338
];
339339
for ( i = 0; i < data.length; i++ ) {
340340
v = acc( data[ i ] );
341341

342-
342+
343343
if ( i === 0 ) {
344344
t.strictEqual( v, null, 'NaN ignored; still no data' );
345345
continue;
346346
}
347-
if ( isnan( data[ i ] ) ) {
347+
if ( isnan( data[ i ] ) ) {
348348
t.deepEqual( v, acc(), 'NaN skipped — state unchanged at step '+i );
349349
}
350-
else {
350+
else {
351351
t.strictEqual( isnan( v[0] ), false, 'mean is not NaN' );
352352
t.strictEqual( isnan( v[1] ), false, 'variance is not NaN' );
353353
}
@@ -363,7 +363,6 @@ tape( 'if provided `NaN`, the accumulator skips values when W=1', function test(
363363
var i;
364364

365365
acc = incrnanmmeanvar( 1 );
366-
367366
data = [
368367
NaN,
369368
3.14,
@@ -386,25 +385,25 @@ tape( 'if provided `NaN`, the accumulator skips values when W=1', function test(
386385
3.14
387386
];
388387
expected = [
389-
null,
390-
[ 3.14, 0.0 ],
391-
[ 3.14, 0.0 ],
392-
[ 3.14, 0.0 ],
388+
null,
389+
[ 3.14, 0.0 ],
390+
[ 3.14, 0.0 ],
391+
[ 3.14, 0.0 ],
392+
[ 3.14, 0.0 ],
393+
[ 3.14, 0.0 ],
394+
[ 3.14, 0.0 ],
393395
[ 3.14, 0.0 ],
394396
[ 3.14, 0.0 ],
395397
[ 3.14, 0.0 ],
396-
[ 3.14, 0.0 ],
397398
[ 3.14, 0.0 ],
398399
[ 3.14, 0.0 ],
399400
[ 3.14, 0.0 ],
400-
[ 3.14, 0.0 ],
401401
[ 3.14, 0.0 ],
402402
[ 3.14, 0.0 ],
403-
[ 3.14, 0.0 ],
404403
[ 3.14, 0.0 ],
405404
[ 3.14, 0.0 ],
406405
[ 3.14, 0.0 ],
407-
[ 3.14, 0.0 ]
406+
[ 3.14, 0.0 ]
408407
];
409408
for ( i = 0; i < data.length; i++ ) {
410409
v = acc( data[ i ] );

0 commit comments

Comments
 (0)