Skip to content

docs: use dedicated zero-dimensional tensor constructor in blas/ext/base/ndarray/dxsa - #16687

Merged
kgryte merged 1 commit into
stdlib-js:developfrom
Deepanshu-Mehta:contrib/dxsa-tensor0d
Nov 18, 2026
Merged

kgryte merged 1 commit into
stdlib-js:developfrom
Deepanshu-Mehta:contrib/dxsa-tensor0d

Conversation

@Deepanshu-Mehta

@Deepanshu-Mehta Deepanshu-Mehta commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Resolves a part of #16654.

Description

What is the purpose of this pull request?

This pull request:

  • updates @stdlib/blas/ext/base/ndarray/dxsa to use the dedicated Float64Tensor0D constructor (@stdlib/ndarray/tensor0d/float64) instead of @stdlib/ndarray/from-scalar when creating the zero-dimensional alpha ndarray. The change covers the README examples, REPL text, TypeScript declaration example and type tests (docs/types/test.ts), JSDoc examples (lib/index.js, lib/main.js, lib/native.js), examples/index.js, the benchmarks, and the unit tests.

Runtime code and TypeScript signatures are unchanged. The only edits under lib/ are @example comments.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Reference Packages

Did the content of this pull request follow one or more existing packages? Answering is optional.

This pull request followed these packages:

What carried over from the reference(s)?

What differed, or what did you have to work out yourself?

  • float64 takes a single value (new Float64Tensor0D( 5.0 )), so no Complex constructor or require needed removing.
  • Here from-scalar was called either with an inline { 'dtype': 'float64' } object or with a shared options/opts variable. Both forms were replaced. The shared options/opts variable was kept where it is still used to create x (the benchmarks, examples/index.js, and the second README example) and was removed from docs/repl.txt, where only alpha used it.
  • The blank line was left in the second README example and in examples/index.js, because other statements sit between the declarations there.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Run locally for this package:

  • examples/index.js
  • unit tests: test/test.js (4/4 pass), test/test.main.js (12/12 pass)
  • native unit tests: test/test.native.js (12/12 pass), after building the addon with node-gyp
  • benchmark: benchmark/benchmark.js (18/18 pass)
  • native benchmark: benchmark/benchmark.native.js (18/18 pass)
  • make lint-javascript-files on the changed JavaScript files (0 errors; one pre-existing max-len warning in each of test/test.main.js and test/test.native.js, on a line this PR doesn't change)
  • make lint-markdown-files on the README (no issues)
  • make lint-typescript-declarations-files on docs/types/index.d.ts and docs/types/test.ts (no issues)
  • REPL help linter (@stdlib/_tools/lint/repl-txt) on the package's docs/repl.txt (no errors or warnings)

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code.", or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

I used Claude Code to find this package, apply the from-scalar to Float64Tensor0D replacement, and run the linters, tests and benchmarks (including building the native addon). I reviewed the full diff before committing.


@stdlib-js/reviewers

@Deepanshu-Mehta
Deepanshu-Mehta requested a review from a team November 18, 2026 06:51
@stdlib-bot stdlib-bot added BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). Needs Review A pull request which needs code review. Good First PR A pull request resolving a Good First Issue. labels Nov 18, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
blas/ext/base/ndarray/dxsa $\\color{green}192/192$
$\\color{green}+100.00\\%$
$\\color{green}7/7$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}192/192$
$\\color{green}+100.00\\%$

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

@kgryte kgryte added Documentation Improvements, additions, or changes to documentation. difficulty: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. review: 5 and removed Needs Review A pull request which needs code review. labels Nov 18, 2026

@kgryte kgryte left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kgryte
kgryte merged commit 52f8091 into stdlib-js:develop Nov 18, 2026
139 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). difficulty: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. Documentation Improvements, additions, or changes to documentation. Good First PR A pull request resolving a Good First Issue. review: 5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants