From e1e10e7df86b4fc746f22bb12e58722ad4f7e87f Mon Sep 17 00:00:00 2001 From: Irfan Alibay Date: Fri, 3 Nov 2023 11:27:47 +0000 Subject: [PATCH] scipy.integrate.simps deprecation Switch to scipy.integrate.simpson - note that the `even` keyword now defaults to Simpson's rule compared to `avg` in scipy.integrate.simps. --- package/MDAnalysis/analysis/pca.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/MDAnalysis/analysis/pca.py b/package/MDAnalysis/analysis/pca.py index 86fed22bb91..cad6946b2dc 100644 --- a/package/MDAnalysis/analysis/pca.py +++ b/package/MDAnalysis/analysis/pca.py @@ -747,8 +747,8 @@ def cosine_content(pca_space, i): t = np.arange(len(pca_space)) T = len(pca_space) cos = np.cos(np.pi * t * (i + 1) / T) - return ((2.0 / T) * (scipy.integrate.simps(cos*pca_space[:, i])) ** 2 / - scipy.integrate.simps(pca_space[:, i] ** 2)) + return ((2.0 / T) * (scipy.integrate.simpson(cos*pca_space[:, i])) ** 2 / + scipy.integrate.simpson(pca_space[:, i] ** 2)) @due.dcite(