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/find #4398

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

Open
gururaj1512 wants to merge 13 commits into stdlib-js:develop
base: develop
Choose a base branch
Loading
from gururaj1512:ndarray/find

Conversation

Copy link
Member

@gururaj1512 gururaj1512 commented Dec 30, 2024
edited by headlessNode
Loading


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: 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 ---

type: pre_push_report
description: Results of running various checks prior to pushing changes. report:

  • task: run_javascript_examples status: passed
  • task: run_c_examples status: na
  • task: run_cpp_examples status: na
  • task: run_javascript_readme_examples status: passed
  • task: run_c_benchmarks status: na
  • task: run_cpp_benchmarks status: na
  • task: run_fortran_benchmarks status: na
  • task: run_javascript_benchmarks status: passed
  • task: run_julia_benchmarks status: na
  • task: run_python_benchmarks status: na
  • task: run_r_benchmarks status: na
  • task: run_javascript_tests status: passed ---

Resolves stdlib-js/metr-issue-tracker#70.

Description

What is the purpose of this pull request?

This pull request:

  • Adds implementation for ndarray/find

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

---
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: 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
---
---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
 - task: run_javascript_examples
 status: na
 - task: run_c_examples
 status: na
 - task: run_cpp_examples
 status: na
 - task: run_javascript_readme_examples
 status: na
 - task: run_c_benchmarks
 status: na
 - task: run_cpp_benchmarks
 status: na
 - task: run_fortran_benchmarks
 status: na
 - task: run_javascript_benchmarks
 status: na
 - task: run_julia_benchmarks
 status: na
 - task: run_python_benchmarks
 status: na
 - task: run_r_benchmarks
 status: na
 - task: run_javascript_tests
 status: na
---
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Dec 30, 2024
Copy link
Contributor

stdlib-bot commented Dec 30, 2024
edited
Loading

Coverage Report

Package Statements Branches Functions Lines
ndarray/find $\color{red}365/586$
$\color{green}+62.29\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{red}0/4$
$\color{green}+0.00\%$
$\color{red}365/586$
$\color{green}+62.29\%$

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

Copy link
Member

kgryte commented Dec 30, 2024
edited
Loading

@gururaj1512 Before you start doing too many of things in #2656 and us needing to go back and fix things, I'd put these on pause. As mentioned in #2656, the issue is that find (and every) are reductions, and thus should support specifying axes over which to perform the reductions. And furthermore, the implementation proposed in this PR may work for the flattened case; however, it won't work for the axes case. And lastly, we should always return ndarrays, not scalars. In short, there is a bit of R&D which needs to be done in order for these to move forward.

Copy link
Member

kgryte commented Dec 30, 2024

One other thing: each top-level ndarray implementation should be a wrapper around a "base" implementation. Notice how in base/for-each, we write kernels for efficient iteration: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/for-each/lib. I would expect something similar for reductions.

Copy link
Member

kgryte commented Dec 30, 2024

So before top-level implementations, we need to create the "base" implementations.

@kgryte kgryte added the Needs Discussion Needs further discussion. label Dec 30, 2024
Copy link
Member Author

@gururaj1512 Before you start doing too many of things in #2656 and us needing to go back and fix things, I'd put these on pause. As mentioned in #2656, the issue is that find (and every) are reductions, and thus should support specifying axes over which to perform the reductions. And furthermore, the implementation proposed in this PR may work for the flattened case; however, it won't work for the axes case. And lastly, we should always return ndarrays, not scalars. In short, there is a bit of R&D which needs to be done in order for these to move forward.

Yaa I had similar doubts while creating this PR. Just created this quick PR to discuss about it.

kgryte reacted with thumbs up emoji

Copy link
Member Author

@kgryte, Should we pause this, or is there something I can work on? I would love to work on issues related to this.

Copy link
Member

kgryte commented Dec 30, 2024

@gururaj1512 Yes, let's pause. I pinged you on the tracking issue.

Copy link
Member

kgryte commented Aug 13, 2025

@headlessNode Once #7426 is merged, would you mind taking this PR over, refactoring, and basing on ndarray/base/find?

headlessNode reacted with thumbs up emoji

@kgryte kgryte added Feature Issue or pull request for adding a new feature. status: Blocked Issue or pull request which is currently blocked. Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. Needs Discussion Needs further discussion. labels Aug 13, 2025
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 13, 2025
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Aug 13, 2025
Copy link
Member

kgryte commented Sep 2, 2025

@headlessNode Now that #7426 has been merged, this is now ready for you.

headlessNode reacted with thumbs up emoji

@kgryte kgryte removed the status: Blocked Issue or pull request which is currently blocked. label Sep 2, 2025
Copy link
Member

/stdlib merge

stdlib-bot reacted with eyes emoji

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Sep 2, 2025
@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Sep 2, 2025
Copy link
Member

/stdlib help

stdlib-bot reacted with eyes emoji

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Sep 2, 2025
Copy link
Contributor

@headlessNode, available slash commands include:

  • /stdlib check-files - Check for required files.
  • /stdlib make-commands - Print make commands for package changed in PR.
  • /stdlib update-copyright-years - Update copyright header years.
  • /stdlib lint-autofix - Auto-fix lint errors.
  • /stdlib merge - Merge changes from develop branch into this PR.
  • /stdlib rebase - Rebase this PR on top of develop branch.

@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Sep 9, 2025
Signed-off-by: Muhammad Haris <101793258+headlessNode@users.noreply.github.com>
@headlessNode headlessNode marked this pull request as draft September 10, 2025 19:33
Signed-off-by: Muhammad Haris <101793258+headlessNode@users.noreply.github.com>
Signed-off-by: Muhammad Haris <101793258+headlessNode@users.noreply.github.com>
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Sep 14, 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: 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: 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: 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: 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: passed
 - 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: passed
 - task: lint_typescript_tests
 status: passed
 - task: lint_license_headers
 status: passed
---
@headlessNode headlessNode marked this pull request as ready for review September 14, 2025 12:22
@kgryte kgryte removed the Needs Changes Pull request which needs changes before being merged. label Sep 14, 2025
Copy link
Member

@kgryte ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@headlessNode headlessNode Awaiting requested review from headlessNode

@kgryte kgryte Awaiting requested review from kgryte

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
Feature Issue or pull request for adding a new feature. Needs Review A pull request which needs code review.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

[RFC]: Add ndarray/find

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