Repository navigation
docs: fix example - #14152
Merged
kgryte merged 4 commits intoAug 10, 2026
Merged
docs: fix example#14152
Conversation
Normalize the package summary strings to follow the sibling naming convention shared across the `degenerate` namespace. - package.json `description`: rewrote "Natural logarithm of the probability mass function (PMF) for a degenerate distribution." to "Degenerate distribution logarithm of probability mass function (logPMF)." to match the `logcdf`/`logpdf` package descriptions (14/15 = 93% of members lead with "Degenerate distribution ..."). - lib/index.js `@module` summary: applied the same leading-phrase normalization, mirroring `logpdf`'s "Degenerate distribution natural logarithm of ... (logPDF)." form. No functional changes; documentation and metadata only.
The `lib/index.js` `@module` factory example declared `mgf` via `factory( 10.0 )` but invoked an undefined `mymgf`, which would throw a `ReferenceError` if executed. Rename the call to `mgf` so the declared and invoked identifiers match. This aligns with the factory examples in the sibling packages (7/8 factory-bearing members use `var <name> = factory( ... ); var y = <name>( ... );`). No functional changes; documentation only.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
…te/logpmf/lib/index.js
…te/logpmf/package.json
kgryte
approved these changes
Aug 10, 2026
stats/base/dists/degenerate
kgryte
deleted the
philipp/drift-stats-base-dists-degenerate-2026-08-10
branch
August 10, 2026 20:54
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.
Corrects two documentation/metadata inconsistencies in the
stats/base/dists/degeneratenamespace so that outlier packages match the conventions shared by their siblings.Description
This pull request normalizes summary strings and fixes a broken factory example uncovered by a cross-package consistency audit of the
@stdlib/stats/base/dists/degeneratenamespace (15 members). Two members deviated from namespace conventions; both corrections are mechanical, sibling-derived, and change no observable behavior.Namespace summary
cdf,ctor,entropy,logcdf,logpdf,logpmf,mean,median,mgf,mode,pdf,pmf,quantile,stdev,variance.package.jsonshape and values,manifest.jsonshape, README section structure, JSDoc /@modulesummaries, public signatures, validation prologues, error construction, andrequire()dependencies.@examplevariable convention (7/8 factory-bearing members).@param {number} muprose (three variants, max 8/15) and per-function@returnsdescriptions (function-specific). Left untouched.@stdlib/stats/base/dists/degenerate/logpmfThis package's summary string diverged from the
degeneratenamespace convention, under which every sibling leads with "Degenerate distribution ...";logpmfalone read "Natural logarithm of the probability mass function (PMF) for a degenerate distribution." Thepackage.jsondescriptionand thelib/index.js@modulesummary are normalized to thelogcdf/logpdfform ("Degenerate distribution logarithm of probability mass function (logPMF).") — 14/15 = 93% conformance. Metadata and documentation only; no functional or behavioral change.@stdlib/stats/base/dists/degenerate/mgfThe
lib/index.js@modulefactory@exampledeclared the returned function asmgfviafactory( 10.0 )but then invoked an undefined identifiermymgf, which throws aReferenceErrorif executed. The call is renamed tomgfso the declared and invoked identifiers match, consistent with the factory examples in 7 of 8 factory-bearing sibling packages, which invoke the same identifier they declare (for example,var pdf = factory( 10.0 ); var y = pdf( 10.0 );). Documentation only; no functional change.Validation
Structural features were extracted from the filesystem (file trees,
package.json/manifest.jsonshape, README sections); semantic features (signatures, validation prologues, error construction, JSDoc shape, dependencies) were extracted per package and cross-checked by independent review agents. Each candidate correction passed a three-lens drift validation covering semantic intent, cross-reference against tests and examples, and structural applicability. Deliberately excluded from correction: intentional deviations —ctoris a class constructor and legitimately lacks the C/native layer, andmean/median/modereturnmudirectly so they correctly omit theisnanguard thatvariance/stdev/entropyrequire; features without a ≥75% majority; and any change that would touch tests, REPL fixtures (repl.txt), or generated type declarations (*.d.ts).Related Issues
No.
Questions
No.
Other
Both corrections are documentation/metadata only (
package.jsondescription, alib/index.js@modulesummary, and a JSDoc@example); no source logic, tests, or public signatures are modified. Opened as a draft for maintainer review.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This pull request was authored by Claude Code running an automated cross-package API drift-detection routine. The routine audited the
stats/base/dists/degeneratenamespace via majority vote, validated each candidate correction against sibling conventions, and applied the mechanical fixes. All changes were reviewed for correctness.@stdlib-js/reviewers