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: add trapezoid as the new name for trapz #25738

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

rgommers
Copy link
Member

Rather than pointing users at scipy.interpolate.trapezoid, we keep the functionality in NumPy after the discussion in gh-25586. trapz stays deprecated, and will be removed in the future. But this change makes the change for users who don't want to depend on SciPy a lot easier.

Closes gh-25586

# into a new Python function which requires `__code__` and a few other
# attributes. So we create a dummy clone and copy over its attributes allowing
# SciPy <= 1.10 to work: https://github.com/scipy/scipy/issues/17811
assert not hasattr(trapz, "__code__")
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a regular cleanup, not directly related to trapz/trapezoid. It's a workaround that is simply no longer needed; it's been fixed in SciPy for a while, and older releases don't support numpy 2.0

Rather than pointing users at ``scipy.interpolate.trapezoid``, we
keep the functionality in NumPy after the discussion in numpygh-25586.

`trapz` stays deprecated, and will be removed in the future. But
this change makes the change for users who don't want to depend on
SciPy a lot easier.

Closes numpygh-25586

[skip cirrus]
Copy link
Member

@mtsokol mtsokol left a comment

Choose a reason for hiding this comment

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

LGTM!

@seberg
Copy link
Member

seberg commented Feb 2, 2024

LGTM, thanks Ralf.

@seberg seberg merged commit 9a65039 into numpy:main Feb 2, 2024
60 checks passed
bmwoodruff added a commit to bmwoodruff/numpy that referenced this pull request Jun 8, 2024
This PR adds back the links that were removed from `trapz`
in PR numpy#24445, finishing the migration to `trapezoid`
in PR numpy#25738. Currently, no web docs appear for `trapezoid`.
bmwoodruff added a commit to bmwoodruff/numpy that referenced this pull request Jun 8, 2024
This PR adds back the links that were removed from `trapz`
in PR numpy#24445, finishing the migration to `trapezoid`
in PR numpy#25738. Currently, no web docs appear for `trapezoid`.

[skip actions] [skip azp] [skip cirrus]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DEP: do not deprecate the trapezoidal rule
4 participants