Skip to content

Fix NumPy 2.0 deprecation: replace np.trapz with np.trapezoid#35

Merged
timlichtenberg merged 2 commits into
mainfrom
tl/deprecation_fixes
Dec 31, 2025
Merged

Fix NumPy 2.0 deprecation: replace np.trapz with np.trapezoid#35
timlichtenberg merged 2 commits into
mainfrom
tl/deprecation_fixes

Conversation

@timlichtenberg

Copy link
Copy Markdown
Member

This pull request updates the numerical integration method used in the CalcBandFluxes function of src/mors/spectrum.py. The change replaces the deprecated np.trapz function with the newer np.trapezoid function from NumPy to ensure compatibility with recent versions of the library. Related to FormingWorlds/PROTEUS#568. @stuitje @nichollsh This addresses one issue discussed on Discord and in FormingWorlds/PROTEUS#575, but not the other issue that @stuitje is working on inside MORS. Apologies for me stumbling into this, but I had to fix this quickly to be able to move on with some other PROTEUS-level implementation.

Numerical integration method update:

  • Replaced np.trapz with np.trapezoid for integrating flux over wavelength bands and for the bolometric band in the CalcBandFluxes method.

@timlichtenberg timlichtenberg requested a review from a team as a code owner December 31, 2025 13:34
@timlichtenberg

Copy link
Copy Markdown
Member Author

readthedocs build failed, but unrelated to changes.

@timlichtenberg timlichtenberg merged commit 5725da1 into main Dec 31, 2025
6 of 7 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.

1 participant