Skip to content

docs: add examples - #16029

Merged
kgryte merged 7 commits into
developfrom
claude/cool-johnson-eung99
Oct 11, 2026
Merged

kgryte merged 7 commits into
developfrom
claude/cool-johnson-eung99

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • adds benchmarks to @stdlib/stats/kde2d and adds missing main-function JSDoc examples to four @stdlib/stats packages, bringing each outlier in line with its siblings.

@stdlib/stats/kde2d

Only non-namespace stats package without benchmarks. Adds benchmark/benchmark.js (present in 56/57 siblings, 98%), covering the default call and the n option, and the matching directories.benchmark entry in package.json (98%). Benchmark structure follows stats/lowess.

@stdlib/stats/anova1

Main function JSDoc in lib/main.js lacked an @example (present in 52/57 siblings, 91%). Example taken from lib/index.js, with the multi-line /* returns */ block collapsed to // returns {...}.

@stdlib/stats/binomial-test

Main function JSDoc in lib/main.js lacked an @example (91% of siblings). Adds both examples from lib/index.js: default call and custom p/alpha options.

@stdlib/stats/ttest2

Main function JSDoc in lib/main.js lacked an @example (91% of siblings). Uses the Student's sleep data from the README rather than the incrspace-based module example, so the example is self-contained.

@stdlib/stats/ztest2

Main function JSDoc in lib/main.js lacked an @example (91% of siblings). Example taken verbatim from lib/index.js, minus the require line.

Related Issues

Does this pull request have any related issues?

None.

Questions

Any questions for reviewers of this pull request?

No.

Other

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

Namespace summary. @stdlib/stats has 62 direct child packages; the 5 namespace aggregators (array, base, incr, iter, strided) were excluded, leaving 57 voting members (majority threshold: 43, or 75%). Analyzed features: file tree, package.json key sets (top-level, scripts, directories), README ##/### sections, manifest.json keys, test/benchmark/example file names, public signature, return kind, validation prologue, error construction, JSDoc shape, and @stdlib dependencies. Features with a clear majority: file tree, package.json keys, README ## Usage/## Examples, return kind, JSDoc @returns/@throws/param descriptions, and JSDoc @example. Features without a clear majority, excluded: README ## Notes (70%), test.assign.js/benchmark.assign.js (65%, ndarray reductions only), error construction (format 46%, plain-string 49%, mixed 5%), and public signature (11 distinct shapes).

Validation. Structural features were extracted from the filesystem. Semantic features were extracted from lib/main.js, lib/index.js and lib/validate.js by agents. Each candidate was then checked by three separate agent reviews: semantic intent, cross-referencing tests, examples and docs, and structural applicability. Before review, benchmark presence was confirmed stdlib-wide (92% of packages with a lib/main.js). Excluded: package-specific implementation files, and stats/lowess. Its main function is declared as main, so a lowess( ... ) example with a // returns annotation would fail stdlib/jsdoc-doctest; that one needs a maintainer decision. Smoke-tested locally: the kde2d benchmark (via a harness shim, since node_modules is not installed) and every added example call.

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 as part of an automated cross-package API drift detection run (majority vote across @stdlib/stats packages).


🤖 Generated with Claude Code

https://claude.ai/code/session_01LMYQtSzimuL2KBLtWEqocz


Generated by Claude Code

Added missing `benchmark/benchmark.js` (present in 56 of 57 `@stdlib/stats` siblings, 98%) and the corresponding `directories.benchmark` entry in `package.json` (98% of siblings).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LMYQtSzimuL2KBLtWEqocz
Added missing `@example` to the main function JSDoc in `lib/main.js` (present in 52 of 57 `@stdlib/stats` siblings, 91%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LMYQtSzimuL2KBLtWEqocz
Added missing `@example` to the main function JSDoc in `lib/main.js` (present in 52 of 57 `@stdlib/stats` siblings, 91%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LMYQtSzimuL2KBLtWEqocz
Added missing `@example` to the main function JSDoc in `lib/main.js` (present in 52 of 57 `@stdlib/stats` siblings, 91%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LMYQtSzimuL2KBLtWEqocz
Added missing `@example` to the main function JSDoc in `lib/main.js` (present in 52 of 57 `@stdlib/stats` siblings, 91%).

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

stdlib-bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/anova1 $\\color{red}739/752$
$\\color{green}+0.00\\%$
$\\color{red}61/65$
$\\color{green}+0.00\\%$
$\\color{green}10/10$
$\\color{green}+0.00\\%$
$\\color{red}739/752$
$\\color{green}+0.00\\%$
stats/binomial-test $\\color{red}433/447$
$\\color{green}+0.00\\%$
$\\color{red}73/79$
$\\color{green}+0.00\\%$
$\\color{green}5/5$
$\\color{green}+0.00\\%$
$\\color{red}433/447$
$\\color{green}+0.00\\%$
stats/ttest2 $\\color{green}423/423$
$\\color{green}+0.00\\%$
$\\color{green}71/71$
$\\color{green}+0.00\\%$
$\\color{green}3/3$
$\\color{green}+0.00\\%$
$\\color{green}423/423$
$\\color{green}+0.00\\%$
stats/ztest2 $\\color{green}400/400$
$\\color{green}+0.00\\%$
$\\color{green}61/61$
$\\color{green}+0.00\\%$
$\\color{green}3/3$
$\\color{green}+0.00\\%$
$\\color{green}400/400$
$\\color{green}+0.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 Oct 11, 2026
@kgryte
kgryte marked this pull request as ready for review October 11, 2026 12:33
@kgryte
kgryte requested a review from a team October 11, 2026 12:33
@kgryte kgryte changed the title docs: add missing JSDoc examples in stats packages and benchmarks for stats/kde2d docs: add missing JSDoc examples in stats packages Oct 11, 2026
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Oct 11, 2026
@kgryte kgryte changed the title docs: add missing JSDoc examples in stats packages docs: add examples Oct 11, 2026
@kgryte
kgryte merged commit f998def into develop Oct 11, 2026
32 checks passed
@kgryte
kgryte deleted the claude/cool-johnson-eung99 branch October 11, 2026 12:46
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Oct 11, 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