Skip to content

Commit 8dffc33

Browse files
committed
fix: apply code suggestions
--- 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: na - 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: na - task: lint_license_headers status: passed ---
1 parent 06822e5 commit 8dffc33

3 files changed

Lines changed: 15 additions & 8 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
each returned value is calculated from all provided values.
1616

1717
NaN values are ignored during computation. If provided NaN, the
18-
accumulator returns the current corrected sample standard deviation.
18+
accumulator returns the current moving unbiased sample variance.
19+
1920
Parameters
2021
----------
2122
W: integer
2223
Window size.
2324

2425
mean: number (optional)
25-
Known mean.
26-
26+
Known mean.
2727
Returns
2828
-------
2929
acc: Function

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ var incrmvariance = require( '@stdlib/stats/incr/mvariance' );
3636
* @returns {Function} accumulator function
3737
*
3838
* @example
39-
* var nanmvariance = require( '@stdlib/stats/incr/nanmvariance' );
4039
*
4140
* var accumulator = incrnanmvariance( 3 );
4241
*

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ tape( 'if not provided an input value, the accumulator function returns the curr
234234
delta = abs( actual - expected );
235235
tol = EPS * expected;
236236

237-
t.strictEqual( delta < tol, true, 'expected: '+expected+'. actual: '+actual+'. tol: '+tol+'. delta: '+delta+'.' );
237+
t.strictEqual( delta <= tol, true, 'expected: '+expected+'. actual: '+actual+'. tol: '+tol+'. delta: '+delta+'.' );
238238
t.end();
239239
});
240240

@@ -326,7 +326,7 @@ tape( 'if provided a NaN, the accumulator function ignores it (unknown mean, W=1
326326
}
327327

328328
// Test accumulator without arguments
329-
if (expected[i] === null) {
329+
if ( expected[i] === null ) {
330330
t.strictEqual( acc(), null, 'returns correct value for window '+i );
331331
} else {
332332
t.strictEqual( acc(), expected[ i ], 'returns expected value for window '+i );
@@ -371,7 +371,7 @@ tape( 'if provided a NaN, the accumulator function ignores it (known mean, W=1)'
371371
}
372372

373373
// Test accumulator without arguments
374-
if (expected[i] === null) {
374+
if ( expected[i] === null ) {
375375
t.strictEqual( acc(), null, 'returns correct value for window '+i );
376376
} else {
377377
t.strictEqual( acc(), expected[ i ], 'returns expected value for window '+i );
@@ -381,6 +381,10 @@ tape( 'if provided a NaN, the accumulator function ignores it (known mean, W=1)'
381381
});
382382

383383
tape( 'if provided a sequence of NaN values, the accumulator function should continue to ignore them', function test( t ) {
384+
var expected;
385+
var actual;
386+
var delta;
387+
var tol;
384388
var acc;
385389
var v;
386390

@@ -399,7 +403,11 @@ tape( 'if provided a sequence of NaN values, the accumulator function should con
399403
t.strictEqual( v, 0.0, 'returns expected value' );
400404

401405
v = acc( 3.0 );
402-
t.strictEqual( v.toFixed(4), (0.5).toFixed(4), 'returns expected value' );
406+
expected = 0.5;
407+
actual = v;
408+
delta = abs( actual - expected );
409+
tol = EPS * expected;
410+
t.strictEqual( delta <= tol, true, 'expected: '+expected+'. actual: '+actual+'. tol: '+tol+'. delta: '+delta+'.' );
403411

404412
t.end();
405413
});

0 commit comments

Comments
 (0)