Skip to content

feat: add ndarray/base/trues-like#12144

Closed
Planeshifter wants to merge 6 commits into
developfrom
claude/vibrant-brahmagupta-bJsk8
Closed

feat: add ndarray/base/trues-like#12144
Planeshifter wants to merge 6 commits into
developfrom
claude/vibrant-brahmagupta-bJsk8

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Resolves stdlib-js/todo#2777.

Description

What is the purpose of this pull request?

This pull request:

  • adds the @stdlib/ndarray/base/trues-like package, which creates an ndarray filled with true values and having the same shape and data type as a provided input ndarray
  • registers truesLike in the @stdlib/ndarray/base namespace

The implementation follows the same pattern as @stdlib/ndarray/base/falses-like:

function truesLike( x ) {
    return fill( emptyLike( x ), true );
}

Supported dtypes: bool and generic (same as @stdlib/ndarray/base/trues and @stdlib/ndarray/base/falses-like).

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

  • stdlib-js/todo#2777

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.

No.

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.


@stdlib-js/reviewers


Generated by Claude Code

claude added 6 commits May 15, 2026 08:36
Adds the `@stdlib/ndarray/base/trues-like` package, which creates an
ndarray filled with `true` values and having the same shape and data
type as a provided ndarray. Follows the same pattern as
`@stdlib/ndarray/base/falses-like`.

Also registers `truesLike` in the `@stdlib/ndarray/base` namespace.

https://claude.ai/code/session_01PxFKbuUFyEW22kNL6XbQ1p
- Add backticks around `true` in package.json description
- Add missing `booleans` keyword; fix keyword ordering to match `falses-like`
- Use `@stdlib/ndarray/empty` (non-base) in size benchmarks, matching
  the established pattern in `falses-like`
- Add missing "and" in test tape description strings

https://claude.ai/code/session_01PxFKbuUFyEW22kNL6XbQ1p
@kgryte kgryte closed this May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants