refactor: align stats/base/dists/hypergeometric/mean with namespace conventions#11693
Draft
Planeshifter wants to merge 1 commit intodevelopfrom
Draft
refactor: align stats/base/dists/hypergeometric/mean with namespace conventions#11693Planeshifter wants to merge 1 commit intodevelopfrom
stats/base/dists/hypergeometric/mean with namespace conventions#11693Planeshifter wants to merge 1 commit intodevelopfrom
Conversation
… conventions Dropped the redundant `isnan(N)||isnan(K)||isnan(n)` guard block at the top of `mean()`; `!isNonNegativeInteger()` already rejects NaN, matching the 7-guard validation prologue used by `kurtosis`, `mode`, `skewness`, and `variance` (80% of hypergeometric moment-computing siblings with explicit validation). Also removed the now-unused `@stdlib/math/base/assert/is-nan` require. Behavior is preserved — NaN inputs still return NaN.
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:
stats/base/dists/hypergeometricwith namespace majority patterns (random namespace pick, seed1776774012099).Namespace summary
cdf,ctor,kurtosis,logpmf,mean,mode,pmf,quantile,skewness,stdev,variance.package.jsonshape (top-level,scripts,stdlib,directories,engines,os,types,repository),manifest.jsonshape, README##/###heading sequence,test//benchmark//examples/file naming, public signature, return kind, validation prologue, error construction, JSDoc shape,@stdlib/*dependency set.package.jsontop-level keys (11/11), README##section sequence[Usage, Examples](11/11), moment-function validation prologue (4/5 = 80% among moment-computing siblings with explicit validation), return kindvalue(11/11), JSDochasExample(11/11).binding.gyp,src/*,manifest.json,benchmark/benchmark.native.js,test/test.native.js,benchmark/c/*,examples/c/*(7/11 = 64%); presence oflib/factory.js(4/11);errorConstruction(onlyctorconstructs errors, which already usesformat).stats/base/dists/hypergeometric/meanRemoves a redundant
isnan(N)||isnan(K)||isnan(n)guard and the associated@stdlib/math/base/assert/is-nanrequire fromstats/base/dists/hypergeometric/mean. Withinstats/base/dists/hypergeometric, the four sibling moment utilitieskurtosis,mode,skewness, andvariance(80% conformance) rely solely on the!isNonNegativeIntegerpredicate to reject NaN inputs —!isNonNegativeInteger(NaN)istrue, so the separate NaN guard is unreachable dead code. Behavior and test coverage are unchanged.Validation
package.json/manifest.jsonkeys, README##/###heading sequence,test//benchmark//examples/filenames.@stdlib/*dependency set.ctorpackages (sonnet).ctormissingtest/fixtures/julia/{REQUIRE,data.json,runner.jl}— sibling-distributionctorpackages (stats/base/dists/normal/ctor,.../binomial/ctor,.../poisson/ctor,.../beta/ctor) also lack Julia fixtures; thectortest is a structural class test and numeric correctness is already covered by the delegated-to sibling packages. Classified as intentional deviation.Related Issues
No.
Questions
No.
Other
Output of a cross-package drift-detection routine over a randomly selected stdlib namespace (
stats/base/dists/hypergeometric, seed1776774012099). See the local drift report for the full per-feature tally, excluded findings, and agent verdicts. Draft PR: a maintainer should audit before promoting to ready-for-review.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
Claude Code executed a cross-package drift-detection routine that randomly selected the
stats/base/dists/hypergeometricnamespace (seed1776774012099), extracted structural and semantic features across the 11 sibling packages, computed majority patterns, and identified outliers. Three validation agents (opus × 2, sonnet × 1) independently verified each drift candidate; only findings classified asconfirmed-driftby all relevant agents were applied as mechanical, behavior-preserving patches. A maintainer must audit before promoting from draft.@stdlib-js/reviewers