fix: skip unimplemented dtypes in from-scalar example#13061
Draft
Planeshifter wants to merge 1 commit into
Draft
fix: skip unimplemented dtypes in from-scalar example#13061Planeshifter wants to merge 1 commit into
Planeshifter wants to merge 1 commit into
Conversation
The example iterates over all ndarray dtypes, including `float16` and `complex32`, whose buffer constructors in `@stdlib/ndarray/base/buffer-ctors` are placeholder `notImplemented` functions that throw `Error: not implemented` when invoked. Add a guard to skip these two dtypes until their constructors are implemented. Fixes CI job `random_examples` failure.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
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
This pull request:
@stdlib/ndarray/from-scalarexample to skipfloat16andcomplex32dtypes, whose buffer constructors in@stdlib/ndarray/base/buffer-ctorsare placeholdernotImplementedfunctions that throwError: not implementedwhen invoked as constructors.The example iterates over all dtypes returned by
dtypes()(which includes every registered dtype indtypes.json). Forfloat16andcomplex32, the internal call chain is:The
if (buf === null)guard infrom-scalar/lib/main.jsnever fires because the throw happens beforebuffer()can return. The fix skips these two dtypes in the example until their constructors are implemented (tracked by theFIXMEcomments inbuffer-ctors/lib/ctors.js).This resolves the
random_examplesCI job failure seen in workflow run 27923327635.Related Issues
random_examplesondevelop.Questions
No.
Other
No.
Checklist
AI Assistance
Yes
Code generation (e.g., when writing an implementation or fixing a bug)
Research and understanding
Disclosure
This PR was written primarily by Claude Code as part of an automated CI failure investigation routine. The root cause was identified by tracing the call chain from the failing example through
@stdlib/ndarray/base/bufferand@stdlib/ndarray/base/buffer-ctors. The fix was validated by running the example locally and by three independent automated reviewers (correctness, regression, and style checks).@stdlib-js/reviewers
Generated by Claude Code