Skip to content

Commit 09c580f

Browse files
committed
DOC: fix doctests in pca.py for newer NumPy output format
1 parent 9531c6e commit 09c580f

File tree

1 file changed

+12
-12
lines changed
  • package/MDAnalysis/analysis

1 file changed

+12
-12
lines changed

package/MDAnalysis/analysis/pca.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -688,10 +688,10 @@ def rmsip(self, other, n_components=None):
688688
689689
.. testsetup::
690690
691-
>>> import MDAnalysis as mda
692-
>>> import MDAnalysis.analysis.pca as pca
693-
>>> from MDAnalysis.tests.datafiles import PSF, DCD
694-
>>> u = mda.Universe(PSF, DCD)
691+
import MDAnalysis as mda
692+
import MDAnalysis.analysis.pca as pca
693+
from MDAnalysis.tests.datafiles import PSF, DCD
694+
u = mda.Universe(PSF, DCD)
695695
696696
697697
You can compare the RMSIP between different intervals of the same trajectory.
@@ -703,9 +703,9 @@ def rmsip(self, other, n_components=None):
703703
>>> second_interval = pca.PCA(u, select="backbone").run(start=25, stop=50)
704704
>>> last_interval = pca.PCA(u, select="backbone").run(start=75)
705705
>>> round(first_interval.rmsip(second_interval, n_components=3), 6)
706-
0.381476
706+
np.float64(0.381476)
707707
>>> round(first_interval.rmsip(last_interval, n_components=3), 6)
708-
0.174782
708+
np.float64(0.174782)
709709
710710
711711
See also
@@ -870,10 +870,10 @@ def rmsip(a, b, n_components=None):
870870
871871
.. testsetup::
872872
873-
>>> import MDAnalysis as mda
874-
>>> import MDAnalysis.analysis.pca as pca
875-
>>> from MDAnalysis.tests.datafiles import PSF, DCD
876-
>>> u = mda.Universe(PSF, DCD)
873+
import MDAnalysis as mda
874+
import MDAnalysis.analysis.pca as pca
875+
from MDAnalysis.tests.datafiles import PSF, DCD
876+
u = mda.Universe(PSF, DCD)
877877
878878
879879
You can compare the RMSIP between different intervals of the same trajectory.
@@ -887,11 +887,11 @@ def rmsip(a, b, n_components=None):
887887
>>> round(pca.rmsip(first_interval.results.p_components.T,
888888
... second_interval.results.p_components.T,
889889
... n_components=3), 6)
890-
0.381476
890+
np.float64(0.381476)
891891
>>> round(pca.rmsip(first_interval.results.p_components.T,
892892
... last_interval.results.p_components.T,
893893
... n_components=3), 6)
894-
0.174782
894+
np.float64(0.174782)
895895
896896
897897
.. versionadded:: 1.0.0

0 commit comments

Comments
 (0)