Skip to content
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

DOC: Make input/output type consistent and add more examples for documentation #23611

Merged
merged 5 commits into from
Dec 31, 2023

Conversation

Sarah-Yifei-Wang
Copy link
Contributor

@Sarah-Yifei-Wang Sarah-Yifei-Wang commented Apr 19, 2023

I noticed in quite a few scimath function, the input type is array_like, but output type is ndarray or scalar. Initially this caused some confusion for me, making me feel input does not contain scale. To avoid future confusion, this PR is to:

  1. make input type and output type consistent using array_like
  2. add examples using scalar as input

@Sarah-Yifei-Wang
Copy link
Contributor Author

Wonder if anyone knows how to fix the failed tests related to old_gcc and armv7_simd_test? Thanks in advance!

Copy link
Contributor

@rossbar rossbar left a comment

Choose a reason for hiding this comment

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

There's no need for the updated parameter descriptions, array_like encompasses scalars.

@Sarah-Yifei-Wang
Copy link
Contributor Author

Got it! Thanks for the explanation. It looks like sometimes the input type uses "array_like" but output type uses "ndarray or scalar", I think that's what caused the confusion. I can update to make them consistent!

@Sarah-Yifei-Wang Sarah-Yifei-Wang changed the title DOC: Missing supported scalar type in scimath documentation DOC: Make input/output type consistent and add more examples for documentation Apr 20, 2023
numpy/lib/scimath.py Outdated Show resolved Hide resolved
numpy/lib/scimath.py Outdated Show resolved Hide resolved
numpy/lib/scimath.py Outdated Show resolved Hide resolved
numpy/lib/scimath.py Outdated Show resolved Hide resolved
numpy/lib/scimath.py Outdated Show resolved Hide resolved
[skip cirrus] [skip azp] [skip actions]
Copy link
Contributor

@mdhaber mdhaber left a comment

Choose a reason for hiding this comment

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

The examples in which the output is a scalar LGTM. I'll go ahead and merge if CI looks good. Thanks @Sarah-Yifei-Wang.

[skip azp] [skip actions] [skip cirrus]
@mdhaber mdhaber merged commit 36eefea into numpy:main Dec 31, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants