Skip to content

Commit 3446619

Browse files
committed
chore: minor 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 7aff79a commit 3446619

File tree

11 files changed

+11
-51
lines changed

11 files changed

+11
-51
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
* limitations under the License.
1717
*/
1818

19-
#include "stdlib/math/base/napi/binary.h"
2019
#include "stdlib/stats/base/dists/arcsine/mode.h"
20+
#include "stdlib/math/base/napi/binary.h"
2121

2222
// cppcheck-suppress shadowFunction
2323
STDLIB_MATH_BASE_NAPI_MODULE_DD_D( stdlib_base_dists_arcsine_mode )

lib/node_modules/@stdlib/stats/base/dists/arcsine/mode/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
* limitations under the License.
1717
*/
1818

19-
#include "stdlib/math/base/assert/is_nan.h"
2019
#include "stdlib/stats/base/dists/arcsine/mode.h"
20+
#include "stdlib/math/base/assert/is_nan.h"
2121

2222
/**
2323
* Returns the mode of an arcsine distribution.

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

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

2323
var tape = require( 'tape' );
24-
var abs = require( '@stdlib/math/base/special/abs' );
2524
var isnan = require( '@stdlib/math/base/assert/is-nan' );
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

@@ -72,8 +70,6 @@ tape( 'if provided `a >= b`, the function returns `NaN`', function test( t ) {
7270

7371
tape( 'the function returns the mode of an arcsine distribution', function test( t ) {
7472
var expected;
75-
var delta;
76-
var tol;
7773
var a;
7874
var b;
7975
var i;
@@ -84,13 +80,7 @@ tape( 'the function returns the mode of an arcsine distribution', function test(
8480
b = data.b;
8581
for ( i = 0; i < expected.length; i++ ) {
8682
y = mode( a[i], b[i] );
87-
if ( y === expected[i] ) {
88-
t.equal( y, expected[i], 'a: '+a[i]+', b: '+b[i]+', y: '+y+', expected: '+expected[i] );
89-
} else {
90-
delta = abs( y - expected[ i ] );
91-
tol = 1.0 * EPS * abs( expected[ i ] );
92-
t.ok( delta <= tol, 'within tolerance. a: '+a[i]+'. b: '+b[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
93-
}
83+
t.equal( y, expected[i], 'a: '+a[i]+', b: '+b[i]+', y: '+y+', expected: '+expected[i] );
9484
}
9585
t.end();
9686
});

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

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@
2323
var resolve = require( 'path' ).resolve;
2424
var tape = require( 'tape' );
2525
var tryRequire = require( '@stdlib/utils/try-require' );
26-
var abs = require( '@stdlib/math/base/special/abs' );
2726
var isnan = require( '@stdlib/math/base/assert/is-nan' );
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
// VARIABLES //
@@ -81,8 +79,6 @@ tape( 'if provided `a >= b`, the function returns `NaN`', opts, function test( t
8179

8280
tape( 'the function returns the mode of an arcsine distribution', opts, function test( t ) {
8381
var expected;
84-
var delta;
85-
var tol;
8682
var a;
8783
var b;
8884
var i;
@@ -93,13 +89,7 @@ tape( 'the function returns the mode of an arcsine distribution', opts, function
9389
b = data.b;
9490
for ( i = 0; i < expected.length; i++ ) {
9591
y = mode( a[i], b[i] );
96-
if ( y === expected[i] ) {
97-
t.equal( y, expected[i], 'a: '+a[i]+', b: '+b[i]+', y: '+y+', expected: '+expected[i] );
98-
} else {
99-
delta = abs( y - expected[ i ] );
100-
tol = 1.0 * EPS * abs( expected[ i ] );
101-
t.ok( delta <= tol, 'within tolerance. a: '+a[i]+'. b: '+b[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
102-
}
92+
t.equal( y, expected[i], 'a: '+a[i]+', b: '+b[i]+', y: '+y+', expected: '+expected[i] );
10393
}
10494
t.end();
10595
});

lib/node_modules/@stdlib/stats/base/dists/arcsine/skewness/benchmark/c/benchmark.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "stdlib/stats/base/dists/arcsine/skewness.h"
2020
#include <stdio.h>
2121
#include <stdlib.h>
22+
#include <math.h>
2223
#include <time.h>
2324
#include <sys/time.h>
2425

lib/node_modules/@stdlib/stats/base/dists/arcsine/skewness/src/addon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
* limitations under the License.
1717
*/
1818

19-
#include "stdlib/math/base/napi/binary.h"
2019
#include "stdlib/stats/base/dists/arcsine/skewness.h"
20+
#include "stdlib/math/base/napi/binary.h"
2121

2222
// cppcheck-suppress shadowFunction
2323
STDLIB_MATH_BASE_NAPI_MODULE_DD_D( stdlib_base_dists_arcsine_skewness )

lib/node_modules/@stdlib/stats/base/dists/arcsine/skewness/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
* limitations under the License.
1717
*/
1818

19-
#include "stdlib/math/base/assert/is_nan.h"
2019
#include "stdlib/stats/base/dists/arcsine/skewness.h"
20+
#include "stdlib/math/base/assert/is_nan.h"
2121

2222
/**
2323
* Returns the skewness of an arcsine distribution.

lib/node_modules/@stdlib/stats/base/dists/arcsine/stdev/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "stdlib/stats/base/dists/arcsine/stdev.h"
2020
#include "stdlib/math/base/assert/is_nan.h"
2121

22-
#define SQRT1OVER8 0.35355339059327373 // sqrt(1.0 / 8.0)
22+
static const double SQRT1OVER8 = 0.35355339059327373 // sqrt(1.0 / 8.0)
2323

2424
/**
2525
* Returns the standard deviation of an arcsine distribution.

lib/node_modules/@stdlib/stats/base/dists/cosine/mode/manifest.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
"libpath": [],
4040
"dependencies": [
4141
"@stdlib/math/base/napi/binary",
42-
"@stdlib/math/base/assert/is-nan",
43-
"@stdlib/constants/float64/eps"
42+
"@stdlib/math/base/assert/is-nan"
4443
]
4544
},
4645
{

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

Lines changed: 1 addition & 11 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,8 +77,6 @@ tape( 'if provided a nonpositive `s`, the function returns `NaN`', function test
7977

8078
tape( 'the function returns the mode of a raised cosine distribution', function test( t ) {
8179
var expected;
82-
var delta;
83-
var tol;
8480
var mu;
8581
var s;
8682
var y;
@@ -92,13 +88,7 @@ tape( 'the function returns the mode of a raised cosine distribution', function
9288
for ( i = 0; i < mu.length; i++ ) {
9389
y = mode( mu[i], s[i] );
9490
if ( expected[i] !== null ) {
95-
if ( y === expected[i] ) {
96-
t.equal( y, expected[i], 'mu:'+mu[i]+', s: '+s[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]+'. s: '+s[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
101-
}
91+
t.equal( y, expected[i], 'mu:'+mu[i]+', s: '+s[i]+', y: '+y+', expected: '+expected[i] );
10292
}
10393
}
10494
t.end();

0 commit comments

Comments
 (0)