chore: clean-up - #13725
Merged
Merged
Conversation
Add the missing `@example` JSDoc tag preceding the usage snippet in the private `pdf` closure returned by `factory`. The example code was present but untagged; every other function member's factory closure in the namespace tags it (5/6 siblings; 83% conformance). Documentation only; no behavior, signature, or test change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sw1TscYtQ82XDG4btdDLw2
Insert an explicit `isnan( t )` short-circuit as the first check in the private `mgf` closure returned by `factory`, matching the guard ordering already used by the package's own `lib/main.js` and by 5/6 sibling function members (83% conformance). Behavior is unchanged: `mgf( NaN )` already returned `NaN` via arithmetic propagation. No signature or test change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sw1TscYtQ82XDG4btdDLw2
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
mgf/pdf factory closures in stats/base/dists/laplacemgf/pdf factory closures in stats/base/dists/laplace
Planeshifter
marked this pull request as ready for review
July 28, 2026 16:34
kgryte
reviewed
Jul 28, 2026
Co-authored-by: Athan <kgryte@gmail.com> Signed-off-by: Athan <kgryte@gmail.com>
kgryte
approved these changes
Jul 28, 2026
mgf/pdf factory closures in stats/base/dists/laplace
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
Two mechanical drift corrections in
stats/base/dists/laplace, each normalizing alib/factory.jsprivate closure to the convention shared by its sibling function members. No behavior, signatures, or test expectations change.stats/base/dists/laplace/mgfThe private
mgfclosure returned byfactoryomitted the leadingisnan( t )short-circuit that its ownlib/main.jsand 5 of 6 sibling function factories apply before any arithmetic (83% conformance). Added it as the first guard. Output is identical for every input —mgf( NaN )already returnedNaNthrough arithmetic propagation — so this is a consistency fix, not a behavior change.stats/base/dists/laplace/pdfThe private
pdfclosure returned byfactorycarried an untagged usage snippet in its JSDoc; every other function member tags it with@example(5 of 6 siblings; 83% conformance). Added the missing tag. Documentation only.Related Issues
No.
Questions
No.
Other
Both corrections were surfaced by a majority-vote drift sweep over the 15 members of
stats/base/dists/laplace(75% threshold) and confirmed by independent source review; each is a single-package, behavior-preserving patch confined tolib/factory.js.Deliberately excluded from this PR:
ctor's absence of native-C scaffolding and of thelocation-scale/exponential familykeywords — intentional,ctoris a pure-JS constructor class.stdev's python (rather than julia) test fixtures — a valid alternative that would cascade to expected test data.## C APIs"rate parameter" label forbincdf/logcdf/logpdf/quantile/mode— a genuine documentation error, but with no ≥75% namespace majority (9 "scale" / 5 "rate") and a fix that requires the domain judgment that "scale" is correct. Left for a maintainer.No overlap with open PR #13410 (touches only laplace READMEs) or merged PR #12449 (mgf
@paramJSDoc normalization — distinct items).Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code as part of an automated cross-package API drift-detection sweep. The routine extracted structural and semantic features from every member of
stats/base/dists/laplace, computed a per-feature majority pattern at a 75% threshold, validated each candidate correction against the package source and its siblings, and applied only mechanical, behavior-preserving patches. A maintainer should audit and promote out of draft.Generated by Claude Code