Repository navigation
docs: improve doctests for ndarray instances in ndarray/slice-from - #16236
Open
Thanatos9404 wants to merge 1 commit into
Open
Thanatos9404 wants to merge 1 commit into
Thanatos9404 wants to merge 1 commit into
Conversation
Replace explicit `ndarray2array` conversions, which were only used to show expected values, with ndarray instance return annotations (e.g., `<ndarray>[ [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]`) in the README, REPL text, TypeScript declarations, and JSDoc examples, and remove the now-unused `@stdlib/ndarray/to-array` imports. The `examples/index.js` file is intentionally left unchanged, as it explicitly prints nested arrays. Ref: stdlib-js#9329
Contributor
|
👋 Hi there! 👋 And thank you for opening your first pull request! We will review it shortly. 🏃 💨 Getting Started
Next Steps
Running Tests LocallyYou can use # Run tests for all packages in the math namespace:
make test TESTS_FILTER=".*/@stdlib/math/.*"
# Run benchmarks for a specific package:
make benchmark BENCHMARKS_FILTER=".*/@stdlib/math/base/special/sin/.*"If you haven't heard back from us within two weeks, please ping us by tagging the "reviewers" team in a comment on this PR. If you have any further questions while waiting for a response, please join our Zulip community to chat with project maintainers and other community members. We appreciate your contribution! Documentation Links |
This branch has not been deployed
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.
Progresses #9329.
Description
This pull request:
@stdlib/ndarray/slice-fromto replacendarray2arraydecomposition logic with ndarray instance notation (e.g.,// returns <ndarray>[ [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]).@stdlib/ndarray/to-arrayimport wherever it was only used to show expected values.examples/index.jsunchanged, as that file intentionally prints nested arrays.Related Issues
This pull request has the following related issues:
Questions
No.
Other
The changes follow the same pattern as the
ndarray/sliceupdate in #14771. In thestrict: falseREADME example, which returns an empty view, the annotation stays// returns <ndarray>(as inndarray/slice). The complex number examples indocs/types/index.d.tsonly drop the unused import.Every updated annotation was checked locally with the project's own doctest rules (
stdlib/jsdoc-doctestforlib/*.js,stdlib/tsdoc-declarations-doctestfordocs/types/index.d.ts, the_tools/repl-txtdoctestrule fordocs/repl.txt, andstdlib/doctestfor the README code blocks). The package unit tests also pass (440/440).Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
Drafted with Claude Code, following the pattern from #14771; every annotated return value was checked against stdlib's doctest rules.
@stdlib-js/reviewers