Skip to content

Commit 5725da1

Browse files
Merge pull request #35 from FormingWorlds/tl/deprecation_fixes
Fix NumPy 2.0 deprecation: replace np.trapz with np.trapezoid
2 parents fa36334 + 8299154 commit 5725da1

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/mors/spectrum.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ def CalcBandFluxes(self):
106106
# With idxs defined, integrate over band
107107
band_wl = self.wl[idxs]
108108
band_fl = self.fl[idxs]
109-
self.fl_integ[b] = np.trapz(band_fl,band_wl)
109+
self.fl_integ[b] = np.trapezoid(band_fl,band_wl)
110110

111111
# Reset idxs
112112
idxs = []
113113

114114
# For bolometric "band"
115-
self.fl_integ["bo"] = np.trapz(self.fl,self.wl)
115+
self.fl_integ["bo"] = np.trapezoid(self.fl,self.wl)
116116

117117
return self.fl_integ
118118

src/mors/synthesis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def GetProperties(Mstar:float, pctle:float, age:float):
7070
wl_pl = np.logspace(np.log10(spec.bands_limits["pl"][0]), np.log10(spec.bands_limits["pl"][1]), 1000)
7171
fl_pl = spec.PlanckFunction_surf(wl_pl, Tstar)
7272
fl_pl = spec.ScaleTo1AU(fl_pl, Rstar)
73-
out["F_pl"] = np.trapz(fl_pl, wl_pl)
73+
out["F_pl"] = np.trapezoid(fl_pl, wl_pl)
7474
out["L_pl"] = out["F_pl"] * area
7575

7676
# Get flux of UV band from remainder

0 commit comments

Comments
 (0)