Skip to content

docs: move JS examples before C API documentation#12704

Merged
kgryte merged 1 commit into
developfrom
philipp/drift-stats-base-dists-gamma-2026-06-08
Jun 8, 2026
Merged

docs: move JS examples before C API documentation#12704
kgryte merged 1 commit into
developfrom
philipp/drift-stats-base-dists-gamma-2026-06-08

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

Reorders the README in stats/base/dists/gamma/cdf so the JavaScript ## Examples section sits between the JS ## Usage and ## C APIs sections — the layout shared by every other native-addon package in the namespace.

Namespace summary

  • Namespace: @stdlib/stats/base/dists/gamma
  • Members analyzed: 14 (cdf, ctor, entropy, kurtosis, logcdf, logpdf, mean, mgf, mode, pdf, quantile, skewness, stdev, variance)
  • Features extracted: file tree, package.json shape, manifest.json shape, README heading sequence, test//benchmark//examples/ naming, public signature, validation prologue, error construction, JSDoc shape, require-graph dependencies.
  • Features with a clear majority (≥75%): README heading order, factory-style validation prologue, public signatures, JSDoc layout, dependency surface, scripts/keywords composition (per function family).
  • Features without a clear majority (excluded): scalar-prologue isnan usage (5 of 7 omit it, 71% — under threshold).

stats/base/dists/gamma/cdf

The README ordered sections as ## Usage## C APIs## Examples, with the JS example block buried after the C interface. Every other native-addon sibling in the namespace (entropy, kurtosis, logcdf, logpdf, mean, mgf, mode, pdf, skewness, stdev, variance — 11 of 12, 92%) places the JS ## Examples before the ## C APIs separator. The block, its enclosing <section class="examples"> wrapper, and the surrounding * * * separator move as a unit; section content is byte-identical.

Related Issues

None.

Questions

No.

Other

Validation

Structural features were extracted by walking each package's tree and parsing package.json, manifest.json, and README headings. Semantic features (public signatures, validation prologue, error construction, JSDoc shape, require-graph dependencies) were read directly from each package's lib/main.js, lib/factory.js, and lib/index.js. The single advancing candidate was vetted by a structural-review agent (confirmed the entropy-style ordering as the correct target and the block move as content-preserving) and a cross-reference agent (confirmed no anchor links, no test/benchmark code, no umbrella-namespace tooling, and no markdown-lint rule depends on the current ordering).

Deliberately excluded:

  • ctor, quantile lacking gypfile/binding.gyp/src//include//manifest.json — intentional: ctor is a constructor with no native math kernel, quantile is awaiting the in-flight math/base/special/gammaincinv C implementation (PR feat: add C implementation for math/base/special/gammaincinv #9982). Per gate "Ecosystem-wide intentional absence."
  • pdf/LICENSE (only gamma member with a per-package LICENSE file) — direction of fix would be removal, but per-package LICENSEs appear in <2% of stdlib; without git-blame intent the safe call is to log and defer to a maintainer.
  • mgf package.json missing probability keyword (13/14 of gamma siblings have it) — but only 2 of 22 MGF packages across stats/base/dists (9% stdlib-wide) carry it, so the namespace-local majority reflects the local minority, not drift. Gate "Ecosystem-wide intentional absence" applies.
  • Scalar-prologue isnan usage — 5 of 7 scalar functions (entropy, mean, mode, stdev, variance) omit explicit isnan checks; 2 (kurtosis, skewness) include them. 71% conformance is below the 75% threshold, no clear majority.

PR #12677 (open draft) touches gamma/mgf/lib/factory.js only for wording propagation — no overlap with this diff.

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 the cross-package drift-detection routine. Structural and semantic features were extracted programmatically across the namespace; the single advancing candidate was independently vetted by a structural-review agent and a cross-reference agent before the section reorder was applied. A human maintainer should verify the diff before promoting this PR out of draft.


@stdlib-js/reviewers


Generated by Claude Code

Reorders the README to place the JavaScript `## Examples` section
between the JS `## Usage` and `## C APIs` sections, matching the
layout used by the other 11 native-addon packages in
`stats/base/dists/gamma` (92% conformance: entropy, kurtosis, logcdf,
logpdf, mean, mgf, mode, pdf, skewness, stdev, variance). Section
content is unchanged; only the block position and an interior `* * *`
separator move.
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label Jun 8, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/gamma/cdf $\color{green}314/314$
$\color{green}+100.00\%$
$\color{green}33/33$
$\color{green}+100.00\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{green}314/314$
$\color{green}+100.00\%$

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

@Planeshifter Planeshifter marked this pull request as ready for review June 8, 2026 20:06
@Planeshifter Planeshifter requested review from a team and kgryte June 8, 2026 20:06
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Jun 8, 2026
@kgryte kgryte added Documentation Improvements, additions, or changes to documentation. and removed Needs Review A pull request which needs code review. labels Jun 8, 2026
@kgryte kgryte changed the title docs: move JS examples before C APIs in stats/base/dists/gamma/cdf docs: move JS examples before C API documentation Jun 8, 2026
@kgryte kgryte merged commit 21d7848 into develop Jun 8, 2026
71 checks passed
@kgryte kgryte deleted the philipp/drift-stats-base-dists-gamma-2026-06-08 branch June 8, 2026 20:46
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