Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add ndarray/base/nullary-strided1d-dispatch #7821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
kgryte merged 12 commits into stdlib-js:develop from headlessNode:nullary-strided1d-dispatch
Sep 10, 2025

Conversation

Copy link
Member

@headlessNode headlessNode commented Aug 6, 2025

Progresses #2656.

Description

What is the purpose of this pull request?

This pull request:

  • add ndarray/base/nullary-strided1d-dispatch

Related Issues

Does this pull request have any related issues?

This pull request:

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.


@stdlib-js/reviewers

@headlessNode headlessNode added Feature Issue or pull request for adding a new feature. GSoC Google Summer of Code. gsoc: 2025 Google Summer of Code (2025). labels Aug 6, 2025
Copy link
Member

kgryte commented Aug 29, 2025

/stdlib merge

stdlib-bot reacted with eyes emoji

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Aug 29, 2025
@kgryte kgryte marked this pull request as ready for review August 29, 2025 11:19
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 29, 2025
@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Aug 29, 2025
Copy link
Contributor

stdlib-bot commented Aug 29, 2025
edited
Loading

Coverage Report

Package Statements Branches Functions Lines
ndarray/base/nullary-strided1d-dispatch $\color{red}374/561$
$\color{green}+66.67\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{red}0/5$
$\color{green}+0.00\%$
$\color{red}374/561$
$\color{green}+66.67\%$

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

@kgryte kgryte added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Aug 29, 2025
Copy link
Member

kgryte commented Aug 29, 2025

@headlessNode Would you mind addressing the CI failures in this PR? Cheers.

headlessNode reacted with thumbs up emoji

---
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: passed
 - task: lint_javascript_cli
 status: na
 - task: lint_javascript_examples
 status: passed
 - 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: na
 - task: lint_typescript_tests
 status: na
 - task: lint_license_headers
 status: passed
---
---
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: 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: na
 - task: lint_typescript_tests
 status: na
 - task: lint_license_headers
 status: passed
---
---
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: passed
 - task: lint_javascript_cli
 status: na
 - task: lint_javascript_examples
 status: na
 - task: lint_javascript_tests
 status: na
 - 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: na
 - task: lint_typescript_tests
 status: na
 - task: lint_license_headers
 status: passed
---
---
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: 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: na
 - task: lint_typescript_tests
 status: na
 - task: lint_license_headers
 status: passed
---
---
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: passed
 - 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: na
 - task: lint_typescript_tests
 status: na
 - task: lint_license_headers
 status: passed
---
---
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: na
 - task: lint_javascript_src
 status: passed
 - 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: na
 - task: lint_typescript_tests
 status: na
 - task: lint_license_headers
 status: passed
---
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Sep 4, 2025
Comment on lines 32 to 43
{
const dtypes: Array<DataType> = [ 'float64', 'float32', 'generic' ];
const table = {
'default': gsorthp
};
const policies = {
'output': 'same' as OutputPolicy
};

new NullaryStrided1dDispatch<number>( table, [ dtypes ], policies ); // $ExpectType NullaryStrided1dDispatch<number>

new NullaryStrided1dDispatch<number>( table, [ dtypes ], policies, {} ); // $ExpectType NullaryStrided1dDispatch<number>
Copy link
Member Author

@headlessNode headlessNode Sep 4, 2025

Choose a reason for hiding this comment

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

@kgryte here the table is triggering a mismatch error. I can't seem to figure out the solution 🆘

Copy link
Member

Choose a reason for hiding this comment

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

I am not seeing a TypeScript lint error in CI.

Copy link
Member Author

@headlessNode headlessNode Sep 4, 2025

Choose a reason for hiding this comment

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

I saw it in the code editor

Copy link
Member

Choose a reason for hiding this comment

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

I can reproduce in the editor, but I cannot reproduce in the tests. I say we ignore for now, and we can revisit in the future if this is an actual problem. End users should be relatively unlikely to actually interface with this API, so I don't think this will cause many issues, if any, in the shorter term.

@kgryte kgryte removed the Needs Changes Pull request which needs changes before being merged. label Sep 7, 2025
---
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: passed
 - task: lint_repl_help
 status: skipped
 - task: lint_javascript_src
 status: passed
 - task: lint_javascript_cli
 status: na
 - task: lint_javascript_examples
 status: passed
 - task: lint_javascript_tests
 status: na
 - 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
---
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Sep 10, 2025
Copy link
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 after clean-up.

Copy link
Member

kgryte commented Sep 10, 2025

As the REPL text lint failure is expected, I'll go ahead and merge.

A few comments @headlessNode:

  1. Policies have been removed. They were not being used, so it is pointless to have a policies argument.
  2. You still needed to support separate input and output dtype arguments. You seemed to fundamentally misunderstand how idtypes was intended to work. In particular, that array is intended to place dtype constraints on any, including additional, input ndarray arguments. That is a separate concern from the dtype constraints placed on the input/output ndarray which is the target of the nullary strided function.

@kgryte kgryte merged commit cfe870b into stdlib-js:develop Sep 10, 2025
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@kgryte kgryte kgryte approved these changes

Assignees
No one assigned
Labels
Feature Issue or pull request for adding a new feature. GSoC Google Summer of Code. gsoc: 2025 Google Summer of Code (2025).
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /