Skip to content

docs: add examples and keywords - #16152

Merged
kgryte merged 3 commits into
developfrom
claude/cool-johnson-mru2y3
Oct 14, 2026
Merged

kgryte merged 3 commits into
developfrom
claude/cool-johnson-mru2y3

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • adds missing C @example blocks and populates an empty keywords array, bringing three math/base/special packages in line with near-universal namespace conventions.

math/base/special/ellipj

Populates the empty keywords array in package.json with the namespace prefix (stdlib, stdmath, mathematics, math) used by 382/383 (99.7%) siblings, followed by package-specific terms in the ellipk/ellipe style (special, elliptic, jacobi, sn, cn, dn, am, amplitude, number). ellipj was the only package in lib/node_modules/@stdlib with an empty keywords array.

math/base/special/log2

Adds an @example block to the stdlib_base_log2 doc comment in src/main.c, mirroring the README C usage (stdlib_base_log2( 4.0 ) returns 2.0). Present in 374/376 (99.5%) native siblings.

math/base/special/sincosdf

Adds an @example block to the stdlib_base_sincosdf doc comment in src/main.c, mirroring sincosf and sincosd. Present in 374/376 (99.5%) native siblings.

Related Issues

Does this pull request have any related issues?

No.

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. math/base/special has 383 member packages; fast is a sub-namespace and was excluded. About 90 structural and semantic features were analyzed: file tree, package.json/manifest.json keys, README section sets, the JSDoc shape of lib/{index,main,native}.js, the C doc comments in src/main.c, and the benchmark/example/test idioms. Nearly all features had a clear majority (≥75%). Two features had no clear majority and were excluded: @stdlib/string/format in benchmark/benchmark.js (73.9%) and @stdlib/random/array in examples/index.js (74.9%).

Validation. Corrections passed three independent reviews: semantic (source and README read in full), cross-reference (no test, example or tooling depends on the current state) and structural applicability. The following were deliberately excluded:

  • Intentional deviations: Math.* aliases (ceil, floor, round, sqrt, ...) whose JSDoc sits on a variable rather than a function; void out-parameter C functions lacking @return; variadic *n packages and sici, which have no native addon.
  • Packages with an open PR that could collide (cfloor, cceilf).
  • The in-progress @stdlib/random/array benchmark migration, which changes benchmark behavior.

The diff changes only doc comments and metadata. It does not change behavior.

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 drift analysis (majority vote across namespace siblings).


🤖 Generated with Claude Code

https://claude.ai/code/session_01PrXnrxd4fshM1EZC9BNFTJ


Generated by Claude Code

Populated the empty `keywords` array in `package.json` with the namespace prefix shared by 382/383 (99.7%) siblings ("stdlib", "stdmath", "mathematics", "math") and package-specific terms following the `ellipk`/`ellipe` convention. `ellipj` was the only package in `lib/node_modules/@stdlib` with an empty `keywords` array.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PrXnrxd4fshM1EZC9BNFTJ
Added an `@example` block to the `stdlib_base_log2` doc comment in `src/main.c`, mirroring the README C usage. Present in 374/376 (99.5%) native siblings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PrXnrxd4fshM1EZC9BNFTJ
Added an `@example` block to the `stdlib_base_sincosdf` doc comment in `src/main.c`, mirroring `sincosf` and `sincosd`. Present in 374/376 (99.5%) native siblings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PrXnrxd4fshM1EZC9BNFTJ
@stdlib-bot stdlib-bot added the Math Issue or pull request specific to math functionality. label Oct 14, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
math/base/special/ellipj $\\color{red}701/713$
$\\color{green}+98.32\\%$
$\\color{red}32/34$
$\\color{green}+94.12\\%$
$\\color{green}7/7$
$\\color{green}+100.00\\%$
$\\color{red}701/713$
$\\color{green}+98.32\\%$
math/base/special/log2 $\\color{green}290/290$
$\\color{green}+100.00\\%$
$\\color{green}16/16$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}290/290$
$\\color{green}+100.00\\%$
math/base/special/sincosdf $\\color{green}252/252$
$\\color{green}+100.00\\%$
$\\color{green}7/7$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}252/252$
$\\color{green}+100.00\\%$

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

@kgryte
kgryte marked this pull request as ready for review October 14, 2026 18:30
@kgryte
kgryte requested a review from a team October 14, 2026 18:30
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Oct 14, 2026
@kgryte kgryte changed the title docs: add missing C @example blocks and ellipj keywords in math/base/special docs: add examples and keywords Oct 14, 2026
@kgryte
kgryte merged commit cb57c9e into develop Oct 14, 2026
51 checks passed
@kgryte
kgryte deleted the claude/cool-johnson-mru2y3 branch October 14, 2026 18:32
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Math Issue or pull request specific to math functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants