refactor: align TypeScript declarations across stats packages#12512
Merged
Conversation
Propagates fix from 7563015 ("refactor: use `offsetX` parameter name in `strided/nanrange`") to a sibling strided package where the TypeScript declaration still used the unqualified `offset` parameter name in the ndarray signature.
Propagates fix from 056a080 ("refactor: remove unused generics") and e8a15dd ("refactor: remove unused generic in `stats/base/ndarray/minsorted`") to sibling ndarray packages whose TypeScript declarations introduced a generic parameter `T` that was only ever used inside the input array tuple and never constrained or returned, so the indirection added nothing.
Propagates fix from 9ee909b ("refactor: align parameter name with implementation in `incr/nanstdev`") to sibling incremental accumulator packages whose TypeScript declarations used `mu` for the optional known-mean parameter while the JavaScript implementations consistently used `mean`.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
approved these changes
Jun 4, 2026
Member
|
As the CI failure is not due to changes introduced in this PR, I'll go ahead and merge. |
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
Propagating fixes merged to
developbetween 2026-06-02 20:44 CDT and 2026-06-03 04:40 PDT to sibling packages.Each commit on this branch corresponds to one source fix pattern and applies the equivalent change to every sibling that exhibited the same defect after independent validation.
`refactor: use
offsetXparameter name in ``strided/meanwd``` (commit 563cadc)Source:
75630151("refactor: useoffsetXparameter name instrided/nanrange"). ThemeanwdTypeScript declaration'sndarraysignature and its JSDoc still referred to the starting-index argument asoffsetrather than the namespace-wideoffsetXconvention used by the implementation and by sibling strided routines. Renamed both the@paramtag and the parameter in the signature.@stdlib/stats/strided/meanwd`refactor: remove unused generics across ``stats/base/ndarray/*``` (commit 09eafa3)
Sources:
056a0802("refactor: remove unused generics") ande8a15dd0("refactor: remove unused generic instats/base/ndarray/minsorted"). Each of the sibling declarations introducedT extends typedndarray<number> = typedndarray<number>and usedTonly inside the input array tuple — never in the return type, never in any constraint. The generic added indirection without expressing a relationship, so it has been removed andtypedndarray<number>substituted in place.@stdlib/stats/base/ndarray/dmeanstdev@stdlib/stats/base/ndarray/dnanstdev@stdlib/stats/base/ndarray/dnanstdevch@stdlib/stats/base/ndarray/dnanstdevpn@stdlib/stats/base/ndarray/sstdev@stdlib/stats/base/ndarray/sstdevch@stdlib/stats/base/ndarray/sstdevpn@stdlib/stats/base/ndarray/sstdevtk@stdlib/stats/base/ndarray/sstdevwd@stdlib/stats/base/ndarray/sstdevyc`refactor: align parameter name with implementation in ``stats/incr/*``` (commit 8f2798b)
Source:
9ee909b1("refactor: align parameter name with implementation inincr/nanstdev"). The TypeScript declarations exposed the optional first argument asmu, while the JavaScript implementations inlib/main.jsconsistently bind the parameter tomean. The declarations have been brought into alignment with the implementations so that downstream consumers see the same name the runtime exposes.@stdlib/stats/incr/variance@stdlib/stats/incr/nanvariance@stdlib/stats/incr/stdevRelated Issues
This pull request has no related issues.
Questions
No.
Other
Validation
Search scope was restricted per source pattern:
lib/node_modules/@stdlib/stats/strided/*/docs/types/index.d.tsfor the strided rename;lib/node_modules/@stdlib/stats/base/ndarray/*/docs/types/index.d.tsfor the unused-generic removal; andlib/node_modules/@stdlib/stats/incr/*/docs/types/index.d.tsfor themu→meanalignment, with the actual JavaScript implementation in each package'slib/main.jsconsulted to confirm the misalignment.Every candidate site was independently confirmed by two validation passes that read the full file (rejecting any site where surrounding context would change semantics), an adaptation pass that produced the exact patch, and a style-consistency pass that compared the patches against the already-fixed source declarations. Only sites that survived all four passes appear in this PR.
Deliberately excluded:
stats/base/ndarray/cumaxandcumin: the genericTis used in the return type, so removal would be a behavior change.6a45ff78("fix: broaden parameter types in@stdlib/assert/is-negative-finite"): the source commit's primary intent was widening parameter types — package-specific — and the incidental rename portion is morerefactor:thanfix:, so it does not cleanly propagate from that commit.logistic/weibull/levy): each distribution has its own canonical parameter naming, so the propagation would require per-package interpretation rather than a mechanical rule.math/iterandmath/base/tools: each commit corrected a unique error per file with no clear sibling pattern.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was produced by an automated fix-propagation routine driven by Claude Code: source commits merged to
developin the prior 24 hours were filtered to those describing generalizable defects, candidate sibling sites were enumerated by ripgrep searches scoped to each pattern's namespace, and four independent agent passes (two validation, one adaptation, one style-consistency) confirmed every site before patches were applied. Commit messages and this PR body were drafted by Claude Code and reviewed before pushing.@stdlib-js/reviewers
Generated by Claude Code