Skip to content

test: migrate stats/base/dists/bradford/median to ULP-based assertions - #14586

Merged
kgryte merged 1 commit into
developfrom
kgryte/ulp-bradford-median
Aug 25, 2026
Merged

kgryte merged 1 commit into
developfrom
kgryte/ulp-bradford-median

Conversation

@kgryte

@kgryte kgryte commented Aug 24, 2026

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

  • Migrates the test suite for stats/base/dists/bradford/median from relative-tolerance comparisons to ULP-based assertions using @stdlib/assert/is-almost-same-value.
  • Replaces the abs( y - expected[i] ) <= tol (where tol = 7.2 * EPS * abs( expected[i] )) idiom with t.strictEqual( isAlmostSameValue( y, expected[ i ], 14 ), true, 'returns expected value' ) and removes the now-unused abs and EPS imports.
  • Applies the same change to both test/test.js and test/test.native.js.

The ULP bound was tightened to the minimum integer that passes over the full fixture set: 14 ULPs (N = 13 fails on one fixture; N = 14 passes deterministically across repeated runs). Only the test files are modified.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance.

This PR was authored by Claude Code, following the migration pattern established in prior ULP-conversion PRs. The minimum ULP bound was measured empirically against the package's fixtures.


@stdlib-js/reviewers


Generated by Claude Code

Migrate the test suite from relative-tolerance comparisons to ULP-based
assertions using `@stdlib/assert/is-almost-same-value`. The tightest
passing bound over the full fixture set is 14 ULPs.

Ref: #11352

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpFyFNqQ3hZwejNzPP5VnD
@stdlib-bot stdlib-bot added Statistics Issue or pull request related to statistical functionality. Good First PR A pull request resolving a Good First Issue. labels Aug 24, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/bradford/median $\\color{green}181/181$
$\\color{green}+100.00\\%$
$\\color{green}8/8$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}181/181$
$\\color{green}+100.00\\%$

The above coverage report was generated for the changes in this PR.

@kgryte kgryte added the Tests Pull requests specifically adding tests. label Aug 25, 2026
@kgryte
kgryte marked this pull request as ready for review August 25, 2026 00:07
@kgryte
kgryte requested a review from a team August 25, 2026 00:07
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 25, 2026
@kgryte
kgryte merged commit dac951c into develop Aug 25, 2026
82 checks passed
@kgryte
kgryte deleted the kgryte/ulp-bradford-median branch August 25, 2026 00:08
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Good First PR A pull request resolving a Good First Issue. Statistics Issue or pull request related to statistical functionality. Tests Pull requests specifically adding tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants