Skip to content

docs: replace "array" with "ndarray" in ndarray/* type declarations#12828

Draft
Planeshifter wants to merge 1 commit into
developfrom
philipp/fix-propagation-2026-06-11
Draft

docs: replace "array" with "ndarray" in ndarray/* type declarations#12828
Planeshifter wants to merge 1 commit into
developfrom
philipp/fix-propagation-2026-06-11

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

Propagating fixes merged to develop between 8477cf466 (2026-06-10 22:43 -0700) and 6b79aece2 (2026-06-10 23:39 -0700) to sibling packages with the same underlying defect.

Pattern: replace array with ndarray in *-filled JSDoc descriptions

Source commit 8477cf466 corrected Creates a null-filled array having ... to Creates a null-filled ndarray having ..., plus the matching @returns null-filled array@returns null-filled ndarray, in ndarray/base/nulls-like/docs/types/index.d.ts. The identical defect — an ndarray-returning function described in .d.ts JSDoc as creating or returning an "array" — exists across 17 sibling docs/types/index.d.ts files spanning the zeros, ones, nans, nulls, falses, trues, and their -like variants under ndarray/ and ndarray/base/, plus the two umbrella declaration files. The per-package README and lib/main.js already use "ndarray"; the .d.ts was the outlier in each case. 223 substitutions: 94 description lines and 129 @returns lines.

  • 8477cf466 (docs: fix descriptions in \ndarray/base/nulls-like``)
    • @stdlib/ndarray/zeros-like
    • @stdlib/ndarray/ones-like
    • @stdlib/ndarray/nans-like
    • @stdlib/ndarray/zeros
    • @stdlib/ndarray/ones
    • @stdlib/ndarray/nans
    • @stdlib/ndarray (umbrella docs/types/index.d.ts)
    • @stdlib/ndarray/base/zeros-like
    • @stdlib/ndarray/base/ones-like
    • @stdlib/ndarray/base/nans-like
    • @stdlib/ndarray/base/zeros
    • @stdlib/ndarray/base/ones
    • @stdlib/ndarray/base/nans
    • @stdlib/ndarray/base/nulls
    • @stdlib/ndarray/base/falses
    • @stdlib/ndarray/base/trues
    • @stdlib/ndarray/base (umbrella docs/types/index.d.ts)

Related Issues

None.

Questions

No.

Other

Validation

  • Search scope: all lib/node_modules/@stdlib/ndarray/{,base/}**/docs/types/index.d.ts files matching ^\s*\* Creates an? \S+-filled array having (description form) or ^\s*\* @returns \S+-filled array$ (return form). 19 files matched; 2 excluded (see below).
  • Two independent opus validation passes confirmed, at each of the 17 candidate sites: (a) the surrounding declare function ...(...): *ndarray signature returns an ndarray, (b) the per-package README.md and lib/main.js already use "ndarray" in the equivalent description (the .d.ts was the outlier), (c) no auto-generated marker is present, (d) no legitimate array reference (@param x - input array, @param shape - array shape, // returns <Float32Array>) was touched.
  • Style consistency is preserved by construction: the two regex anchors guarantee identical text substitution (arrayndarray) with no surrounding rewrites.

Deliberately excluded:

  • ndarray/empty/docs/types/index.d.ts:582 and ndarray/base/empty/docs/types/index.d.ts:266 each contain a single Creates a zero-filled array having a specified shape and data type. line for the dtype: 'generic' overload of empty. The line is a copy-paste defect distinct from the source pattern (empty is documented as creating uninitialized memory, so "zero-filled" itself is questionable). The second validation pass flagged these as needs-human; dropped per the routine.
  • ndarray/{empty,empty-like}/docs/types/index.d.ts and the base/ counterparts have many Creates an uninitialized [typed] array having ... and @returns output array lines. The defect class is the same (function returns ndarray, doc says "array"), but the source commit's mechanical signature is \S+-filled array, not uninitialized [...] array or output array. A follow-up source commit in the empty* namespace establishing the canonical phrasing would unlock these on a future run.
  • blas/base/{dtrmv,strmv,dtrsv,strsv} siblings of the *gemv isMatrixTransposeresolveTrans refactor (2c69cdd44): these packages use the canonical isTransposeOperation (not the alias) and have no .native.js variants, so the source pattern's "swap separate validate+resolve for combined resolveTrans + null check before the native addon call" does not apply.
  • The // note:// NOTE: comment-style cleanup hinted at by 4dd901bb3 (206 occurrences across 71 files) — volume is unsuited to this routine's per-window cadence; better as a dedicated lint sweep.
  • The four test: ULP-migration commits (6b79aece2, 8117e16e8, 595660167, ba00d5ef5): tracked via issue [RFC]: Migrate math/base/special packages from relative tolerance testing to ULP difference testing (tracking issue) #11352 with maintainer-paced per-package PRs; bulk propagation would conflict with that workflow.
  • Generator-owned related-packages metadata (4b35470b5) and the previous-day propagation commit (cae533579).

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 on behalf of @Planeshifter as an automated propagation of fixes merged to develop over the prior 24 hours. Candidate source commits were filtered for generalisable patterns, sibling sites located via grep-able pattern signatures, and each proposed patch independently validated by parallel reviewer agents (two opus validation passes plus a style-consistency check) before commits were applied in the primary worktree. A human will audit and promote the PR out of draft.


@stdlib-js/reviewers


Generated by Claude Code

Propagates fix from 8477cf4 ("docs: fix descriptions in
`ndarray/base/nulls-like`") to sibling packages whose `docs/types/index.d.ts`
files describe ndarray-returning functions as creating an "array".
@stdlib-bot stdlib-bot added the Good First PR A pull request resolving a Good First Issue. label Jun 11, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
ndarray/base $\\color{red}177377/348159$
$\\color{green}+50.95\\%$
$\\color{red}1928/1957$
$\\color{green}+98.52\\%$
$\\color{red}20/1722$
$\\color{green}+1.16\\%$
$\\color{red}177377/348159$
$\\color{green}+50.95\\%$
ndarray/base/falses $\\color{green}98/98$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}98/98$
$\\color{green}+100.00\\%$
ndarray/base/nans-like $\\color{green}121/121$
$\\color{green}+100.00\\%$
$\\color{green}5/5$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}121/121$
$\\color{green}+100.00\\%$
ndarray/base/nans $\\color{green}103/103$
$\\color{green}+100.00\\%$
$\\color{green}5/5$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}103/103$
$\\color{green}+100.00\\%$
ndarray/base/nulls $\\color{green}98/98$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}98/98$
$\\color{green}+100.00\\%$
ndarray/base/ones-like $\\color{green}111/111$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}111/111$
$\\color{green}+100.00\\%$
ndarray/base/ones $\\color{green}106/106$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}106/106$
$\\color{green}+100.00\\%$
ndarray/base/trues $\\color{green}98/98$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}98/98$
$\\color{green}+100.00\\%$
ndarray/base/zeros-like $\\color{green}142/142$
$\\color{green}+100.00\\%$
$\\color{green}8/8$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}142/142$
$\\color{green}+100.00\\%$
ndarray/base/zeros $\\color{green}127/127$
$\\color{green}+100.00\\%$
$\\color{green}7/7$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}127/127$
$\\color{green}+100.00\\%$
ndarray $\\color{red}209053/390424$
$\\color{green}+53.55\\%$
$\\color{red}2412/2452$
$\\color{green}+98.37\\%$
$\\color{red}48/2040$
$\\color{green}+2.35\\%$
$\\color{red}209053/390424$
$\\color{green}+53.55\\%$
ndarray/nans-like $\\color{red}225/227$
$\\color{green}+99.12\\%$
$\\color{red}38/39$
$\\color{green}+97.44\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{red}225/227$
$\\color{green}+99.12\\%$
ndarray/nans $\\color{green}207/207$
$\\color{green}+100.00\\%$
$\\color{green}32/32$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}207/207$
$\\color{green}+100.00\\%$
ndarray/ones-like $\\color{red}217/219$
$\\color{green}+99.09\\%$
$\\color{red}34/35$
$\\color{green}+97.14\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{red}217/219$
$\\color{green}+99.09\\%$
ndarray/ones $\\color{green}122/122$
$\\color{green}+100.00\\%$
$\\color{green}5/5$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}122/122$
$\\color{green}+100.00\\%$
ndarray/zeros-like $\\color{red}213/215$
$\\color{green}+99.07\\%$
$\\color{red}34/35$
$\\color{green}+97.14\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{red}213/215$
$\\color{green}+99.07\\%$
ndarray/zeros $\\color{green}195/195$
$\\color{green}+100.00\\%$
$\\color{green}29/29$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}195/195$
$\\color{green}+100.00\\%$

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Good First PR A pull request resolving a Good First Issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants