Skip to content

docs: add entropy property docs to stats/base/dists/invgamma/ctor - #15598

Merged
kgryte merged 1 commit into
developfrom
philipp/drift-stats-base-dists-invgamma-2026-09-27
Sep 27, 2026
Merged

kgryte merged 1 commit into
developfrom
philipp/drift-stats-base-dists-invgamma-2026-09-27

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request documents a computed property which stats/base/dists/invgamma/ctor exposes but whose README omitted it.

  • Adds a #### InvGamma.prototype.entropy entry to the README's "Computed Properties" section, plus the matching [entropy] link reference definition.

Namespace summary

This change came out of a cross-package consistency audit of the stats/base/dists/invgamma namespace.

  • Members analyzed: 12 (cdf, ctor, entropy, kurtosis, logpdf, mean, mode, pdf, quantile, skewness, stdev, variance); none autogenerated.
  • Features analyzed: 22 — structural (file tree, package.json key set, manifest.json key set, README heading sequence, test/benchmark/examples filenames) and semantic (public signature, return kind, validation prologue, error construction, JSDoc shape, source-level dependencies).
  • Features with a clear majority (≥75%): 15.
  • Features excluded for no clear majority: 7 — JSDoc @returns type (PositiveNumber 6/12), full validation-prologue sequence (largest 3/12), lib/factory.js and its companion tests (4/12), Julia fixture layout (7/12), and the scripts/stdlib package.json keys (absent in all 12).

Across all 15 features with a clear majority, ctor was the only outlier, and in every case the deviation is correct rather than drift: ctor is a pure-JavaScript distribution-object constructor with no native backend. All 34 stats/base/dists/*/ctor packages lack binding.gyp and manifest.json, so the native-addon file set, the gypfile field, the object-API README heading sequence, and the throwing constructor contract are all intentional. None of those became corrections.

stats/base/dists/invgamma/ctor

Adds the missing InvGamma.prototype.entropy entry to the README's "Computed Properties" section and its [entropy] link reference definition, matching the pattern used by sibling ctor READMEs. The accessor itself already exists in lib/main.js and is documented in docs/repl.txt and docs/types/index.d.ts; only the README lacked it. Of the 28 stats/base/dists/*/ctor packages defining an entropy accessor, 27 document it in their README (96% conformance) — invgamma/ctor was the outlier. Documentation only; no source, test, or behavior changes.

Related Issues

Does this pull request have any related issues?

No.

Questions

Any questions for reviewers of this pull request?

The entry is placed first in "Computed Properties" to preserve that section's alphabetical ordering, which is how gamma/ctor, beta/ctor, and lognormal/ctor order theirs. Say so if you would rather it go elsewhere in the section.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Validation

Checked:

  • Structural feature extraction across all 12 members (file trees, package.json/manifest.json key sets, README heading sequences, test/benchmark/example filenames), with package-specific filenames normalized so per-package names did not each read as unique.
  • Semantic feature extraction per package (public signature, return kind, validation prologue, error construction, JSDoc shape, require()-level dependencies).
  • Three-agent review of every candidate correction, covering semantic intent, cross-references to tests and documented API contracts, and structural applicability.
  • The documented value ~1.996 for new InvGamma( 4.0, 12.0 ) matches the example already in invgamma/entropy/README.md for the same arguments, and was recomputed directly against invgamma/entropy.
  • The insertion touches neither the generator-owned ## See Also section nor any other auto-populated region.

Deliberately excluded:

  • Intentional deviations. Every ctor deviation from the 12-member majority traces to its being a pure-JS constructor rather than a scalar function; confirmed against all 34 stats/base/dists/*/ctor packages.
  • Outliers whose tests or documented contracts rely on the deviation. Normalizing ctor's throwing validation or dropping its optional-argument defaults would break test/test.js, docs/types/test.ts, and four documentation surfaces including the parent namespace README.
  • Features without a clear majority, listed above. In particular, guard ordering in the two-argument moment packages splits 6/12 grouped versus 5/12 interleaved; neither reaches 75%, the same split appears in gamma, and reordering would be behaviorally inert, so nothing was changed.
  • gypfile presence across stats/base/dists is 474/569 (83%), below the 90% bar required before treating absence as drift.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of 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

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This PR was written primarily by Claude Code. It ran an automated cross-package consistency audit of the stats/base/dists/invgamma namespace, and the single documentation addition here is the only finding that survived filtering. The added README entry was copied from the template used by sibling ctor packages, and the documented value was recomputed against invgamma/entropy and cross-checked against that package's own README example.


@stdlib-js/reviewers


Generated by Claude Code

Document the `InvGamma.prototype.entropy` computed property, which the
constructor exposes but the README omitted.

Drift items corrected:

- Added a missing `#### InvGamma.prototype.entropy` entry to the README
  "Computed Properties" section. Of the 28 `stats/base/dists/*/ctor`
  packages defining an `entropy` accessor, 27 document it (96%);
  `invgamma` was the sole omission. The accessor is already documented in
  `docs/repl.txt` and `docs/types/index.d.ts`.
- Added the corresponding `[entropy]` link reference definition, placed
  between `[quantile-function]` and `[expected-value]` to match the
  ordering used by sibling `ctor` READMEs.

The documented value matches `invgamma/entropy`'s own README example for
the same arguments. Documentation only; no change to source, tests, or
observable behavior.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015e4mqygYr6qHfirXEFiYja
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label Sep 27, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/invgamma/ctor $\\color{green}408/408$
$\\color{green}+100.00\\%$
$\\color{green}31/31$
$\\color{green}+100.00\\%$
$\\color{green}16/16$
$\\color{green}+100.00\\%$
$\\color{green}408/408$
$\\color{green}+100.00\\%$

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

@kgryte kgryte added the Documentation Improvements, additions, or changes to documentation. label Sep 27, 2026
@kgryte
kgryte marked this pull request as ready for review September 27, 2026 21:56
@kgryte
kgryte requested a review from a team September 27, 2026 21:56
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Sep 27, 2026
@kgryte
kgryte merged commit e172448 into develop Sep 27, 2026
66 checks passed
@kgryte
kgryte deleted the philipp/drift-stats-base-dists-invgamma-2026-09-27 branch September 27, 2026 21:57
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements, additions, or changes to documentation. Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants