diff --git a/dsharp_opac/dsharp_opac.py b/dsharp_opac/dsharp_opac.py index 9becb6a..6909b23 100755 --- a/dsharp_opac/dsharp_opac.py +++ b/dsharp_opac/dsharp_opac.py @@ -1423,7 +1423,8 @@ def nk(self, lam): k : float : imaginary part of mixed optical property """ - from mpmath import findroot + from scipy.optimize import newton + l_arr = np.array(lam, ndmin=1) eps_mean = np.empty(np.shape(l_arr)).astype('complex') @@ -1439,7 +1440,7 @@ def nk(self, lam): # def fct(x): return sum(self.abundances * ((eps - x) / (eps + 2 * x))) - eps_mean[i] = complex(findroot(fct, complex(0.5, 0.5))) + eps_mean[i] = newton(fct, x0=(0.5 + 0.5j)) elif self.rule.lower() == 'maxwell-garnett': # # kataoka et al. 2014, eq. 3 diff --git a/pyproject.toml b/pyproject.toml index 6baa0ba..93bcbfc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,9 +20,6 @@ dependencies = [ "scipy>=1.13.0", "matplotlib>=3.8.0", "astropy>=7.0.0", - - # only need mpmath.findroot, which I suspect scipy.optimize.fsolve can replace - "mpmath>=1.3.0", ] [project.urls]