From f17eff758a31207fc17449dbb5130cfcaa95860a Mon Sep 17 00:00:00 2001 From: "Montare, Aidan A. (Fed)" Date: Fri, 3 May 2024 17:16:00 -0600 Subject: [PATCH] switch to scipy.integrate.simpson scipy.integrate.simps was deprecated in scipy 1.12.0 and will be removed in 1.14 https://docs.scipy.org/doc/scipy/release/1.12.0-notes.html#deprecated-features This does introduce a requirement of scipy>=1.6.0, which is when scipy.integrate.simpson was introduced https://docs.scipy.org/doc/scipy/release/1.6.0-notes.html#scipy-integrate-improvements --- allantools/allantools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/allantools/allantools.py b/allantools/allantools.py index 583e97a..2c21462 100644 --- a/allantools/allantools.py +++ b/allantools/allantools.py @@ -111,7 +111,7 @@ import json import numpy as np from scipy import interpolate # used in psd2allan() -from scipy.integrate import simps # used in psd2allan() +from scipy.integrate import simpson # used in psd2allan() from . import ci # edf, confidence intervals @@ -1756,7 +1756,7 @@ def psd2allan(S_y, f=1.0, kind='adev', base=2): for idx, mj in enumerate(m)]) integrand = np.insert(integrand, 0, 0.0, axis=1) f = np.insert(f, 0, 0.0) - ad = np.sqrt(2.0 * simps(integrand, f)) + ad = np.sqrt(2.0 * simpson(integrand, f)) return taus_used, ad