Skip to content

Commit 88fc4ae

Browse files
committed
fix: update examples to numpy 2
1 parent 6d353a3 commit 88fc4ae

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

EMpy/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ def interp2(x, y, xp, yp, fp):
12071207

12081208
def trapz2(f, x=None, y=None, dx=1.0, dy=1.0):
12091209
"""Double integrate."""
1210-
return numpy.trapz(numpy.trapz(f, x=y, dx=dy), x=x, dx=dx)
1210+
return numpy.trapezoid(numpy.trapezoid(f, x=y, dx=dy), x=x, dx=dx)
12111211

12121212

12131213
def centered1d(x):

examples/ex_laser_etch_monitor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ def n_AlGaAs95(w):
110110

111111
# DBR mirror periods, at 1/4-wavelength thicknesses
112112
wl_center = 1100e-9
113-
d_GaAs_DBR = wl_center / n_GaAs(wl_center).real / 4
114-
d_AlGaAs_DBR = wl_center / n_AlGaAs95(wl_center).real / 4
113+
d_GaAs_DBR = wl_center / n_GaAs(wl_center)[0].real / 4
114+
d_AlGaAs_DBR = wl_center / n_AlGaAs95(wl_center)[0].real / 4
115115

116116

117117
# Build the Multilayer stack

0 commit comments

Comments
 (0)