refactor: wrap addon in stats/base/dists/bradford/median native binding#13002
Draft
Planeshifter wants to merge 1 commit into
Draft
refactor: wrap addon in stats/base/dists/bradford/median native binding#13002Planeshifter wants to merge 1 commit into
stats/base/dists/bradford/median native binding#13002Planeshifter wants to merge 1 commit into
Conversation
…ding
Replace the `var median = addon;` alias with a `function median( c ) { return addon( c ); }` wrapper in `lib/native.js`. The wrapped pattern is the convention across all 426 sibling distribution `lib/native.js` files in `stats/base/dists` (and the other nine `bradford` sub-packages), and the wrapper matches the function-style JSDoc declaration already present in the file as well as the TypeScript declaration in `docs/types/index.d.ts`. Behavior is unchanged: both forms invoke the same C addon with the shape parameter.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request:
var median = addon;alias in@stdlib/stats/base/dists/bradford/median/lib/native.jswith afunction median( c ) { return addon( c ); }wrapper, matching the convention used in every otherlib/native.jsinstats/base/dists(426/427 ≈ 99.8%) — including the nine siblingbradfordsub-packages (cdf,entropy,mean,mode,pdf,quantile,skewness,stdev,variance).The wrapper also matches the function-style JSDoc declaration already in the file (
* function median( c )) and the TypeScript declaration indocs/types/index.d.ts(declare function median( c: number ): number;).bradford/medianSole
lib/native.jsinstats/base/dists(out of 427) still using thevar name = addon;alias form rather than a function wrapper. Behavior is unchanged: both forms invoke the same C addon with the shape parameter, and the existing test (test/test.native.js) exercises the call site, not the export identity. The wrapper restores consistency with the surrounding JSDoc and TypeScript declaration in the same package.Related Issues
No.
Questions
No.
Other
Surfaced by an automated cross-package drift audit of the
@stdlib/stats/base/dists/bradfordnamespace (10 members). The only correction that survived gating and three-axis validation (semantic equivalence, test-cascade check, structural conformance). Two other findings were logged but dropped:skewnessis missingdocs/img/equation_bradford_skewness.svgand the matching<div class="equation">placeholder in its README, but both are produced by themakiegenerator (auto-populated, excluded by gate);modelackstest/fixtures/python/data because the mode of a Bradford distribution is the constant0.0and the test asserts this directly without numerical fixtures (intentional deviation).Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This change was surfaced and authored by an automated Claude Code drift audit of the
stats/base/dists/bradfordnamespace. The audit compared structural and semantic features across the namespace's ten members and against all 427lib/native.jsfiles understats/base/dists; the export-pattern outlier inbradford/median/lib/native.jswas the sole correction that survived materiality and validation gating. The patch and conformance counts were verified before submission, and the change is reviewable as a 4-line refactor with no behavior change.@stdlib-js/reviewers
Generated by Claude Code