From b91383c1db3fcbcd1a55653f56d2ce37cae92be5 Mon Sep 17 00:00:00 2001 From: Matthew Kirk <35800961+MJKirk@users.noreply.github.com> Date: Tue, 14 Jul 2020 15:58:31 +0100 Subject: [PATCH] Fixes import error from recent scipy upgrade (#111) --- flavio/math/integrate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flavio/math/integrate.py b/flavio/math/integrate.py index 67e9cbaa..69411a2f 100644 --- a/flavio/math/integrate.py +++ b/flavio/math/integrate.py @@ -1,7 +1,10 @@ import scipy import numpy as np import warnings -from scipy.integrate.quadrature import AccuracyWarning +try: + from scipy.integrate import AccuracyWarning # scipy >= 1.5.0 +except ImportError: + from scipy.integrate.quadrature import AccuracyWarning # scipy <= 1.4.1 def nintegrate(f, a, b, epsrel=0.005, **kwargs): with warnings.catch_warnings():