Skip to content

Commit b1a1b7f

Browse files
committed
feat!: add support for ndarray data type objects and update existing type definitions
This commit adds support for ndarrays having data type objects representing the underlying data type. This is part of the general effort to move beyond dtype strings to represent data types. As such, users directly accessing `x.dtype` may now no longer receive a string, but a data type object/instance. Accordingly, users are advised to use `ndarray/dtype` for accessing the dtype of an ndarray and, if a string is desired, to call `String(dt)` on the returned value from `ndarray/dtype`. In general, directly accessing ndarray property values is discouraged. Instead, use functional accessors. Because this change impacts all ndarray type definitions which previously stipulated that the dtype of an ndarray should be a string, this is a breaking change. BREAKING CHANGE: add support for data type objects To migrate, users should avoid accessing ndarray properties via property accessors and instead use functional APIs, such as `@stdlib/ndarray/dtype`. If a string is expected, wrap the call to `ndarray/dtype` with `String(dt)` to force the dtype value to always be a string. --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent c6e2443 commit b1a1b7f

1 file changed

Lines changed: 750 additions & 55 deletions

File tree

0 commit comments

Comments
 (0)