Closed og113 closed 1 month ago
Thanks for doing this! I'm a little wary of killing support for Python 2 just because of a name change in scipy though. Any reason not to do
try:
from scipy.integrate import cumulative_trapezoid, simpson
except ImportError:
# scipy.version < 1.6
from scipy.integrate import cumtrapz as cumulative_trapezoid
from scipy.integrate import simps as simpson
instead?
Yeah, your suggestion seems a good one to me.
I've updated the PR with your suggestion @clwainwright , and undone the changes to setup.py.
Hey @clwainwright, I just wanted to check in and ask if you had any further suggestions re this PR?
Sorry for taking so long to merge this in! It's been kind of a crazy few weeks.
Yes, this looks good. I'll get it out on PyPI shortly.
In SciPy v1.6 the names of two functions used in CosmoTransitions were renamed:
scipy.integrate.simps
was renamedscipy.integrate.simpson
andscipy.integrate.cumtrapz
was renamedscipy.integrate.cumulative_trapezoid
. Until now, the old names of these two functions have been kept around for backwards compatability.In SciPy v1.14 the old names will be removed; see here and here. Also in SciPy v1.14, the simpson function must have the keyword argument
x=...
passed with the keyword explicit. In v1.12 there is a deprecation warning for this.To avoid CosmoTransitions breaking when SciPy v1.14 comes around, in this PR two lines of source code have been changed. Note however, this PR would break CosmoTransitions for SciPy versions older than 1.6.0 (and hence NumPy versions older than 1.16.5 and Python versions older than 3.7, see here). So, the version requirements in the setup.py file have been changed in this PR to reflect this. As a consequence, this PR also bumps the minor version number.