From 09c580f2daf8892929af7ba514699efeb1e48199 Mon Sep 17 00:00:00 2001 From: KD1880 Date: Wed, 11 Mar 2026 23:55:32 +0530 Subject: [PATCH 1/2] DOC: fix doctests in pca.py for newer NumPy output format --- package/MDAnalysis/analysis/pca.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/package/MDAnalysis/analysis/pca.py b/package/MDAnalysis/analysis/pca.py index fddbf7d0092..13d0f71a49e 100644 --- a/package/MDAnalysis/analysis/pca.py +++ b/package/MDAnalysis/analysis/pca.py @@ -688,10 +688,10 @@ def rmsip(self, other, n_components=None): .. testsetup:: - >>> import MDAnalysis as mda - >>> import MDAnalysis.analysis.pca as pca - >>> from MDAnalysis.tests.datafiles import PSF, DCD - >>> u = mda.Universe(PSF, DCD) + import MDAnalysis as mda + import MDAnalysis.analysis.pca as pca + from MDAnalysis.tests.datafiles import PSF, DCD + u = mda.Universe(PSF, DCD) You can compare the RMSIP between different intervals of the same trajectory. @@ -703,9 +703,9 @@ def rmsip(self, other, n_components=None): >>> second_interval = pca.PCA(u, select="backbone").run(start=25, stop=50) >>> last_interval = pca.PCA(u, select="backbone").run(start=75) >>> round(first_interval.rmsip(second_interval, n_components=3), 6) - 0.381476 + np.float64(0.381476) >>> round(first_interval.rmsip(last_interval, n_components=3), 6) - 0.174782 + np.float64(0.174782) See also @@ -870,10 +870,10 @@ def rmsip(a, b, n_components=None): .. testsetup:: - >>> import MDAnalysis as mda - >>> import MDAnalysis.analysis.pca as pca - >>> from MDAnalysis.tests.datafiles import PSF, DCD - >>> u = mda.Universe(PSF, DCD) + import MDAnalysis as mda + import MDAnalysis.analysis.pca as pca + from MDAnalysis.tests.datafiles import PSF, DCD + u = mda.Universe(PSF, DCD) You can compare the RMSIP between different intervals of the same trajectory. @@ -887,11 +887,11 @@ def rmsip(a, b, n_components=None): >>> round(pca.rmsip(first_interval.results.p_components.T, ... second_interval.results.p_components.T, ... n_components=3), 6) - 0.381476 + np.float64(0.381476) >>> round(pca.rmsip(first_interval.results.p_components.T, ... last_interval.results.p_components.T, ... n_components=3), 6) - 0.174782 + np.float64(0.174782) .. versionadded:: 1.0.0 From 394b3829fc3454c52de51e2d9e20d33959c6a5aa Mon Sep 17 00:00:00 2001 From: KD1880 Date: Thu, 12 Mar 2026 00:00:02 +0530 Subject: [PATCH 2/2] DOC: update CHANGELOG for PR #5301 --- package/CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/CHANGELOG b/package/CHANGELOG index 7b75455f196..1535ae56dda 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -21,6 +21,8 @@ The rules for this file: * 2.11.0 Fixes + * Fix doctests in pca.py for newer NumPy output format and testsetup blocks + (Issue #3925, PR #5301) * Fixes TypeError with np.int64 indexing in GSD Reader (Issue #5224) * Fixed bug in add_transformations allowing non-callable transformations (Issue #2558, PR #2558)