Skip to content

docs: fix examples to use supported dtypes#13392

Merged
kgryte merged 2 commits into
developfrom
philipp/ci-fix-ones-like-example-dtypes-2026-07-09
Jul 9, 2026
Merged

docs: fix examples to use supported dtypes#13392
kgryte merged 2 commits into
developfrom
philipp/ci-fix-ones-like-example-dtypes-2026-07-09

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Resolves #{{N/A}}.

Description

This pull request:

  • Fixes lib/node_modules/@stdlib/array/ones-like/examples/index.js, which crashed on the nightly random_examples CI run by iterating over a dtype list that includes dtypes onesLike doesn't support.

Related Issues

None.

Questions

No.

Other

Failing run: https://github.com/stdlib-js/stdlib/actions/runs/28985865125

Symptom: TypeError: invalid argument. Second argument must be one of the following: ... Value: \bool`.thrown fromonesLike`, crashing the example script.

Root cause: The example requested the full, unfiltered dtype list via dtypes(), which includes 'bool'. onesLike only accepts dtypes( 'numeric_and_generic' ) (see lib/main.js), so calling it with 'bool' throws.

Fix: Change the example to request dtypes( 'numeric_and_generic' ), the same filtered list onesLike validates against, so every dtype iterated over is supported.

Checklist

AI Assistance

  • Yes

  • No

  • 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 written primarily by Claude Code as part of an automated CI-failure triage and fix routine, based on live GitHub Actions job log analysis. The fix was reviewed by three independent automated review passes (correctness, regression scope, style/conventions) before being proposed here; all three approved with no blocking findings.


@stdlib-js/reviewers


Generated by Claude Code

The job `random_examples` on workflow `random_examples` failed on
develop with `TypeError: invalid argument. Second argument must be
one of the following: ... Value: \`bool\`.` in
examples/index.js. Root cause: the example iterated over the full,
unfiltered dtype list from `dtypes()`, which includes `'bool'`, but
`onesLike` only accepts `dtypes( 'numeric_and_generic' )` (see
lib/main.js). This commit changes the example to request the same
filtered dtype list `onesLike` itself validates against, so every
dtype it iterates over is one `onesLike` actually supports.

Ref: https://github.com/stdlib-js/stdlib/actions/runs/28985865125
@stdlib-bot

stdlib-bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
array/ones-like $\\color{red}133/135$
$\\color{green}+0.00\\%$
$\\color{red}14/15$
$\\color{green}+0.00\\%$
$\\color{green}1/1$
$\\color{green}+0.00\\%$
$\\color{red}133/135$
$\\color{green}+0.00\\%$

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

Comment thread lib/node_modules/@stdlib/array/ones-like/examples/index.js
Commit fdf871e fixed the crash in examples/index.js by requesting
`dtypes( 'numeric_and_generic' )` instead of the unfiltered `dtypes()`
list, but README.md embeds its own copy of the same example and was
left with the stale, crashing call. This commit applies the identical
change there so the documented example matches the one that actually
runs in CI.
@Planeshifter Planeshifter marked this pull request as ready for review July 9, 2026 14:54
@Planeshifter Planeshifter requested review from a team and kgryte July 9, 2026 14:54
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Jul 9, 2026
@kgryte kgryte changed the title fix(@stdlib/array/ones-like): fix example to use supported dtypes docs: fix examples to use supported dtypes Jul 9, 2026
@kgryte kgryte merged commit 669fa61 into develop Jul 9, 2026
33 checks passed
@kgryte kgryte deleted the philipp/ci-fix-ones-like-example-dtypes-2026-07-09 branch July 9, 2026 19:56
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Jul 9, 2026
@kgryte kgryte added the Documentation Improvements, additions, or changes to documentation. label Jul 9, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants