Repository navigation
Conversation
Migrate the unit tests for `stats/base/dists/rayleigh/median` from relative tolerance assertions to ULP difference assertions. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016QMso5LvKAfjzZrpbNHmA8 --- 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: skipped - task: lint_markdown_pkg_readmes status: na - task: lint_markdown_docs status: na - 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: na - 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
|
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/base/dists/rayleigh/medianfrom relative tolerance assertions to ULP difference assertions, as proposed in [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.delta/tolcomputation and correspondingt.ok( delta <= tol, ... )assertion intest/test.native.jswitht.strictEqual( isAlmostSameValue( y, expected[ i ], 0 ), true, 'returns expected value' );.test/test.jswith the same ULP-based assertion, so that both test files share a single accuracy budget.@stdlib/assert/is-almost-same-valuerequire and removes the now unused@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires fromtest/test.native.js.Only
test/test.jsandtest/test.native.jsare modified; no implementation, documentation, benchmark, or fixture files are touched. The existingNaNand invalid-parameter assertions are left as-is, as exact comparisons remain correct for those cases.The ULP bound below is the measured minimum:
0is both the floor of the ULP scale and the measured maximum ULP difference over the fixture set, i.e. every fixture value is reproduced exactly, so no nonzero budget is required.test/test.jst.strictEqual)test/test.native.js1.0 * EPSMeasured by computing
number/float64/base/ulp-differenceagainsttest/fixtures/julia/data.jsonfor every assertion: all 50 fixture values match exactly (ULP difference0) for both the JavaScript and C implementations.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
make test TESTS_FILTER=".*/stats/base/dists/rayleigh/median/.*"passes (55/55).node-gyp rebuild) so thattest/test.native.jswas actually exercised rather than skipped; it passes (55/55) against the compiled C implementation.make lint-javascript-tests TESTS_FILTER=".*/stats/base/dists/rayleigh/median/.*"is clean.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written by Claude Code, mirroring the migration idiom established by previously merged conversions in this family (e.g.,
stats/base/dists/lognormal/median,stats/base/dists/gumbel/median,stats/base/dists/normal/median). The ULP bound was measured empirically rather than guessed.@stdlib-js/reviewers
Generated by Claude Code