Skip to content

feat!: add writable parameter support to ndarray/base/transpose#10474

Merged
kgryte merged 2 commits intostdlib-js:developfrom
headlessNode:writ-transpose
Feb 28, 2026
Merged

feat!: add writable parameter support to ndarray/base/transpose#10474
kgryte merged 2 commits intostdlib-js:developfrom
headlessNode:writ-transpose

Conversation

@headlessNode
Copy link
Copy Markdown
Member


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: passed
  • task: lint_package_json status: na
  • task: lint_repl_help status: passed
  • task: lint_javascript_src status: passed
  • task: lint_javascript_cli status: na
  • task: lint_javascript_examples status: passed
  • task: lint_javascript_tests status: passed
  • task: lint_javascript_benchmarks status: passed
  • 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: passed
  • task: lint_license_headers status: passed ---

Resolves stdlib-js/metr-issue-tracker#170

Description

What is the purpose of this pull request?

This pull request:

  • add writable parameter support to ndarray/base/transpose

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

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

Tried to have Claude Code write everything but it hallucinated when applying changes to the test cases and the typescript definitions. So I wrote those manually.


@stdlib-js/reviewers

---
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: passed
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: passed
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: passed
  - task: lint_javascript_tests
    status: passed
  - task: lint_javascript_benchmarks
    status: passed
  - 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: passed
  - task: lint_license_headers
    status: passed
---
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Feb 24, 2026
@headlessNode headlessNode added Feature Issue or pull request for adding a new feature. METR Pull request associated with the METR project. labels Feb 24, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

stdlib-bot commented Feb 24, 2026

Coverage Report

Package Statements Branches Functions Lines
ndarray/base/transpose $\color{green}131/131$
$\color{green}+100.00%$
$\color{green}5/5$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}131/131$
$\color{green}+100.00%$

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

@headlessNode headlessNode requested a review from kgryte February 24, 2026 17:32
@kgryte kgryte added the release: Major Breaking change requiring a new major release. label Feb 28, 2026
---
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: passed
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: passed
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: passed
  - 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: passed
  - task: lint_license_headers
    status: passed
---
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Feb 28, 2026
Copy link
Copy Markdown
Member

@kgryte kgryte left a comment

Choose a reason for hiding this comment

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

LGTM

@kgryte
Copy link
Copy Markdown
Member

kgryte commented Feb 28, 2026

For METR,

review_time: 20 mins

@kgryte kgryte merged commit 9df924b into stdlib-js:develop Feb 28, 2026
14 checks passed
@headlessNode headlessNode deleted the writ-transpose branch February 28, 2026 10:10
Witty-31-06 pushed a commit to Witty-31-06/stdlib that referenced this pull request Mar 7, 2026
…dlib-js#10474)

This commit adds support for a writable parameter. Previously, a returned ndarray was always writable; this is now configurable.

This commit also fixes a bug related to index offset calculation.

BREAKING CHANGE: add writable parameter

To migrate and preserve prior behavior, users should always pass `true` for the second parameter.

PR-URL: stdlib-js#10474
Closes: stdlib-js/metr-issue-tracker#170
Co-authored-by: Athan Reines <kgryte@gmail.com>
Reviewed-by: Athan Reines <kgryte@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Issue or pull request for adding a new feature. METR Pull request associated with the METR project. release: Major Breaking change requiring a new major release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC]: add writable parameter support to ndarray/base/transpose

3 participants