feat: add ndarray/base/scalar-dtype (issue #11002)#11040
feat: add ndarray/base/scalar-dtype (issue #11002)#11040Suhaniahirwar20 wants to merge 1 commit intostdlib-js:developfrom
Conversation
|
Thank you for working on this pull request. However, we cannot accept your contribution as this pull request does not follow project conventions. We place a high value on consistency throughout the stdlib codebase, and this pull request was found to significantly deviate from stdlib conventions. We encourage you to closely examine other packages in stdlib and attempt to emulate the practices and conventions found therein.
In short, the more effort you put in to ensure that your contribution looks and feels like stdlib—including variables names, bracket spacing, line breaks, etc—the more likely that your contribution will be reviewed and ultimately accepted. We encourage you to closely study the codebase before continuing to work on this pull request. Thank you again for your interest in stdlib, and we look forward to reviewing your future contributions. |
Resolves #11002.
Description
This pull request introduces a new utility
@stdlib/ndarray/base/scalar-dtypeto resolve a default ndarray data type from a scalar value.Previously, scalar-to-dtype resolution logic was duplicated across multiple packages such as:
ndarray/base/atleastndndarray/from-scalarThis PR extracts that logic into a reusable module, improving maintainability, consistency, and making it easier to extend support for additional data types in the future.
Changes include:
@stdlib/ndarray/base/scalar-dtypendarray/base/atleastndto use the new utilityRelated Issues
This pull request has the following related issues:
ndarray/base/scalar-dtype#11002Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
I consulted ChatGPT to better understand the existing codebase and refactoring approach. The implementation and final changes were written and verified manually.
@stdlib-js/reviewers