Skip to content

feat: add math/base/special/nanmin #2342

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 14 commits into from
Jun 10, 2024
Merged

Conversation

RidamGarg
Copy link
Contributor

@RidamGarg RidamGarg commented Jun 8, 2024

Added Package @stdlib/math/base/special/nanmin.

Resolves: #2318

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

@stdlib-bot stdlib-bot added the Math Issue or pull request specific to math functionality. label Jun 8, 2024
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. 🏃 💨

@kgryte
Copy link
Member

kgryte commented Jun 8, 2024

@RidamGarg Are you planning on adding the C implementation to this PR or in a subsequent PR?

@kgryte kgryte added the Feature Issue or pull request for adding a new feature. label Jun 8, 2024
@kgryte kgryte changed the title Added @stdlib/math/base/special/nanmin feat: add math/base/special/nanmin Jun 8, 2024
@kgryte
Copy link
Member

kgryte commented Jun 8, 2024

@RidamGarg Looks like you'll also need to resolve some CI failures for linting and benchmarks.

@RidamGarg
Copy link
Contributor Author

@kgryte made some changes. Can you please try again? I am planning to first complete the JS Implementation for both #2318 & #2317. After that I'll start C implementation of both

@RidamGarg
Copy link
Contributor Author

@kgryte I am able to make the changes by cloning the project again. Can you please check once if you can merge PR now?

@RidamGarg
Copy link
Contributor Author

@kgryte made the linting changes again & pushed the code. Can You please tell me? How Can I check these linting errors on my system?

@kgryte
Copy link
Member

kgryte commented Jun 9, 2024

@RidamGarg You'll want to consult the project development guide and leverage various make recipes (e.g., https://github.com/stdlib-js/stdlib/tree/develop/tools/make/lib/lint). Since you are running on Windows, you'll likely need to use WSL. But perhaps a more straightforward approach would be to leverage a dev container https://github.com/stdlib-js/stdlib/tree/develop/.devcontainer which sets up an environment for development.

@RidamGarg
Copy link
Contributor Author

Okay @kgryte I'll go through this. Thanks for sharing!

@RidamGarg
Copy link
Contributor Author

RidamGarg commented Jun 9, 2024

@kgryte, Can you please check? If we are able to merge the code now once. As I resolved the required eslint issues. So, that after this I can start my work on another issue?

@Planeshifter
Copy link
Member

/stdlib update-copyright-years

Copy link
Member

@Planeshifter Planeshifter left a comment

Choose a reason for hiding this comment

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

Thanks @RidamGarg for your PR! Looks good overall; left a few suggestions, the main relating to the package description.

@RidamGarg
Copy link
Contributor Author

@Planeshifter made the required changes

Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
@Planeshifter
Copy link
Member

Thank you for making the changes and your contribution, @RidamGarg. It is much appreciated!

@Planeshifter
Copy link
Member

@RidamGarg Could you please tick the checkbox that you read and accept the contributing guidelines, which is present in the PR template and which I inserted into your opening comment? Will merge your PR afterwards. Thank you!

@RidamGarg
Copy link
Contributor Author

Done @Planeshifter

@Planeshifter Planeshifter merged commit a985cc2 into stdlib-js:develop Jun 10, 2024
8 checks passed
```


If both argument are `NaN`, the function returns `NaN`.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
If both argument are `NaN`, the function returns `NaN`.
If both arguments are `NaN`, the function returns `NaN`.

var nanmin = require( './../lib' );

var m = nanmin( 3.0, 4.0 );
// returns 3.0
Copy link
Member

Choose a reason for hiding this comment

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

We should be logging each return value to the console.

*/
function nanmin( x, y ) {
if ( isnan( x ) ) {
return ( isnan(y) ) ? NaN : y;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return ( isnan(y) ) ? NaN : y;
return ( isnan( y ) ) ? NaN : y;

Consistent spacing.

</section>

<!-- /.usage -->

Copy link
Member

Choose a reason for hiding this comment

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

This readme is missing various sections (eg, examples, links, etc).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the section previously but got this comment from @Planeshifter. We auto-populate these sections from metadata, so this should be left empty. Should I add this in my next PR?

Copy link
Member

@Planeshifter Planeshifter Jun 10, 2024

Choose a reason for hiding this comment

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

@RidamGarg Sorry if my comment was not fully clear; the suggested change was to remove the inner content of the sections, not remove them altogether.

So

<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->

<section class="related">

* * *

## See Also

-   <span class="package-name">[`@stdlib/math/base/special/max`][@stdlib/math/base/special/max]</span><span class="delimiter">: </span><span class="description">return the maximum value.</span>
-   <span class="package-name">[`@stdlib/math/base/special/minabs`][@stdlib/math/base/special/minabs]</span><span class="delimiter">: </span><span class="description">return the minimum absolute value.</span>
-   <span class="package-name">[`@stdlib/math/base/special/minn`][@stdlib/math/base/special/minn]</span><span class="delimiter">: </span><span class="description">return the minimum value.</span>

</section>

<!-- /.related -->

<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="links">

<!-- <related-links> -->

[@stdlib/math/base/special/max]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/max

[@stdlib/math/base/special/minabs]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/minabs

[@stdlib/math/base/special/minn]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/minn

<!-- </related-links> -->

</section>

<!-- /.links -->

should have become

<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->

<section class="related">

</section>

<!-- /.related -->

<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="links">

<!-- <related-links> -->

<!-- </related-links> -->

</section>

<!-- /.links -->

We auto-populate the contents for the related packages, but that will only work if the sections are there.

Notice that the examples section is separate from that. It should contain the example from examples/index.js file; see other packages for reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ooh, Okay @Planeshifter, Now I got it. Thanks for the clarification.

@kgryte
Copy link
Member

kgryte commented Jun 10, 2024

@RidamGarg You'll want to address the small comments in a follow-up PR.

cc @Planeshifter

aman-095 pushed a commit to aman-095/stdlib that referenced this pull request Jun 11, 2024
PR-URL: stdlib-js#2342
Closes: stdlib-js#2318

---------

Signed-off-by: Ridam Garg <ridamgarg8979@gmail>
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
Co-authored-by: RidamGarg <ridamgarg8979@gmail>
Co-authored-by: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com>
Co-authored-by: Philipp Burckhardt <pburckhardt@outlook.com>
aman-095 pushed a commit to aman-095/stdlib that referenced this pull request Jun 13, 2024
PR-URL: stdlib-js#2342
Closes: stdlib-js#2318

---------

Signed-off-by: Ridam Garg <ridamgarg8979@gmail>
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
Co-authored-by: RidamGarg <ridamgarg8979@gmail>
Co-authored-by: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com>
Co-authored-by: Philipp Burckhardt <pburckhardt@outlook.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. Math Issue or pull request specific to math functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC]: add @stdlib/math/base/special/nanmin
4 participants