Skip to content

Commit 26fe3ef

Browse files
committed
space
1 parent 535d165 commit 26fe3ef

File tree

4 files changed

+62
-64
lines changed

4 files changed

+62
-64
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{{alias}}( [mean] )
2-
Returns an accumulator function which incrementally computes the
2+
Returns an accumulator function which incrementally computes the
33
coefficient of variation (CV), ignoring `NaN` values.
44

5-
If provided a value, the accumulator function returns an updated
6-
accumulated value. If not provided a value, the accumulator function
5+
If provided a value, the accumulator function returns an updated
6+
accumulated value. If not provided a value, the accumulator function
77
returns the current accumulated value.
88

99
If all received values are `NaN`, the accumulated value remains `null`.

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,17 @@ var incrcv = require( './../../cv/lib/main' );
5050
* // returns ~0.47
5151
*/
5252
function incrnancv() {
53-
var cv = incrcv();
53+
var cv = incrcv();
5454

55-
return function accumulator( x ) {
56-
if ( arguments.length === 0 ) {
57-
return cv();
58-
}
59-
if ( isnan( x ) ) {
60-
return cv();
61-
}
62-
return cv( x );
63-
};
55+
return function accumulator( x ) {
56+
if ( arguments.length === 0 ) {
57+
return cv();
58+
}
59+
if ( isnan( x ) ) {
60+
return cv();
61+
}
62+
return cv( x );
63+
};
6464
}
6565

6666

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@stdlib/stats/incr/nancv",
33
"version": "0.0.0",
4-
"description": "Incrementally compute the coefficient of variation (CV).",
4+
"description": "Incrementally compute the coefficient of variation (CV), while ignoring `NaN` values.",
55
"license": "Apache-2.0",
66
"author": {
77
"name": "The Stdlib Authors",
@@ -64,4 +64,3 @@
6464
"accumulator"
6565
]
6666
}
67-

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

Lines changed: 48 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -90,61 +90,61 @@ tape( 'if not provided an input value, the accumulator function returns the curr
9090
});
9191

9292
tape( 'if not provided an input value, the accumulator function returns the current accumulated value (known mean, ignoring NaNs)', function test( t ) {
93-
var data;
94-
var acc;
95-
var i;
93+
var data;
94+
var acc;
95+
var i;
9696

97-
data = [ 2.0, NaN, 3.0, 1.0, NaN ];
98-
acc = incrnancv( 2.0 );
97+
data = [ 2.0, NaN, 3.0, 1.0, NaN ];
98+
acc = incrnancv( 2.0 );
9999

100-
for ( i = 0; i < data.length; i++ ) {
101-
acc( data[ i ] );
102-
}
100+
for ( i = 0; i < data.length; i++ ) {
101+
acc( data[ i ] );
102+
}
103103

104-
t.equal( acc(), 0.5, 'returns expected value while ignoring NaNs' );
105-
t.end();
104+
t.equal( acc(), 0.5, 'returns expected value while ignoring NaNs' );
105+
t.end();
106106
});
107107

108108
tape( 'the accumulated value is `null` until at least 1 valid datum has been provided (unknown mean, ignoring NaNs)', function test( t ) {
109-
var acc;
110-
var cv;
109+
var acc;
110+
var cv;
111111

112-
acc = incrnancv();
112+
acc = incrnancv();
113113

114-
cv = acc();
115-
t.equal( cv, null, 'returns null' );
114+
cv = acc();
115+
t.equal( cv, null, 'returns null' );
116116

117-
cv = acc( NaN );
118-
t.equal( cv, null, 'still returns null after NaN' );
117+
cv = acc( NaN );
118+
t.equal( cv, null, 'still returns null after NaN' );
119119

120-
cv = acc( 3.0 );
121-
t.notEqual( cv, null, 'does not return null after valid number' );
120+
cv = acc( 3.0 );
121+
t.notEqual( cv, null, 'does not return null after valid number' );
122122

123-
cv = acc();
124-
t.notEqual( cv, null, 'does not return null' );
123+
cv = acc();
124+
t.notEqual( cv, null, 'does not return null' );
125125

126-
t.end();
126+
t.end();
127127
});
128128

129129
tape( 'the accumulated value is `null` until at least 1 valid datum has been provided (known mean, ignoring NaNs)', function test( t ) {
130-
var acc;
131-
var cv;
130+
var acc;
131+
var cv;
132132

133-
acc = incrnancv( 3.0 );
133+
acc = incrnancv( 3.0 );
134134

135-
cv = acc();
136-
t.equal( cv, null, 'returns null' );
135+
cv = acc();
136+
t.equal( cv, null, 'returns null' );
137137

138-
cv = acc( NaN );
139-
t.equal( cv, null, 'still returns null after NaN' );
138+
cv = acc( NaN );
139+
t.equal( cv, null, 'still returns null after NaN' );
140140

141-
cv = acc( 3.0 );
142-
t.notEqual( cv, null, 'does not return null after valid number' );
141+
cv = acc( 3.0 );
142+
t.notEqual( cv, null, 'does not return null after valid number' );
143143

144-
cv = acc();
145-
t.notEqual( cv, null, 'does not return null' );
144+
cv = acc();
145+
t.notEqual( cv, null, 'does not return null' );
146146

147-
t.end();
147+
t.end();
148148
});
149149

150150
tape( 'the accumulated value is `null` until at least 1 non-NaN datum has been provided', function test( t ) {
@@ -169,27 +169,27 @@ tape( 'the accumulated value is `null` until at least 1 non-NaN datum has been p
169169
});
170170

171171
tape( 'the accumulated value is `0` until at least 2 valid datums have been provided (unknown mean, ignoring NaNs)', function test( t ) {
172-
var acc;
173-
var cv;
172+
var acc;
173+
var cv;
174174

175-
acc = incrnancv();
175+
acc = incrnancv();
176176

177-
cv = acc( 2.0 );
178-
t.equal( cv, 0.0, 'returns 0' );
177+
cv = acc( 2.0 );
178+
t.equal( cv, 0.0, 'returns 0' );
179179

180-
cv = acc();
181-
t.equal( cv, 0.0, 'returns 0' );
180+
cv = acc();
181+
t.equal( cv, 0.0, 'returns 0' );
182182

183-
cv = acc( NaN );
184-
t.equal( cv, 0.0, 'still returns 0 after NaN' );
183+
cv = acc( NaN );
184+
t.equal( cv, 0.0, 'still returns 0 after NaN' );
185185

186-
cv = acc( 3.0 );
187-
t.notEqual( cv, 0.0, 'does not return 0 after two valid numbers' );
186+
cv = acc( 3.0 );
187+
t.notEqual( cv, 0.0, 'does not return 0 after two valid numbers' );
188188

189-
cv = acc();
190-
t.notEqual( cv, 0.0, 'does not return 0' );
189+
cv = acc();
190+
t.notEqual( cv, 0.0, 'does not return 0' );
191191

192-
t.end();
192+
t.end();
193193
});
194194

195195
tape( 'if provided a `NaN`, the accumulator function ignores it and continues accumulating valid values (unknown mean)', function test( t ) {
@@ -225,4 +225,3 @@ tape( 'if provided a `NaN`, the accumulator function ignores it and continues ac
225225
t.notEqual( isnan( acc() ), true, 'does not return NaN' );
226226
t.end();
227227
});
228-

0 commit comments

Comments
 (0)