Skip to content

Use sp.integrate.trapezoid instead of np.trapezoid#33

Merged
lispandfound merged 2 commits intomainfrom
trapezoid
Feb 21, 2025
Merged

Use sp.integrate.trapezoid instead of np.trapezoid#33
lispandfound merged 2 commits intomainfrom
trapezoid

Conversation

@lispandfound
Copy link
Copy Markdown
Contributor

In migrating to numpy 2, we replaced np.trapz with np.trapezoid because np.trapz was removed from numpy version 2. However, np.trapezoid was new to numpy 2, which means the code no longer works with any numpy version except 2.x. Obviously, this is not desirable and hence this PR uses sp.integrate.trapezoid, which means that the code works with all versions of numpy.

@lispandfound lispandfound changed the title Use scipy.integrate.trapezoid instead of np.trapezoid Use sp.integrate.trapezoid instead of np.trapezoid Feb 20, 2025
@lispandfound
Copy link
Copy Markdown
Contributor Author

Note this is a pretty standard resolution approach to the numpy 2 problem, see e.g. https://gitlab.com/ase/ase/-/merge_requests/3559.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This workflow was never supposed to be here. The coverage action is in the pytest file.

@lispandfound lispandfound merged commit 4fd50d3 into main Feb 21, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants