Closed asarigun closed 5 months ago
:+1: look good - was scipy.trapezoid
available in earlier versions too (just thinking how far back we need to pin scipy)
Exists since 1.7.0, I think.
One option to avoid a lower bound bump is a pattern like this:
trapezoid_available = check_scipy_ge_17()
if trapezoid_available:
from scipy.integrate import trapezoid
else:
from scipy.integrate import trapz as trapezoid
question, what is rough ETA on this being in a release? Depending on lifelines
in skpro
, so I'm asking whether we need to add a scipy<1.14
modifier to lifelines
estimators, or whether the release will fix the issue in timely manner.
My CI pipeline is broken due to this issue as well, wondering if I need to downgrade scipy
?
I can get this in today. I just want to review the rest of scipy 1.14 first.
My CI pipeline is broken due to this issue as well, wondering if I need to downgrade
scipy
?
for me, pandas
has been behaving like this for a while (mostly around index freq
), I really hope it's not the start of a similar saga with scipy
...
for the conditional checking, code snippet that uses packaging
in case it's useful:
def check_scipy_ge_17():
import importlib.metadaa
import importlib.util
from packaging.version import InvalidVersion, Version
package_name = "scipy"
required_version = "1.7.0"
package_spec = importlib.util.find_spec(package_name)
if package_spec is not None:
installed_version = importlib.metadata.version(package_name)
try:
return Version(installed_version) >= Version(required_version)
except InvalidVersion:
pass
return False
for me, pandas has been behaving like this for a while (mostly around index freq), I really hope it's not the start of a similar saga with scipy...
that is, does lifelines need updates to pandas code too?
Changing
trapz
totrapezoid
for scipy 1.14.0.Solution for Issue #1618