diff --git a/package/CHANGELOG b/package/CHANGELOG index 7472c476ed..e59f1b068d 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -21,6 +21,8 @@ The rules for this file: * 2.8.0 Fixes + * Fix doctest errors of analysis/pca.py related to rounding issues + (Issue #3925, PR #4377) * Convert openmm Quantity to raw value for KE and PE in OpenMMSimulationReader. * Atomname methods can handle empty groups (Issue #2879, PR #4529) * Add support for TPR files produced by Gromacs 2024.1 (PR #4523) diff --git a/package/MDAnalysis/analysis/pca.py b/package/MDAnalysis/analysis/pca.py index 280f7c2a8d..e4818aabf2 100644 --- a/package/MDAnalysis/analysis/pca.py +++ b/package/MDAnalysis/analysis/pca.py @@ -650,10 +650,10 @@ def rmsip(self, other, n_components=None): >>> first_interval = pca.PCA(u, select="backbone").run(start=0, stop=25) >>> second_interval = pca.PCA(u, select="backbone").run(start=25, stop=50) >>> last_interval = pca.PCA(u, select="backbone").run(start=75) - >>> first_interval.rmsip(second_interval, n_components=3) - 0.38147609331128324 - >>> first_interval.rmsip(last_interval, n_components=3) - 0.17478244043688052 + >>> round(first_interval.rmsip(second_interval, n_components=3), 6) + 0.381476 + >>> round(first_interval.rmsip(last_interval, n_components=3), 6) + 0.174782 See also @@ -826,14 +826,14 @@ def rmsip(a, b, n_components=None): >>> first_interval = pca.PCA(u, select="backbone").run(start=0, stop=25) >>> second_interval = pca.PCA(u, select="backbone").run(start=25, stop=50) >>> last_interval = pca.PCA(u, select="backbone").run(start=75) - >>> pca.rmsip(first_interval.results.p_components.T, + >>> round(pca.rmsip(first_interval.results.p_components.T, ... second_interval.results.p_components.T, - ... n_components=3) - 0.38147609331128324 - >>> pca.rmsip(first_interval.results.p_components.T, + ... n_components=3), 6) + 0.381476 + >>> round(pca.rmsip(first_interval.results.p_components.T, ... last_interval.results.p_components.T, - ... n_components=3) - 0.17478244043688052 + ... n_components=3), 6) + 0.174782 .. versionadded:: 1.0.0