Skip to content

chore: clean-up - #13725

Merged
kgryte merged 3 commits into
developfrom
claude/busy-mayer-ybbyjw
Jul 28, 2026
Merged

chore: clean-up#13725
kgryte merged 3 commits into
developfrom
claude/busy-mayer-ybbyjw

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

Two mechanical drift corrections in stats/base/dists/laplace, each normalizing a lib/factory.js private closure to the convention shared by its sibling function members. No behavior, signatures, or test expectations change.

stats/base/dists/laplace/mgf

The private mgf closure returned by factory omitted the leading isnan( t ) short-circuit that its own lib/main.js and 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 returned NaN through arithmetic propagation — so this is a consistency fix, not a behavior change.

stats/base/dists/laplace/pdf

The private pdf closure returned by factory carried 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 to lib/factory.js.

Deliberately excluded from this PR:

  • ctor's absence of native-C scaffolding and of the location-scale/exponential family keywords — intentional, ctor is a pure-JS constructor class.
  • stdev's python (rather than julia) test fixtures — a valid alternative that would cascade to expected test data.
  • The ## C APIs "rate parameter" label for b in cdf/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 @param JSDoc normalization — distinct items).

Checklist

AI Assistance

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

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

claude added 2 commits July 28, 2026 16:24
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
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label Jul 28, 2026
@stdlib-bot

stdlib-bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/laplace/mgf $\\color{green}320/320$
$\\color{green}+0.00\\%$
$\\color{green}21/21$
$\\color{green}+0.00\\%$
$\\color{green}4/4$
$\\color{green}+0.00\\%$
$\\color{green}320/320$
$\\color{green}+0.00\\%$
stats/base/dists/laplace/pdf $\\color{green}292/292$
$\\color{green}+0.00\\%$
$\\color{green}19/19$
$\\color{green}+0.00\\%$
$\\color{green}4/4$
$\\color{green}+0.00\\%$
$\\color{green}292/292$
$\\color{green}+0.00\\%$

The above coverage report was generated for the changes in this PR.

@Planeshifter Planeshifter changed the title refactor: normalize mgf/pdf factory closures in stats/base/dists/laplace chore: normalize mgf/pdf factory closures in stats/base/dists/laplace Jul 28, 2026
@Planeshifter
Planeshifter marked this pull request as ready for review July 28, 2026 16:34
@Planeshifter
Planeshifter requested review from a team and kgryte July 28, 2026 16:34
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Jul 28, 2026
Comment thread lib/node_modules/@stdlib/stats/base/dists/laplace/mgf/lib/factory.js Outdated
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
@kgryte kgryte changed the title chore: normalize mgf/pdf factory closures in stats/base/dists/laplace chore: clean-up Jul 28, 2026
@kgryte
kgryte merged commit c5d65b1 into develop Jul 28, 2026
12 checks passed
@kgryte
kgryte deleted the claude/busy-mayer-ybbyjw branch July 28, 2026 20:51
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Jul 28, 2026
@Planeshifter Planeshifter mentioned this pull request Jul 29, 2026
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants