Skip to content

Commit bdf9a93

Browse files
committed
fix: add missing dep, update description, and revert test changes
Ref: c38ee71 --- 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: na - 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 97ab65f commit bdf9a93

File tree

5 files changed

+47
-23
lines changed

5 files changed

+47
-23
lines changed

lib/node_modules/@stdlib/stats/base/dists/poisson/logpmf/manifest.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@
3939
"libpath": [],
4040
"dependencies": [
4141
"@stdlib/math/base/napi/binary",
42+
"@stdlib/math/base/assert/is-nan",
4243
"@stdlib/math/base/assert/is-nonnegative-integer",
4344
"@stdlib/math/base/special/factorialln",
44-
"@stdlib/math/base/assert/is-nan",
45+
"@stdlib/math/base/special/ln",
4546
"@stdlib/constants/float64/pinf",
4647
"@stdlib/constants/float64/ninf"
4748
]
@@ -58,10 +59,10 @@
5859
"libraries": [],
5960
"libpath": [],
6061
"dependencies": [
62+
"@stdlib/math/base/special/ceil",
6163
"@stdlib/math/base/assert/is-nan",
6264
"@stdlib/math/base/assert/is-nonnegative-integer",
6365
"@stdlib/math/base/special/factorialln",
64-
"@stdlib/math/base/special/ceil",
6566
"@stdlib/math/base/special/ln",
6667
"@stdlib/constants/float64/pinf",
6768
"@stdlib/constants/float64/ninf"
@@ -79,10 +80,10 @@
7980
"libraries": [],
8081
"libpath": [],
8182
"dependencies": [
83+
"@stdlib/math/base/special/ceil",
8284
"@stdlib/math/base/assert/is-nan",
8385
"@stdlib/math/base/assert/is-nonnegative-integer",
8486
"@stdlib/math/base/special/factorialln",
85-
"@stdlib/math/base/special/ceil",
8687
"@stdlib/math/base/special/ln",
8788
"@stdlib/constants/float64/pinf",
8889
"@stdlib/constants/float64/ninf"

lib/node_modules/@stdlib/stats/base/dists/poisson/logpmf/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/poisson/logpmf.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_poisson_logpmf )

lib/node_modules/@stdlib/stats/base/dists/poisson/logpmf/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "stdlib/constants/float64/pinf.h"
2626

2727
/**
28-
* Evaluates the quantile function for a Poisson distribution with mean parameter `lambda` at a probability `p`.
28+
* Evaluates the natural logarithm of the probability mass function (PMF) for a Poisson distribution with mean parameter `lambda` at a value `x`.
2929
*
3030
* @param x input value
3131
* @param lambda mean parameter

lib/node_modules/@stdlib/stats/base/dists/poisson/logpmf/test/test.logpmf.js

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,13 @@ tape( 'the function evaluates the logpmf for `x` given a small parameter `lambda
128128
lambda = smallMean.lambda;
129129
for ( i = 0; i < x.length; i++ ) {
130130
y = logpmf( x[i], lambda[i] );
131-
delta = abs( y - expected[ i ] );
132-
tol = 20.0 * EPS * abs( expected[ i ] );
133-
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
131+
if ( y === expected[i] ) {
132+
t.equal( y, expected[i], 'x: '+x[i]+'. lambda: '+lambda[i]+', y: '+y+', expected: '+expected[i] );
133+
} else {
134+
delta = abs( y - expected[ i ] );
135+
tol = 20.0 * EPS * abs( expected[ i ] );
136+
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
137+
}
134138
}
135139
t.end();
136140
});
@@ -149,9 +153,13 @@ tape( 'the function evaluates the logpmf for `x` given a medium parameter `lambd
149153
lambda = mediumMean.lambda;
150154
for ( i = 0; i < x.length; i++ ) {
151155
y = logpmf( x[i], lambda[i] );
152-
delta = abs( y - expected[ i ] );
153-
tol = 30.0 * EPS * abs( expected[ i ] );
154-
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
156+
if ( y === expected[i] ) {
157+
t.equal( y, expected[i], 'x: '+x[i]+'. lambda: '+lambda[i]+', y: '+y+', expected: '+expected[i] );
158+
} else {
159+
delta = abs( y - expected[ i ] );
160+
tol = 30.0 * EPS * abs( expected[ i ] );
161+
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
162+
}
155163
}
156164
t.end();
157165
});
@@ -170,9 +178,13 @@ tape( 'the function evaluates the logpmf for `x` given a large parameter `lambda
170178
lambda = largeMean.lambda;
171179
for ( i = 0; i < x.length; i++ ) {
172180
y = logpmf( x[i], lambda[i] );
173-
delta = abs( y - expected[ i ] );
174-
tol = 80.0 * EPS * abs( expected[ i ] );
175-
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
181+
if ( y === expected[i] ) {
182+
t.equal( y, expected[i], 'x: '+x[i]+'. lambda: '+lambda[i]+', y: '+y+', expected: '+expected[i] );
183+
} else {
184+
delta = abs( y - expected[ i ] );
185+
tol = 80.0 * EPS * abs( expected[ i ] );
186+
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
187+
}
176188
}
177189
t.end();
178190
});

lib/node_modules/@stdlib/stats/base/dists/poisson/logpmf/test/test.native.js

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,13 @@ tape( 'the function evaluates the logpmf for `x` given a small parameter `lambda
137137
lambda = smallMean.lambda;
138138
for ( i = 0; i < x.length; i++ ) {
139139
y = logpmf( x[i], lambda[i] );
140-
delta = abs( y - expected[ i ] );
141-
tol = 20.0 * EPS * abs( expected[ i ] );
142-
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
140+
if ( y === expected[i] ) {
141+
t.equal( y, expected[i], 'x: '+x[i]+'. lambda: '+lambda[i]+', y: '+y+', expected: '+expected[i] );
142+
} else {
143+
delta = abs( y - expected[ i ] );
144+
tol = 20.0 * EPS * abs( expected[ i ] );
145+
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
146+
}
143147
}
144148
t.end();
145149
});
@@ -158,9 +162,13 @@ tape( 'the function evaluates the logpmf for `x` given a medium parameter `lambd
158162
lambda = mediumMean.lambda;
159163
for ( i = 0; i < x.length; i++ ) {
160164
y = logpmf( x[i], lambda[i] );
161-
delta = abs( y - expected[ i ] );
162-
tol = 30.0 * EPS * abs( expected[ i ] );
163-
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
165+
if ( y === expected[i] ) {
166+
t.equal( y, expected[i], 'x: '+x[i]+'. lambda: '+lambda[i]+', y: '+y+', expected: '+expected[i] );
167+
} else {
168+
delta = abs( y - expected[ i ] );
169+
tol = 30.0 * EPS * abs( expected[ i ] );
170+
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
171+
}
164172
}
165173
t.end();
166174
});
@@ -179,9 +187,13 @@ tape( 'the function evaluates the logpmf for `x` given a large parameter `lambda
179187
lambda = largeMean.lambda;
180188
for ( i = 0; i < x.length; i++ ) {
181189
y = logpmf( x[i], lambda[i] );
182-
delta = abs( y - expected[ i ] );
183-
tol = 80.0 * EPS * abs( expected[ i ] );
184-
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
190+
if ( y === expected[i] ) {
191+
t.equal( y, expected[i], 'x: '+x[i]+'. lambda: '+lambda[i]+', y: '+y+', expected: '+expected[i] );
192+
} else {
193+
delta = abs( y - expected[ i ] );
194+
tol = 80.0 * EPS * abs( expected[ i ] );
195+
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
196+
}
185197
}
186198
t.end();
187199
});

0 commit comments

Comments
 (0)