Repository navigation
test: migrate stats/incr/nanmpe to ULP-based assertions - #15969
Conversation
Migrate the tests for `stats/incr/nanmpe` from relative tolerance assertions to ULP-based assertions using `@stdlib/assert/is-almost-same-value`, as proposed in #11352. Both migrated test cases pass at a ULP bound of `1`, which is the minimum passing integer value for each. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011wXHMLyS4pbZfSTXKCMyoX
|
Hello! 👋 We've noticed that you've been opening a number of PRs addressing good first issues. Thank you for your interest and enthusiasm! Now that you've made a few contributions, we suggest no longer working on good first issues. Instead, we encourage you to prioritize cleaning up any PRs which have yet to be merged and then proceed to work on more involved tasks. Not only does this ensure that other new contributors can work on things and get ramped up on all things stdlib, it also ensures that you can spend your time on more challenging problems. 🚀 For ideas for future PRs, feel free to search the codebase for TODOs and FIXMEs and be sure to check out other open issues on the issue tracker. Cheers! |
Coverage Report
The above coverage report was generated for the changes in this PR. |
Resolves a part of #11352.
Description
This pull request:
stats/incr/nanmpefrom relative tolerance assertions (delta <= tol, wheretol = C * EPS * abs( expected )) to ULP-based assertions using@stdlib/assert/is-almost-same-value, as proposed in [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.Two test cases were migrated, and, in each case, the ULP bound was tightened to the minimum passing integer value:
the accumulator function incrementally computes the mean percentage error, ignoring NaN values10.0 * EPS * abs( expected )1if not provided an input value, the accumulator function returns the current mean percentage error1.0 * EPS * abs( expected )1The bounds were determined by starting from a high ULP allowance (
64) and lowering the value until the minimum passing integer was found. For both test cases, lowering the bound to0causes that test case to fail, and thus1is minimal in each case. The test suite was run twice at the final bounds in order to confirm determinism (11/11 assertions passing in each run).Notes:
actual === expectedbranch is no longer necessary, asisAlmostSameValueshort-circuits on strict equality and thus already handles the iterations in which aNaNinput leaves the accumulated value unchanged.test/test.jsrequired updating.Related Issues
This pull request has the following related issues:
math/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code, which performed the test migration, measured the minimum passing ULP bounds, and ran the test and lint suites locally.
@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_011wXHMLyS4pbZfSTXKCMyoX
Generated by Claude Code