docs: correct s predicate in d.ts Notes for stats/base/dists/cosine/mgf#12101
Open
Planeshifter wants to merge 1 commit into
Open
docs: correct s predicate in d.ts Notes for stats/base/dists/cosine/mgf#12101Planeshifter wants to merge 1 commit into
s predicate in d.ts Notes for stats/base/dists/cosine/mgf#12101Planeshifter wants to merge 1 commit into
Conversation
…e/mgf` The TypeScript declaration Notes section claimed the function returns `NaN` when `s < 0`, but the implementation (`lib/main.js`, `lib/factory.js`, `src/main.c`) rejects `s <= 0.0`, the JSDoc declares `s` as a `PositiveNumber`, and both the README and `docs/repl.txt` already document `s <= 0`. The declaration was the only artifact in the package that disagreed with the actual validation predicate; update its Notes section to match. In the wider `stats/base/dists/cosine` namespace, 13 of 14 packages already have d.ts Notes that match their source validation (7 scalar moments use `s <= 0`; 4 strictly-evaluated functions use `s < 0`; quantile mentions both `s` and `p` bounds). `mgf` was the lone holdout.
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/cosine/mgf, corrects the TypeScript declaration's Notes section fromIf provided \s < 0`, the function returns `NaN`.toIf provided `s <= 0`, the function returns `NaN`.so it matches the actual validation. The implementation inlib/main.js,lib/factory.js, andsrc/main.call rejects <= 0.0; the JSDoc declaressasPositiveNumber; and both the README anddocs/repl.txtalready documents <= 0`. The d.ts was the lone artifact in the package that disagreed with the source predicate (92.9% conformance across the namespace's d.ts Notes prior to this change, 100% after).Related Issues
No related issues.
Questions
No.
Other
Detected via a cross-package consistency sweep of the
stats/base/dists/cosinenamespace (14 packages). The declaration was templated from an eval-function declaration (cdf/pdf/logcdf/logpdfall uses < 0because they accepts = 0as a degenerate distribution), butmgf's implementation correctly rejectss = 0since the raised cosine MGF requires a positive scale; only the d.ts wording was not updated to reflect that.See:
stdlib/lib/node_modules/@stdlib/stats/base/dists/cosine/mgf/lib/main.js
Line 70 in 30d9788
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was produced end-to-end by Claude Code as part of an automated cross-package API drift detection run scoped to the
stats/base/dists/cosinenamespace. The drift (d.ts Notes section disagreeing with the source'ss <= 0validation predicate) was identified by majority vote across the 14 sibling packages and confirmed by three independent review passes (semantic, cross-reference, structural) before applying the one-line fix.@stdlib-js/reviewers
Generated by Claude Code