Skip to content

Commit e8bd0eb

Browse files
committed
chore: fix-linting issues and clean-up
1 parent b2eaed3 commit e8bd0eb

File tree

9 files changed

+22
-36
lines changed

9 files changed

+22
-36
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
88
you may not use this file except in compliance with the License.
99
You may obtain a copy of the License at
1010
11-
http://www.apache.org/licenses/LICENSE-2.0
11+
http://www.apache.org/licenses/LICENSE-2.0
1212
1313
Unless required by applicable law or agreed to in writing, software
1414
distributed under the License is distributed on an "AS IS" BASIS,
@@ -20,7 +20,7 @@ limitations under the License.
2020

2121
# incrnankurtosis
2222

23-
> Compute a [corrected sample excess kurtosis][sample-excess-kurtosis] incrementally.
23+
> Compute a [corrected sample excess kurtosis][sample-excess-kurtosis] incrementally, ignoring `NaN` values.
2424
2525
<section class="intro">
2626

@@ -87,7 +87,7 @@ var incrnankurtosis = require( '@stdlib/stats/incr/nankurtosis' );
8787

8888
#### incrnankurtosis()
8989

90-
Returns an accumulator `function` which incrementally computes a [corrected sample excess kurtosis][sample-excess-kurtosis].
90+
Returns an accumulator function which incrementally computes a [corrected sample excess kurtosis][sample-excess-kurtosis], ignoring `NaN` values.
9191

9292
```javascript
9393
var accumulator = incrnankurtosis();
@@ -109,10 +109,10 @@ kurtosis = accumulator( 2.0 );
109109
kurtosis = accumulator( -4.0 );
110110
// returns null
111111

112-
kurtosis = accumulator( -4.0 );
112+
kurtosis = accumulator( NaN );
113113
// returns -6.0
114114

115-
kurtosis = accumulator( NaN ); //Ignored
115+
kurtosis = accumulator( -4.0 );
116116
// returns -6.0
117117
```
118118

@@ -124,7 +124,7 @@ kurtosis = accumulator( NaN ); //Ignored
124124

125125
## Notes
126126

127-
- Input values are **not** type checked. If provided `NaN` or a value which, when used in computations, results in `NaN`, it will be **ignored** but you are advised to type check and handle accordingly **before** passing the value to the accumulator function.
127+
- Input values are type checked. If non-numaric input are possible, you are advised to type check and handle accordingly **before** passing the value to the accumulator function.
128128

129129
</section>
130130

@@ -138,7 +138,7 @@ kurtosis = accumulator( NaN ); //Ignored
138138

139139
```javascript
140140
var randu = require( '@stdlib/random/base/randu' );
141-
var incrnankurtosis = require( './../lib' );
141+
var incrnankurtosis = require( '@stdib/stats/incr/lib' );
142142

143143
var accumulator;
144144
var kurtosis;
@@ -150,7 +150,7 @@ accumulator = incrnankurtosis();
150150

151151
// For each simulated datum, update the corrected sample excess kurtosis...
152152
for ( i = 0; i < 100; i++ ) {
153-
v = (randu() < 0.2 ) ? NaN : randu() * 100.0; //20% chance of NaN
153+
v = (randu() < 0.2 ) ? NaN : randu() * 100.0; // 20% chance of NaN
154154
kurtosis = accumulator( v );
155155
}
156156
console.log( accumulator() );

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench' );
24-
var randu = require( '@stdlib/random/base/randu' );
2524
var pkg = require( './../package.json' ).name;
2625
var incrnankurtosis = require( './../lib' );
2726

@@ -55,7 +54,7 @@ bench( pkg+'::accumulator', function benchmark( b ) {
5554

5655
b.tic();
5756
for ( i = 0; i < b.iterations; i++ ) {
58-
v = acc( randu() );
57+
v = acc( i );
5958
if ( v !== v ) {
6059
b.fail( 'should not return NaN' );
6160
}

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11

22
{{alias}}()
33
Returns an accumulator function which incrementally computes a corrected
4-
sample excess kurtosis.
4+
sample excess kurtosis, ignoring `NaN` values.
55

66
If provided a value, the accumulator function returns an updated corrected
77
sample excess kurtosis. If not provided a value, the accumulator function
88
returns the current corrected sample excess kurtosis.
99

10-
If provided `NaN` or a value which, when used in computations, results in
11-
`NaN`, it will be ignored and does not affect the accumulated value.
12-
1310
Returns
1411
-------
1512
acc: Function
@@ -26,8 +23,6 @@
2623
null
2724
> v = accumulator( -4.0 )
2825
-6.0
29-
> v = accumulator( NaN )
30-
-6.0
3126
See Also
3227
--------
3328

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@
2121
/// <reference types="@stdlib/types"/>
2222

2323
/**
24-
* If provided a value, returns an updated corrected sample excess kurtosis; otherwise, returns the current corrected sample excess kurtosis ignoring `NaN` values.
25-
*
26-
* ## Notes
27-
*
28-
* - If provided `NaN` or a value which, when used in computations, results in `NaN`, it will be ignored and does not affect the accumulated value.
24+
* If provided a value, returns an updated corrected sample excess kurtosis; otherwise, returns the current corrected sample excess kurtosis, ignoring `NaN` values.
2925
*
3026
* @param x - value
3127
* @returns corrected sample excess kurtosis
@@ -55,7 +51,7 @@ type accumulator = ( x?: number ) => number | null;
5551
* kurtosis = accumulator( -4.0 );
5652
* // returns -6.0
5753
*
58-
* kurtosis = accumulator( NaN ); // ignored
54+
* kurtosis = accumulator( NaN );
5955
* // returns -6.0
6056
*/
6157
declare function incrnankurtosis(): accumulator;

lib/node_modules/@stdlib/stats/incr/nankurtosis/examples/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ accumulator = incrkurtosis();
3232
// For each simulated datum, update the corrected sample excess kurtosis...
3333
console.log( '\nValue\tKurtosis\n' );
3434
for ( i = 0; i < 100; i++ ) {
35-
v = (randu() < 0.2 ) ? NaN : randu() * 100.0; //20% chance of `NaN`
35+
v = ( randu() < 0.2 ) ? NaN : randu() * 100.0; // 20% chance of `NaN`
3636
kurtosis = accumulator( v );
3737
if ( i < 3 ) {
3838
console.log( '%d\t%s', v.toFixed( 4 ), kurtosis );
3939
} else {
40-
console.log( '%d\t%d', v.toFixed( 4 ), (kurtosis == null) ? kurtosis : kurtosis.toFixed( 4 ) );
40+
console.log( '%d\t%d', v.toFixed( 4 ), ( kurtosis === null ) ? kurtosis : kurtosis.toFixed( 4 ) );
4141
}
4242
}
4343
console.log( '\nFinal excess kurtosis: %d\n', accumulator() );

lib/node_modules/@stdlib/stats/incr/nankurtosis/lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
'use strict';
2020

2121
/**
22-
* Compute a corrected sample excess kurtosis incrementally.
22+
* Compute a corrected sample excess kurtosis incrementally, ignoring `NaN` values.
2323
*
2424
* @module @stdlib/stats/incr/nankurtosis
2525
*
@@ -40,7 +40,7 @@
4040
* kurtosis = accumulator( -4.0 );
4141
* // returns -6.0
4242
*
43-
* kurtosis = accumulator( NaN ); //Ignore
43+
* kurtosis = accumulator( NaN );
4444
* // returns -6.0
4545
*/
4646

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
// MODULES //
2222

2323
var isnan = require( '@stdlib/math/base/assert/is-nan' );
24-
var incrkurtosis = require('@stdlib/stats/incr/kurtosis/lib');
24+
var incrkurtosis = require( '@stdlib/stats/incr/kurtosis/lib' );
25+
2526

2627
// MAIN //
2728

@@ -58,14 +59,11 @@ var incrkurtosis = require('@stdlib/stats/incr/kurtosis/lib');
5859
* kurtosis = accumulator( -4.0 );
5960
* // returns -6.0
6061
*
61-
* kurtosis = accumulator( NaN ); //Ignore
62+
* kurtosis = accumulator( NaN );
6263
* // returns -6.0
6364
*/
6465
function incrnankurtosis() {
65-
var N = 0;
66-
var kurtosis;
67-
68-
kurtosis = incrkurtosis();
66+
var kurtosis = incrkurtosis();
6967
return accumulator;
7068

7169
/**
@@ -79,8 +77,7 @@ function incrnankurtosis() {
7977
if ( arguments.length === 0 || isnan( x ) ) {
8078
return kurtosis();
8179
}
82-
N += 1;
83-
return kurtosis(x);
80+
return kurtosis( x );
8481
}
8582
}
8683

lib/node_modules/@stdlib/stats/incr/nankurtosis/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@stdlib/stats/incr/nankurtosis",
33
"version": "0.0.0",
4-
"description": "Compute a corrected sample excess kurtosis incrementally.",
4+
"description": "Compute a corrected sample excess kurtosis incrementally, ignoring NaN values.",
55
"license": "Apache-2.0",
66
"author": {
77
"name": "The Stdlib Authors",

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
var tape = require( 'tape' );
2424
var abs = require( '@stdlib/math/base/special/abs' );
2525
var EPS = require( '@stdlib/constants/float64/eps' );
26-
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2726
var incrnankurtosis = require( './../lib' );
2827

2928

0 commit comments

Comments
 (0)