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

MAINT: Harmonized documentation for Interpolator classes #18413

Merged
merged 3 commits into from
May 10, 2023

Conversation

gjhuizing
Copy link
Contributor

Reference issue

#18165 (comment)

What does this implement/fix?

In the documentation, I harmonized and clarified the dimensions of the inputs of *Interpolator objects. I chose the (npoints, ndims) convention. In addition, since the legacy class interp1d uses the last axis and other interpolators use the first axis by default, I emphasized the default value in the docstring.

Additional information

This is a modest change but I'm hoping to motivate more ambitious harmonization of the interpolation module. In particular, naming the inputs points and values in all interpolators would make it easier for the user (see my original issue). In addition, some interpolators allow specifying the interpolation axis while others don't, which prevents the user from seamlessly interchanging one interpolator for another.

Best,

GJ

@gjhuizing gjhuizing requested a review from ev-br as a code owner May 3, 2023 09:10
@j-bowhay j-bowhay added scipy.interpolate Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org labels May 3, 2023
Copy link
Member

@ev-br ev-br left a comment

Choose a reason for hiding this comment

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

Looks good, several suggestions below.

scipy/interpolate/_cubic.py Outdated Show resolved Hide resolved
scipy/interpolate/_cubic.py Outdated Show resolved Hide resolved
scipy/interpolate/_cubic.py Outdated Show resolved Hide resolved
scipy/interpolate/_ndgriddata.py Outdated Show resolved Hide resolved
@ev-br ev-br added the needs-work Items that are pending response from the author label May 5, 2023
Copy link
Member

@ev-br ev-br left a comment

Choose a reason for hiding this comment

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

Looks good now, one optional suggestion below.
If you want to address it, please do; otherwise we can merge this PR as is.

axis : int, optional
Axis in the y array corresponding to the x-coordinate values.
Axis in the ``y`` array corresponding to the x-coordinate values. Defaults
to ``axis=0``.
Copy link
Member

Choose a reason for hiding this comment

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

So you wanted to stress that by default it's the first axis; do you want try keeping it two ways? Defaults to the first axis, axis=0 or some such?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instead, I stressed that unlike other interpolators, the interpolation axis in interp1d is the last one. So as far as I'm concerned I'm happy with this sentence

Copy link
Member

@ev-br ev-br left a comment

Choose a reason for hiding this comment

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

Looks good now, one optional suggestion below.
If you want to address it, please do; otherwise we can merge this PR as is.

Copy link
Member

@ev-br ev-br left a comment

Choose a reason for hiding this comment

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

Looks good now, one optional suggestion below.
If you want to address it, please do; otherwise we can merge this PR as is.

@ev-br ev-br removed the needs-work Items that are pending response from the author label May 6, 2023
@ev-br ev-br merged commit acdfdfd into scipy:main May 10, 2023
20 checks passed
@ev-br
Copy link
Member

ev-br commented May 10, 2023

Thank you @gjhuizing and congartulations with what I believe is your first scipy commit. Keep them coming!

@ev-br ev-br added this to the 1.11.0 milestone May 10, 2023
@gjhuizing
Copy link
Contributor Author

Thanks a lot for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org scipy.interpolate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants