Repository navigation
Remove np.ndarray.ptp() mention from the docs - #16583
Conversation
The `numpy.ndarray.ptp()` method was removed in 2.0, so trying to refer to it is causing documentation build failures.
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
| This is similar to :meth:`~numpy.ndarray.ptp`, but adapted to ensure | ||
| that the full precision given by the two doubles ``jd1`` and ``jd2`` | ||
| is used. | ||
| This method is similar to the :func:`numpy.ptp` function, but |
There was a problem hiding this comment.
good catch, though I'm thinking the phrasing might become increasingly confusing as numpy 1.x fades away in usage. How about this ?
| This method is similar to the :func:`numpy.ptp` function, but | |
| This method is similar to the :func:`numpy.ptp` legacy function, but |
There was a problem hiding this comment.
The np.ndarray.ptp() method has been removed, but the np.ptp() function is still there and I am not aware of any plans to remove it, so it's not a legacy function.
There was a problem hiding this comment.
see ? it is confusing 😅
(thanks for clarifying)
There was a problem hiding this comment.
Yes, not a legacy function. However, since we are deprecating this method, perhaps the text should still be adjusted. How about,
This method is meant to mimic the same method on `~numpy.ndarray`, but
adapted to ensure that the full precision given by the two doubles
``jd1`` and ``jd2`` is used. It is deprecated when using numpy 2.0, since
the `~numpy.ndarray` method has been removed in that version.
There was a problem hiding this comment.
We should not mention deprecations in docstrings because our deprecated decorator edits docstrings automatically. If the default text deprecated adds to the docstring is not good enough then a custom text should be specified through the decorator's message argument.
This pull request was meant to be a quick fix to prevent documentation builds from failing, so discussing how to phrase the deprecation message delays merging and causes problems in other pull requests.
|
I created the v6.1.2 milestone. |
mhvk
left a comment
There was a problem hiding this comment.
Yes, thanks! A slight suggested edit to the docstring in-line.
| This is similar to :meth:`~numpy.ndarray.ptp`, but adapted to ensure | ||
| that the full precision given by the two doubles ``jd1`` and ``jd2`` | ||
| is used. | ||
| This method is similar to the :func:`numpy.ptp` function, but |
There was a problem hiding this comment.
Yes, not a legacy function. However, since we are deprecating this method, perhaps the text should still be adjusted. How about,
This method is meant to mimic the same method on `~numpy.ndarray`, but
adapted to ensure that the full precision given by the two doubles
``jd1`` and ``jd2`` is used. It is deprecated when using numpy 2.0, since
the `~numpy.ndarray` method has been removed in that version.
|
In #16583 (reference) @neutrinoceros mentioned that perhaps we should just have deprecated |
|
For the users of |
mhvk
left a comment
There was a problem hiding this comment.
@eerovaher - you're right on all points - let's get this in!
…583-on-v6.1.x Backport PR #16583 on branch v6.1.x (Remove `np.ndarray.ptp()` mention from the docs)
Description
The
numpy.ndarray.ptp()method was removed in 2.0, so trying to refer to it is causing documentation build failures.This should be backported, but
astropy6.1.1 has already been released and the branch and milestone for 6.1.2 has not been created yet.