Skip to content

feat: add array/base/mskunary5d #3207

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
merged 16 commits into from
Nov 25, 2024
Merged

Conversation

Vinit-Pandit
Copy link
Contributor

@Vinit-Pandit Vinit-Pandit commented Nov 21, 2024

Resolves #3177 .

Description

This pull request:

  • Add the implementation of mskunary5d

Related Issues

Does this pull request have any related issues?

This pull request:

Questions

Any questions for reviewers of this pull request?

In the current implementation, I have used the helper function so that max depth does not exceed 5 (lint error) and minimum changes are made compared to their previous 3D version. There are still better ways to do that like:

  1. Calculating the total elements, then running a single for loop and applying the operation by calculating the index on each iteration.
  2. Using recursion.
    But I am afraid to take decisions on my own by changing the way, so let me know if the implementation needs further changes.

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

@stdlib-bot
Copy link
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

Copy link
Contributor

@stdlib-bot stdlib-bot left a comment

Choose a reason for hiding this comment

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

👋 Hi there! 👋

And thank you for opening your first pull request! We will review it shortly. 🏃 💨

@stdlib-bot
Copy link
Contributor

stdlib-bot commented Nov 21, 2024

Coverage Report

Package Statements Branches Functions Lines
array/base/mskunary5d $\color{green}180/180$
$\color{green}+100.00\%$
$\color{green}15/15$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}180/180$
$\color{green}+100.00\%$

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

@Vinit-Pandit Vinit-Pandit changed the title Adding implementation of the array/base/mskunary5d feat: Adding implementation of the array/base/mskunary5d Nov 21, 2024
Co-authored-by: Abhijit <abhijitmraut8010@gmail.com>
Signed-off-by: Vinit Pandit <106718914+MeastroZI@users.noreply.github.com>
@kgryte kgryte added Feature Issue or pull request for adding a new feature. Needs Review A pull request which needs code review. Utilities Issue or pull request concerning general utilities. labels Nov 21, 2024
@kgryte kgryte changed the title feat: Adding implementation of the array/base/mskunary5d feat: add array/base/mskunary5d Nov 21, 2024
@kgryte
Copy link
Member

kgryte commented Nov 21, 2024

/stdlib update-copyright-years

@Vinit-Pandit Vinit-Pandit requested a review from kgryte November 21, 2024 10:57
Co-authored-by: Abhijit <abhijitmraut8010@gmail.com>
Signed-off-by: Vinit Pandit <106718914+MeastroZI@users.noreply.github.com>
Signed-off-by: Vinit Pandit <106718914+MeastroZI@users.noreply.github.com>
Signed-off-by: Vinit Pandit <106718914+MeastroZI@users.noreply.github.com>
@kgryte
Copy link
Member

kgryte commented Nov 21, 2024

Re: questions.

Calculating the total elements, then running a single for loop and applying the operation by calculating the index on each iteration.

TMK: this isn't possible to do with a single index. The inputs are nested arrays which are not necessarily contiguous in memory. If we were operating on strided arrays, you could calculate a single index and use a single for loop, but that is not the case here and helps motivate why we are creating this package in the first place.

Using recursion.

For these packages, we prefer an iterative approach for performance. We do provide a separate recursive implementation (e.g., mskunarynd) for operating on nested arrays of arbitrary dimensionality. Here, we know the dimensionality and thus prefer to use explicit for loops.

@kgryte
Copy link
Member

kgryte commented Nov 21, 2024

/stdlib lint-autofix

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Nov 21, 2024
@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 Nov 21, 2024
@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Nov 21, 2024
Signed-off-by: Vinit Pandit <106718914+MeastroZI@users.noreply.github.com>
@kgryte kgryte added Needs Review A pull request which needs code review. and removed Needs Changes Pull request which needs changes before being merged. labels Nov 22, 2024
kgryte and others added 2 commits November 21, 2024 17:47
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Vinit Pandit <106718914+MeastroZI@users.noreply.github.com>
@Vinit-Pandit Vinit-Pandit requested a review from kgryte November 22, 2024 02:45
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. Thanks, @MeastroZI, and thanks @AbhijitRaut04 for your help.

@kgryte kgryte removed the Needs Review A pull request which needs code review. label Nov 25, 2024
@kgryte kgryte merged commit b26d9d5 into stdlib-js:develop Nov 25, 2024
12 checks passed
pranav-1720 pushed a commit to pranav-1720/stdlib that referenced this pull request Nov 25, 2024
PR-URL: stdlib-js#3207
Closes: stdlib-js#3177
Co-authored-by: Athan Reines <kgryte@gmail.com>
Reviewed-by: Athan Reines <kgryte@gmail.com> 
Signed-off-by: Vinit Pandit <106718914+MeastroZI@users.noreply.github.com>
Signed-off-by: Athan Reines <kgryte@gmail.com>
Co-authored-by: Abhijit <abhijitmraut8010@gmail.com>
Co-authored-by: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com>
@Vinit-Pandit Vinit-Pandit deleted the mskunary5d branch November 27, 2024 12:03
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. Utilities Issue or pull request concerning general utilities.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC]: add array/base/mskunary5d
4 participants