Repository navigation
test: migrate stats/base/dists/discrete-uniform/logcdf to ULP-based assertions - #15415
Conversation
… assertions Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TtwLeeyjW9sBGNpfzDijtV --- 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. |
|
/stdlib merge |
…ete-uniform-logcdf
Resolves a part of #11352.
Description
This pull request:
stats/base/dists/discrete-uniform/logcdffrom relative tolerance (EPS-scaled) assertions to ULP difference assertions using@stdlib/assert/is-almost-same-value.The following test files were updated:
test/test.logcdf.jstest/test.factory.jstest/test.native.jsIn each file, the
delta/tolcomputation and thet.ok( delta <= tol, ... )assertion were replaced witht.strictEqual( isAlmostSameValue( y, expected[ i ], <ULP> ), true, 'returns expected value' ), and the now unused@stdlib/math/base/special/absand@stdlib/constants/float64/epsimports were removed.ULP bounds
The ULP values are the measured minimums over the full fixture sets. The maximum observed ULP difference was computed for the main export, the factory-created function, and the native implementation; all three agreed exactly, so the same bound is used per fixture set across all three test files:
small_range.json110.0 * EPS41medium_range.json80.0 * EPS100large_range.json150.0 * EPS156Each bound is tight: the worst-case fixture element in each set differs from the expected value by exactly that number of ULP, so lowering any bound by one causes the corresponding test to fail.
The suite was run twice at the final ULP values to confirm determinism, with the native add-on built so that
test/test.native.jsexecuted rather than being skipped:Only test files are changed; no source, documentation, benchmark, or fixture files were touched.
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
The sibling package
stats/base/dists/discrete-uniform/cdfwas used as the reference for the conversion idiom.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code running as an automated task. The conversion follows the idiom established by previously merged packages, the ULP bounds were measured empirically against the existing fixtures, and the test suite and ESLint were run locally before submission.
@stdlib-js/reviewers
Generated by Claude Code