Skip to content

docs: use dedicated zero-dimensional tensor constructor in stats/base/ndarray/dztest - #16690

Merged
kgryte merged 2 commits into
stdlib-js:developfrom
devxsubh:docs/tensor0d-stats-base-ndarray-dztest
Nov 18, 2026
Merged

kgryte merged 2 commits into
stdlib-js:developfrom
devxsubh:docs/tensor0d-stats-base-ndarray-dztest

Conversation

@devxsubh

Copy link
Copy Markdown
Contributor

Resolves a part of #16654.

Description

What is the purpose of this pull request?

This pull request:

  • updates @stdlib/stats/base/ndarray/dztest to create its zero-dimensional ndarrays with the dedicated Float64Tensor0D and Int8Tensor0D constructors instead of @stdlib/ndarray/from-scalar, in the README, REPL help, TypeScript declarations, examples, JSDoc examples, benchmark and tests.
  • removes the { 'dtype': 'float64' } options objects that were only used by from-scalar. Where the same options object also sets the dtype of the input array (examples, benchmark and tests), it stays.

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:

  • blas/ext/base/ndarray/daxpby (3757981)

What carried over from the reference(s)?

  • Replacing scalar2ndarray( value, opts ) with new Float64Tensor0D( value ), and dropping options objects that are no longer used.

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

  • The alternative hypothesis is an int8 ndarray, so it uses new Int8Tensor0D( resolveEnum( 'two-sided' ) ).
  • In docs/repl.txt, the alternative is the string 'two-sided' in a generic ndarray. ndarray/tensor0d/generic has no REPL alias yet, so that one line still uses from-scalar.

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.

The unit tests pass (25 of 25), and examples/index.js and the README and JSDoc examples run.

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.".

This PR was written primarily by Claude Code, following the reference commit. I reviewed the diff and ran the tests and examples.


@stdlib-js/reviewers

@devxsubh
devxsubh requested a review from a team November 18, 2026 08:21
@stdlib-bot stdlib-bot added Statistics Issue or pull request related to statistical functionality. 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

stdlib-bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/ndarray/dztest $\\color{green}177/177$
$\\color{green}+0.00\\%$
$\\color{green}3/3$
$\\color{green}+0.00\\%$
$\\color{green}1/1$
$\\color{green}+0.00\\%$
$\\color{green}177/177$
$\\color{green}+0.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
Signed-off-by: Athan <kgryte@gmail.com>

@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 4389328 into stdlib-js:develop Nov 18, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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 Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants