Skip to content

Commit 4d4ff63

Browse files
committed
chore: clean-up
--- 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: na - task: lint_javascript_src status: na - 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: passed - task: lint_c_examples status: na - task: lint_c_benchmarks status: passed - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 20475c3 commit 4d4ff63

File tree

4 files changed

+11
-33
lines changed

4 files changed

+11
-33
lines changed

lib/node_modules/@stdlib/stats/base/dists/normal/mode/benchmark/c/benchmark.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ static double random_uniform( const double min, const double max ) {
9292
* @return elapsed time in seconds
9393
*/
9494
static double benchmark( void ) {
95-
double elapsed;
96-
double mu[ 100 ];
9795
double sigma[ 100 ];
96+
double mu[ 100 ];
97+
double elapsed;
9898
double y;
9999
double t;
100100
int i;

lib/node_modules/@stdlib/stats/base/dists/normal/mode/src/addon.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@
1919
#include "stdlib/stats/base/dists/normal/mode.h"
2020
#include "stdlib/math/base/napi/binary.h"
2121

22-
// cppcheck-suppress shadowFunction
2322
STDLIB_MATH_BASE_NAPI_MODULE_DD_D( stdlib_base_dists_normal_mode )

lib/node_modules/@stdlib/stats/base/dists/normal/mode/test/test.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@
2222

2323
var tape = require( 'tape' );
2424
var isnan = require( '@stdlib/math/base/assert/is-nan' );
25-
var abs = require( '@stdlib/math/base/special/abs' );
2625
var PINF = require( '@stdlib/constants/float64/pinf' );
2726
var NINF = require( '@stdlib/constants/float64/ninf' );
28-
var EPS = require( '@stdlib/constants/float64/eps' );
2927
var mode = require( './../lib' );
3028

3129

@@ -79,9 +77,7 @@ tape( 'if provided a nonpositive `sigma`, the function returns `NaN`', function
7977

8078
tape( 'the function returns the mode of a normal distribution', function test( t ) {
8179
var expected;
82-
var delta;
8380
var sigma;
84-
var tol;
8581
var mu;
8682
var y;
8783
var i;
@@ -91,15 +87,7 @@ tape( 'the function returns the mode of a normal distribution', function test( t
9187
sigma = data.sigma;
9288
for ( i = 0; i < mu.length; i++ ) {
9389
y = mode( mu[i], sigma[i] );
94-
if ( expected[i] !== null ) {
95-
if ( y === expected[i] ) {
96-
t.equal( y, expected[i], 'mu:'+mu[i]+', sigma: '+sigma[i]+', y: '+y+', expected: '+expected[i] );
97-
} else {
98-
delta = abs( y - expected[ i ] );
99-
tol = 1.0 * EPS * abs( expected[ i ] );
100-
t.ok( delta <= tol, 'within tolerance. mu: '+mu[i]+'. sigma: '+sigma[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
101-
}
102-
}
90+
t.equal( y, expected[i], 'mu:'+mu[i]+', sigma: '+sigma[i]+', y: '+y+', expected: '+expected[i] );
10391
}
10492
t.end();
10593
});

lib/node_modules/@stdlib/stats/base/dists/normal/mode/test/test.native.js

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ var resolve = require( 'path' ).resolve;
2424
var tape = require( 'tape' );
2525
var tryRequire = require( '@stdlib/utils/try-require' );
2626
var isnan = require( '@stdlib/math/base/assert/is-nan' );
27-
var abs = require( '@stdlib/math/base/special/abs' );
2827
var PINF = require( '@stdlib/constants/float64/pinf' );
2928
var NINF = require( '@stdlib/constants/float64/ninf' );
30-
var EPS = require( '@stdlib/constants/float64/eps' );
3129

3230

3331
// FIXTURES //
@@ -38,25 +36,28 @@ var data = require( './fixtures/julia/data.json' );
3836
// VARIABLES //
3937

4038
var mode = tryRequire( resolve( __dirname, './../lib/native.js' ) );
39+
var opts = {
40+
'skip': ( mode instanceof Error )
41+
};
4142

4243

4344
// TESTS //
4445

45-
tape( 'main export is a function', function test( t ) {
46+
tape( 'main export is a function', opts, function test( t ) {
4647
t.ok( true, __filename );
4748
t.strictEqual( typeof mode, 'function', 'main export is a function' );
4849
t.end();
4950
});
5051

51-
tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) {
52+
tape( 'if provided `NaN` for any parameter, the function returns `NaN`', opts, function test( t ) {
5253
var y = mode( NaN, 1.0 );
5354
t.equal( isnan( y ), true, 'returns NaN' );
5455
y = mode( 1.0, NaN );
5556
t.equal( isnan( y ), true, 'returns NaN' );
5657
t.end();
5758
});
5859

59-
tape( 'if provided a nonpositive `sigma`, the function returns `NaN`', function test( t ) {
60+
tape( 'if provided a nonpositive `sigma`, the function returns `NaN`', opts, function test( t ) {
6061
var y;
6162

6263
y = mode( 2.0, 0.0 );
@@ -83,11 +84,9 @@ tape( 'if provided a nonpositive `sigma`, the function returns `NaN`', function
8384
t.end();
8485
});
8586

86-
tape( 'the function returns the mode of a normal distribution', function test( t ) {
87+
tape( 'the function returns the mode of a normal distribution', opts, function test( t ) {
8788
var expected;
88-
var delta;
8989
var sigma;
90-
var tol;
9190
var mu;
9291
var y;
9392
var i;
@@ -97,15 +96,7 @@ tape( 'the function returns the mode of a normal distribution', function test( t
9796
sigma = data.sigma;
9897
for ( i = 0; i < mu.length; i++ ) {
9998
y = mode( mu[i], sigma[i] );
100-
if ( expected[i] !== null) {
101-
if ( y === expected[i] ) {
102-
t.equal( y, expected[i], 'mu:'+mu[i]+', sigma: '+sigma[i]+', y: '+y+', expected: '+expected[i] );
103-
} else {
104-
delta = abs( y - expected[ i ] );
105-
tol = 1.0 * EPS * abs( expected[ i ] );
106-
t.ok( delta <= tol, 'within tolerance. mu: '+mu[i]+'. sigma: '+sigma[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
107-
}
108-
}
99+
t.equal( y, expected[i], 'mu:'+mu[i]+', sigma: '+sigma[i]+', y: '+y+', expected: '+expected[i] );
109100
}
110101
t.end();
111102
});

0 commit comments

Comments
 (0)