From 53f5d93a6d3ace8078fb7dabfa5041a7879ac494 Mon Sep 17 00:00:00 2001 From: Greg Lucas Date: Sun, 12 Feb 2023 14:00:48 -0700 Subject: [PATCH] MNT: Change np.complex to builtin complex Numpy deprecated np.complex --- bezpy/mt/site.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bezpy/mt/site.py b/bezpy/mt/site.py index 89516eb..2e3f4ec 100644 --- a/bezpy/mt/site.py +++ b/bezpy/mt/site.py @@ -127,7 +127,7 @@ def spline_interp(self, freqs, logspace=True, extrapolate=1, interp_periods = 1./np.asarray(freqs) # Output Z - Z_interp = np.zeros((ncomponents, len(interp_periods)), dtype=np.complex) + Z_interp = np.zeros((ncomponents, len(interp_periods)), dtype=complex) if logspace: periods = np.log10(self.periods) @@ -285,13 +285,13 @@ def calcZ(self, freqs): k = np.sqrt(1j*omega[np.newaxis, :]*MU/resistivities[:, np.newaxis]) # eq. 6 - Z = np.zeros(shape=(n, nfreq), dtype=np.complex) + Z = np.zeros(shape=(n, nfreq), dtype=complex) # DC frequency produces divide by zero errors with np.errstate(divide='ignore', invalid='ignore'): Z[-1, :] = complex_factor/k[-1, :] # eq. 7 (reflection coefficient at interface) - r = np.zeros(shape=(n, nfreq), dtype=np.complex) + r = np.zeros(shape=(n, nfreq), dtype=complex) for i in range(n-2, -1, -1): r[i, :] = ((1-k[i, :]*Z[i+1, :]/complex_factor) / @@ -304,7 +304,7 @@ def calcZ(self, freqs): Z[:, 0] = 0. # Return a 3d impedance [0, Z; -Z, 0] - Z_output = np.zeros(shape=(4, nfreq), dtype=np.complex) + Z_output = np.zeros(shape=(4, nfreq), dtype=complex) # Only return the top layer impedance # Z_factor is conversion from H->B, 1.e-3/MU Z_output[1, :] = Z[0, :]*(1.e-3/MU)