Skip to content

docs: update descriptions - #15593

Merged
kgryte merged 3 commits into
developfrom
claude/trusting-hamilton-9l8kj4
Sep 27, 2026
Merged

kgryte merged 3 commits into
developfrom
claude/trusting-hamilton-9l8kj4

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request normalizes the NaN notation and summary-line punctuation in three @stdlib/stats/incr packages whose documentation had drifted from the convention used by the rest of the namespace.

Namespace summary

  • Members analyzed: 163 (lib/node_modules/@stdlib/stats/incr/*); none autogenerated.
  • Features analyzed: 15 — file tree, package.json top-level keys, package.json scripts keys, package.json stdlib keys, manifest.json shape, test/ naming, benchmark/ naming, examples/ naming, README heading set, README heading order, public signature, return kind, validation prologue, error construction, and JSDoc shape (param/returns/throws/example tags).
  • Features with a clear majority (≥75%): 13. Twelve are at 100% conformance and yielded no outliers at all — notably, format is already used for 62/62 (100%) of members that construct an error, so no error-construction normalization was needed. README heading set was the only majority feature with outliers.
  • Features without a clear majority (excluded): 2 — publicSignature (largest cohort 59/163 = 36.2%) and validationPrologue. Both vary legitimately: the namespace deliberately mixes zero-argument, window-size, mean-hint, and output-array accumulator shapes.

stats/incr is unusually well-kept. Of the seven candidate corrections that survived majority voting, four were dropped during validation, leaving three.

@stdlib/stats/incr/nancv

Normalizes the nancv README summary to match the package's own docstrings and the 95.8% convention across stats/incr. 'NaN' in ASCII single quotes was the only single-quoted occurrence of NaN in namespace prose; 69/72 nan* members of stats/incr (95.8%) backtick it. Also replaces "while ignoring" with the comma form ", ignoring", again matching 69/72 (95.8%), and bringing the README in line with nancv's own lib/main.js, lib/index.js, docs/repl.txt, and docs/types/index.d.ts, which already used the correct phrasing — the README was the package's sole deviating surface.

@stdlib/stats/incr/nanmmaxabs

Adds the missing comma before "ignoring" in the README description, matching the pattern used by 69 of the 72 nan* members of stats/incr (95.8%), which read "incrementally, ignoring NaN values." The package's own package.json description already carries the comma, as do the behaviorally identical siblings nanmmax, nanmmin, and nanmminabs. The JSDoc summary in lib/main.js carries a separate, larger deviation ("while ignoring NaN values") replicated across lib/index.js, docs/repl.txt, and docs/types/index.d.ts; that is left untouched here and warrants one coordinated pass.

@stdlib/stats/incr/nansumprod

Backticks NaN in the lib/main.js JSDoc summary to match the rest of the package. 69 of 72 nan* accumulators in @stdlib/stats/incr (95.8%) already backtick NaN in their summary line, and every other documentation surface in this package — README.md, lib/index.js, docs/repl.txt, docs/types/index.d.ts — already does so; lib/main.js was the sole holdout. Strictly reduces intra-package inconsistency; introduces none.

Related Issues

Does this pull request have any related issues?

None.

Questions

Any questions for reviewers of this pull request?

Yes — one, on the drift that was deliberately not fixed here.

nanmmaxabs, nanmstdev, and nanmvmr each replicate the same deviating summary sentence across five surfaces: README.md, lib/main.js, lib/index.js, docs/repl.txt, and docs/types/index.d.ts. In those three packages lib/main.js currently agrees with docs/repl.txt and docs/types/index.d.ts, so editing lib/main.js alone would trade an existing README-vs-JSDoc mismatch for a new JSDoc-vs-declaration mismatch. nanmstdev is the worst case: the namespace TOC entry at lib/node_modules/@stdlib/stats/incr/README.md:121 is generated from its README summary line by _tools/markdown/namespace-toc, and lib/node_modules/@stdlib/stats/incr/docs/types/index.d.ts:2419 mirrors the unbackticked form, so a correct fix also requires regenerating the TOC (make markdown-namespace-tocs).

Should that five-surface pass be folded into this pull request, or handled separately?

Other

Any other information relevant to this pull request?

Validation

Every correction was checked as follows before being applied:

  • Structural extraction — file tree, package.json key sets, README heading sequences, and test/benchmark/examples file naming, over all 163 members.
  • Semantic extraction — public signature, return kind, validation prologue, error construction, JSDoc tag shape, and require()-derived dependencies, over all 163 members.
  • Three-agent drift validation — an independent semantic review (does the deviation reflect a genuine difference in what the package computes?), a cross-reference review (do tests, benchmarks, examples, type tests, or repo tooling depend on the deviating text?), and a structural review (is the majority pattern the thing that should actually be applied?).
  • No test, benchmark, example, type test, or _tools fixture references any of the changed text. remark-lint-expected-html-sections treats the notes section as optional, and stdlib/jsdoc-maximum-line-length is configured off, so neither changed line carries lint risk.
  • nansumprod/lib/main.js was re-parsed with node --check and exercised at runtime after editing (2*3 + 1*5 = 11 with the NaN pair correctly skipped).

Deliberately excluded

  • Intentional deviations. stats/incr/count lacks the ## Notes section present in 158/163 members (96.9%), but incrcount's accumulator never reads its argument — it increments on arguments.length alone — so the majority bullet's warning that a NaN input poisons all future values would be factually false there. Two independent reviews reached this conclusion separately.
  • Outliers needing a coordinated pass. The lib/main.js JSDoc corrections for nanmmaxabs, nanmvmr, and nanmstdev, and the nanmstdev README correction — see Questions above.
  • Outliers whose fix is not mechanical. nancount and nancovariance are also missing ## Notes. Content exists to lift, but only 51 of 160 ## Notes sections in the namespace consist of the standard bullet alone; the other 109 carry package-specific prose. nancovariance's README additionally deviates in ways outside this analysis (#### incrnancovariance with no signature, #### accumulator(`[x, y]`) instead of #### accumulator( \[x, y] ), unbackticked NaN in the Usage prose), which wants one scoped README pass rather than a drive-by section add.
  • Features without a clear majority. publicSignature and validationPrologue, per the namespace summary above.
  • Generator-owned surfaces. docs/repl.txt, docs/types/index.d.ts, README ## See Also blocks, and the commented-out equation <div> blocks were treated as out of scope.
  • Already in flight. Two findings were dropped as duplicates of open work: the ## Notes gap in covmat and pcorrmat (both carry an empty <section class="notes"> with no heading) is proposed by docs: add NaN notes to stats/incr/covmat and stats/incr/pcorrmat #12693, and the backticked-NaN package.json descriptions in nanmmda and nanmmpe are corrected by chore: address review findings in new stats/incr/nan* packages #13602.
  • Not a fix we would make. nanmmaxabs is the only one of the 19 nanm*( W ) delegating accumulators that re-validates W itself; the other 18 (94.7%) rely on the delegate to throw. Conforming would mean removing a validation check, which is behavior-adjacent, so it was left alone.

A note on @throws without throw

44 nan* packages document @throws while containing no throw statement. This is not drift and was not flagged: each delegates construction to its non-nan sibling (e.g. incrnanmmean( W ) calls incrmmean( W )), so the documented error is genuinely thrown and propagates.

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

This pull request was authored by Claude Code running an automated cross-package drift-detection routine. The routine extracted structural and semantic features from all 163 stats/incr packages, computed the majority pattern per feature at a 75% threshold, and flagged deviating packages. Candidate corrections were then reviewed by three independent agents; four of seven candidates were rejected at that stage and are documented under "Deliberately excluded" above. The three changes that remain are one-line documentation edits. Reviewers should scrutinize the conformance percentages and the judgement that each deviation is unintentional rather than meaningful; the underlying measurements are reproducible from the namespace itself.


🤖 Generated with Claude Code

https://claude.ai/code/session_01FFCQ8XaJ5NUDv9oDpHF2Vj


Generated by Claude Code

The package summary was the only place in the `stats/incr` namespace where
`NaN` appeared in ASCII single quotes rather than backticks, and one of two
`nan*` summaries phrased as "while ignoring" rather than ", ignoring". 69 of
the 72 `nan*` members (95.8%) end their summary with ", ignoring `NaN`
values." and `nancv`'s own `lib/main.js`, `lib/index.js`, `docs/repl.txt` and
`docs/types/index.d.ts` already use that wording, so the README was the sole
deviating surface in the package.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FFCQ8XaJ5NUDv9oDpHF2Vj
The package summary read "incrementally ignoring `NaN` values" where 69 of the
72 `nan*` members (95.8%) read "incrementally, ignoring `NaN` values". The
package's own `package.json` description already carries the comma, as do the
behaviourally identical siblings `nanmmax`, `nanmmin` and `nanmminabs`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FFCQ8XaJ5NUDv9oDpHF2Vj
The JSDoc summary in `lib/main.js` wrote `NaN` unquoted, making it the only
documentation surface in the package to do so: `README.md`, `lib/index.js`,
`docs/repl.txt` and `docs/types/index.d.ts` all already backtick it. 69 of the
72 `nan*` members (95.8%) backtick `NaN` in their JSDoc summary, so this brings
the file in line with both its siblings and the rest of its own package.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FFCQ8XaJ5NUDv9oDpHF2Vj
@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/incr/nancv $\\color{green}141/141$
$\\color{green}+100.00\\%$
$\\color{green}11/11$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}141/141$
$\\color{green}+100.00\\%$
stats/incr/nanmmaxabs $\\color{green}148/148$
$\\color{green}+100.00\\%$
$\\color{green}9/9$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}148/148$
$\\color{green}+100.00\\%$
stats/incr/nansumprod $\\color{green}135/135$
$\\color{green}+100.00\\%$
$\\color{green}8/8$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}135/135$
$\\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:58
@kgryte
kgryte requested a review from a team September 27, 2026 21:58
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Sep 27, 2026
@kgryte kgryte changed the title docs: fix NaN notation and a missing comma in stats/incr summary lines docs: update descriptions Sep 27, 2026
@kgryte
kgryte merged commit d29a172 into develop Sep 27, 2026
68 checks passed
@kgryte
kgryte deleted the claude/trusting-hamilton-9l8kj4 branch September 27, 2026 21:59
@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