No module named scipy.integrate.quadrature
Closed this issue · 2 comments
I was trying to use Helita in a Jupyter notebook, and import statement have failed with the following error:
---> 10 from scipy.integrate.quadrature import cumtrapz
11 from scipy.interpolate import interp1d
12 from astropy import units as u
ModuleNotFoundError: No module named 'scipy.integrate.quadrature'
I've checked the SciPy documentation, and quadrature
is not a module but a function, and to fix that the following change is required in sources:
--- a/helita/vis/rh15d_vis.py
+++ b/helita/vis/rh15d_vis.py
-from scipy.integrate.quadrature import cumtrapz
+from scipy.integrate import quadrature
+from scipy.integrate import cumtrapz
I can create a pull-request, if you want.
By the way, quadrature
doesn't seem to be used at all, so this line might even be deleted. Also, the cumtrapz
function seems to be renamed to cumulative_trapezoid
in latest versions if SciPy.
I've also put here another issue with Jupyter notebooks from RH15D repository, but then I realized that it will be better to post it there.
These commands were based on an earlier version of Scipy, I suppose. So in case, somebody uses the older version they might end up having issues.
This was the old location in Scipy. Since Scipy 1.6.0 has been out for less than a month, and using cumulative_trapezoid
is not backwards compatible, I still use cumtrapz
but updated the location in 1697292.