refactor: align ndarray/base/diagonal error message and remove namespace self-refs#12096
Merged
Conversation
Propagates the wording change from 25ae5aa ("refactor: update error message") to `ndarray/base/diagonal`, the only remaining `ndarray/base` package whose `ndims < 2` `RangeError` still uses the pre-standardized phrasing ("First argument must be an ndarray having at least two dimensions") in both the runtime throw and the `@throws` JSDoc tag.
Propagates the cleanup from b8d09ca ("chore: follow-up corrections for commits merged to develop on 2026-05-10") to four sibling namespace blocks where the entry's `'path'` value was also listed verbatim in its own `'related'` array. Affected blocks: `asech` in `base/a.js`, `dmskdeg2rad` in `base/strided/d.js`, `unary` in `base/strided/u.js`, and `iterDivide` in `i.js`.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
reviewed
May 11, 2026
kgryte
reviewed
May 11, 2026
kgryte
reviewed
May 11, 2026
kgryte
reviewed
May 11, 2026
Co-authored-by: Athan <kgryte@gmail.com> Signed-off-by: Athan <kgryte@gmail.com>
kgryte
reviewed
May 11, 2026
Co-authored-by: Athan <kgryte@gmail.com> Signed-off-by: Athan <kgryte@gmail.com>
kgryte
approved these changes
May 11, 2026
ndarray/base/diagonal and clean namespace self-refsndarray/base/diagonal error message and remove namespace self-refs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Propagating fixes merged to
developbetween 2026-05-10 14:17 PDT and 2026-05-11 02:26 PDT to sibling packages with the same defect.25ae5aa— alignndarray/base/diagonalndims < 2error message withndarray/transposeFollows 25ae5aa, which standardised the
ndims < 2RangeErrormessage inndarray/transposeto read'invalid argument. Must provide an ndarray having two or more dimensions. Number of dimensions: \%u`.'and updated the corresponding@throwsJSDoc accordingly. Applies the same pattern to@stdlib/ndarray/base/diagonal, where both the thrown message and the@throwstag still carried the pre-standardised phrasing. The four iterator packages (ndarray/iter/{rows,columns,row-entries,column-entries}) were reviewed and excluded, as theirndims < 2guards throw aTypeErrorwithoutformat()` and follow a distinct phrasing convention.lib/node_modules/@stdlib/ndarray/base/diagonalb8d09ca— remove self-references fromnamespace'related'arraysFollows up b8d09ca, which removed self-referential entries from
'related'arrays inrandom/main.jswhere a block's own'path'value appeared verbatim among its cross-links. The same defect exists in four additional namespace files; this commit removes the offending entries. A fifth candidate (usStatesNamesCapitalsinu.js) was held back because the self-reference is the trailing array element, requiring a comma fix on the preceding line in addition to the deletion.Affected blocks:
base.asechinlib/node_modules/@stdlib/namespace/lib/namespace/base/a.jsbase.strided.dmskdeg2radinlib/node_modules/@stdlib/namespace/lib/namespace/base/strided/d.jsbase.strided.unaryinlib/node_modules/@stdlib/namespace/lib/namespace/base/strided/u.jsiterDivideinlib/node_modules/@stdlib/namespace/lib/namespace/i.jsRelated Issues
None.
Questions
No.
Other
Validation
What was checked:
ndarray/base/**andndarray/iter/**for thendims < 2error wording;lib/node_modules/@stdlib/namespace/lib/namespace/**for self-referential'related'array entries (excluding derivedalias2related//pkg2related/data files).confirmedfor the five propagated sites.format()retention,Error-class preservation, and the trailing-comma audit for the'related'array deletions.Deliberately excluded:
ndarray/iter/{rows,columns,row-entries,column-entries}candidates for Pattern 3 — one validator marked theserejectedbecause they throw aTypeErrorwithoutformat()against a different phrasing convention ('First argument must be an ndarray ...'), so the source commit's shape does not apply.usStatesNamesCapitalsinlib/node_modules/@stdlib/namespace/lib/namespace/u.js— self-reference is the last entry in its'related'array; removal also requires stripping a trailing comma from the preceding line, flaggedneeds-humanby one validator.8ad7ea2f("fix: update stride validation error messages") — runtime throws were already covered by PR fix: update stride validation error messages #11998 (merged 2026-05-10); a JSDoc-only propagation across 42 BLAS sites would exceed the source commit's mechanical scope, which touched only runtime throws.a6af2c8b("bench: replacenew Array(100)withzeros(100, 'generic')inassert/is-*-propertybenchmarks") — recent-merge dedup applies. PR bench: replacenew Array(100)withzeros(100, 'generic')inassert/is-*-propertybenchmarks #12010, merged 2026-05-10, was itself the propagation PR for this pattern and explicitly enumerated 88 rejected candidate sites.b8d09casub-patterns 4b (buffer:→data:rename in ndarray descriptor docs) and 4c (// buf =>→// returnsinscalar2ndarrayd.ts doctests) — zero remaining candidate sites; the source commit itself already covered the only instances.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code as part of a routine that scans the previous 24 hours of
developcommits for generalisable fixes and propagates them to sibling packages. Candidate sites were independently verified by two Opus validation agents and a third Opus adaptation agent, then audited by a Sonnet style-consistency agent before any edits were applied. Each change is a direct analog of the cited source commit's transformation, restricted to the source commit's mechanical scope.@stdlib-js/reviewers
Generated by Claude Code