Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timestep #4447

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
30 changes: 22 additions & 8 deletions package/MDAnalysis/coordinates/timestep.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -493,17 +493,31 @@ cdef class Timestep:
vectors lengths followed by their respective angle, or as three
triclinic vectors.

>>> ts.dimensions
array([ 13., 14., 15., 90., 90., 90.], dtype=float32)
>>> ts.triclinic_dimensions
array([[ 13., 0., 0.],
[ 0., 14., 0.],
[ 0., 0., 15.]], dtype=float32)
.. testsetup::

>>> import MDAnalysis as mda
>>> from MDAnalysis.tests.datafiles import TPR, XTC
>>> import numpy as np

.. doctest::

>>> u = mda.Universe(TPR, XTC)
>>> ts_1 = u.trajectory[0]
>>> ts_1.dimensions
array([80.13008, 80.13008, 80.13008, 60. , 60. , 90. ], dtype=float32)
>>> ts_1.triclinic_dimensions
array([[80.13008 , 0. , 0. ],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You made some progress, but now the doctest if failing on comparison with this array, try and reduce the precision of the comparison. Have a detailed look at the output of make doctest to see if your changes are working

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hmacdope . I rounded the values. it does reflect in doctest.


Results of doctest builder run on 2024-02-20 09:17:35
=====================================================

Document: documentation_pages/core/groups
-----------------------------------------
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    ag2.ix
Expected:
    array([2, 1, 0], dtype=int64)
Got:
    array([2, 1, 0])
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    ag3.ix
Expected:
    array([0, 1, 2], dtype=int64)
Got:
    array([0, 1, 2])
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    u.atoms[[2, 1, 1, 0, 1]].asunique(sorted=False).ix
Expected:
    array([2, 1, 0], dtype=int64)
Got:
    array([2, 1, 0])
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    ag.groupby('masses')
Expected:
    {12.010999999999999: <AtomGroup with 462 atoms>,
     14.007: <AtomGroup with 116 atoms>,
     15.999000000000001: <AtomGroup with 134 atoms>}
Got:
    {1.008: <AtomGroup with 2 atoms>, 14.007: <AtomGroup with 1 atom>}
**********************************************************************
File "None", line ?, in default
Failed example:
    ag.groupby(['resnames', 'masses'])
Expected:
    {('ALA', 1.008): <AtomGroup with 95 atoms>,
     ('ALA', 12.011): <AtomGroup with 57 atoms>,
     ('ALA', 14.007): <AtomGroup with 19 atoms>,
     ('ALA', 15.999): <AtomGroup with 19 atoms>},
     ('ARG', 1.008): <AtomGroup with 169 atoms>,
     ...}
Got:
    {('MET', 1.008): <AtomGroup with 2 atoms>, ('MET', 14.007): <AtomGroup with 1 atom>}
**********************************************************************
File "None", line ?, in default
Failed example:
    ag.groupby(['resnames', 'masses'])('ALA', 15.999)
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[0]>", line 1, in <module>
        ag.groupby(['resnames', 'masses'])('ALA', 15.999)
    TypeError: 'dict' object is not callable
**********************************************************************
File "None", line ?, in default
Failed example:
    sel = universe.select_atoms('resname MET GLY')
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[0]>", line 1, in <module>
        sel = universe.select_atoms('resname MET GLY')
              ^^^^^^^^
    NameError: name 'universe' is not defined
**********************************************************************
File "None", line ?, in default
Failed example:
    sel = universe.select_atoms('resname MET or resname GLY')
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[0]>", line 1, in <module>
        sel = universe.select_atoms('resname MET or resname GLY')
              ^^^^^^^^
    NameError: name 'universe' is not defined
**********************************************************************
File "None", line ?, in default
Failed example:
    sel = universe.select_atoms("segid DMPC and not ( name H* O* )")
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[0]>", line 1, in <module>
        sel = universe.select_atoms("segid DMPC and not ( name H* O* )")
              ^^^^^^^^
    NameError: name 'universe' is not defined
**********************************************************************
File "None", line ?, in default
Failed example:
    sel
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[1]>", line 1, in <module>
        sel
    NameError: name 'sel' is not defined. Did you mean: 'set'?
**********************************************************************
File "None", line ?, in default
Failed example:
    universe.select_atoms("around 10 group notHO", notHO=sel)
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[0]>", line 1, in <module>
        universe.select_atoms("around 10 group notHO", notHO=sel)
        ^^^^^^^^
    NameError: name 'universe' is not defined
**********************************************************************
File "None", line ?, in default
Failed example:
    universe.select_atoms("resname SOL and around 2.0 protein", updating=True)
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[0]>", line 1, in <module>
        universe.select_atoms("resname SOL and around 2.0 protein", updating=True)
        ^^^^^^^^
    NameError: name 'universe' is not defined
**********************************************************************
File "None", line ?, in default
Failed example:
    universe.select_atoms("C", smarts_kwargs={"maxMatches": 100})
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[0]>", line 1, in <module>
        universe.select_atoms("C", smarts_kwargs={"maxMatches": 100})
        ^^^^^^^^
    NameError: name 'universe' is not defined
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    ag1.indices
Expected:
    array([3, 3, 1, 1])
Got:
    array([3, 3, 2, 2, 1, 1])
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    ag3.indices  # 0 and 1 are only in ag1, 4 and 6 are only in ag2
Expected:
    [0, 1, 4, 6]
Got:
    array([0, 1, 4, 6])
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    ag.ix
Expected:
    array([2, 1, 2, 2, 1, 0], dtype=int64)
Got:
    array([2, 1, 2, 2, 1, 0])
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    ag2.ix
Expected:
    array([0, 1, 2], dtype=int64)
Got:
    array([0, 1, 2])
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    rg2.ix
Expected:
    array([0, 1, 2])
Got:
    array([2, 1, 0])
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    ag.groupby('masses')
Expected:
    {12.010999999999999: <AtomGroup with 462 atoms>,
     14.007: <AtomGroup with 116 atoms>,
     15.999000000000001: <AtomGroup with 134 atoms>}
Got:
    {32.06: <AtomGroup with 7 atoms>, 1.008: <AtomGroup with 1685 atoms>, 12.011: <AtomGroup with 1040 atoms>, 14.007: <AtomGroup with 289 atoms>, 15.999: <AtomGroup with 320 atoms>}
**********************************************************************
File "None", line ?, in default
Failed example:
    ag.groupby(['resnames', 'masses'])
Expected:
    {('ALA', 1.008): <AtomGroup with 95 atoms>,
     ('ALA', 12.011): <AtomGroup with 57 atoms>,
     ('ALA', 14.007): <AtomGroup with 19 atoms>,
     ('ALA', 15.999): <AtomGroup with 19 atoms>},
     ('ARG', 1.008): <AtomGroup with 169 atoms>,
     ...}
Got:
    {('ALA', 1.008): <AtomGroup with 95 atoms>, ('ALA', 12.011): <AtomGroup with 57 atoms>, ('ALA', 14.007): <AtomGroup with 19 atoms>, ('ALA', 15.999): <AtomGroup with 19 atoms>, ('PHE', 1.008): <AtomGroup with 45 atoms>, ('PHE', 12.011): <AtomGroup with 45 atoms>, ('PHE', 14.007): <AtomGroup with 5 atoms>, ('PHE', 15.999): <AtomGroup with 5 atoms>, ('CYS', 32.06): <AtomGroup with 1 atom>, ('CYS', 1.008): <AtomGroup with 5 atoms>, ('CYS', 12.011): <AtomGroup with 3 atoms>, ('CYS', 14.007): <AtomGroup with 1 atom>, ('CYS', 15.999): <AtomGroup with 1 atom>, ('THR', 1.008): <AtomGroup with 77 atoms>, ('THR', 12.011): <AtomGroup with 44 atoms>, ('THR', 14.007): <AtomGroup with 11 atoms>, ('THR', 15.999): <AtomGroup with 22 atoms>, ('HSD', 1.008): <AtomGroup with 21 atoms>, ('HSD', 12.011): <AtomGroup with 18 atoms>, ('HSD', 14.007): <AtomGroup with 9 atoms>, ('HSD', 15.999): <AtomGroup with 3 atoms>, ('GLN', 1.008): <AtomGroup with 64 atoms>, ('GLN', 12.011): <AtomGroup with 40 atoms>, ('GLN', 14.007): <AtomGroup with 16 atoms>, ('GLN', 15.999): <AtomGroup with 16 atoms>, ('TYR', 1.008): <AtomGroup with 63 atoms>, ('TYR', 12.011): <AtomGroup with 63 atoms>, ('TYR', 14.007): <AtomGroup with 7 atoms>, ('TYR', 15.999): <AtomGroup with 14 atoms>, ('ASN', 1.008): <AtomGroup with 24 atoms>, ('ASN', 12.011): <AtomGroup with 16 atoms>, ('ASN', 14.007): <AtomGroup with 8 atoms>, ('ASN', 15.999): <AtomGroup with 8 atoms>, ('GLY', 1.008): <AtomGroup with 60 atoms>, ('GLY', 12.011): <AtomGroup with 40 atoms>, ('GLY', 14.007): <AtomGroup with 20 atoms>, ('GLY', 15.999): <AtomGroup with 21 atoms>, ('ASP', 1.008): <AtomGroup with 68 atoms>, ('ASP', 12.011): <AtomGroup with 68 atoms>, ('ASP', 14.007): <AtomGroup with 17 atoms>, ('ASP', 15.999): <AtomGroup with 51 atoms>, ('LYS', 1.008): <AtomGroup with 234 atoms>, ('LYS', 12.011): <AtomGroup with 108 atoms>, ('LYS', 14.007): <AtomGroup with 36 atoms>, ('LYS', 15.999): <AtomGroup with 18 atoms>, ('MET', 32.06): <AtomGroup with 6 atoms>, ('MET', 1.008): <AtomGroup with 56 atoms>, ('MET', 12.011): <AtomGroup with 30 atoms>, ('MET', 14.007): <AtomGroup with 6 atoms>, ('MET', 15.999): <AtomGroup with 6 atoms>, ('LEU', 1.008): <AtomGroup with 176 atoms>, ('LEU', 12.011): <AtomGroup with 96 atoms>, ('LEU', 14.007): <AtomGroup with 16 atoms>, ('LEU', 15.999): <AtomGroup with 16 atoms>, ('VAL', 1.008): <AtomGroup with 171 atoms>, ('VAL', 12.011): <AtomGroup with 95 atoms>, ('VAL', 14.007): <AtomGroup with 19 atoms>, ('VAL', 15.999): <AtomGroup with 19 atoms>, ('PRO', 1.008): <AtomGroup with 70 atoms>, ('PRO', 12.011): <AtomGroup with 50 atoms>, ('PRO', 14.007): <AtomGroup with 10 atoms>, ('PRO', 15.999): <AtomGroup with 10 atoms>, ('SER', 1.008): <AtomGroup with 25 atoms>, ('SER', 12.011): <AtomGroup with 15 atoms>, ('SER', 14.007): <AtomGroup with 5 atoms>, ('SER', 15.999): <AtomGroup with 10 atoms>, ('ILE', 1.008): <AtomGroup with 154 atoms>, ('ILE', 12.011): <AtomGroup with 84 atoms>, ('ILE', 14.007): <AtomGroup with 14 atoms>, ('ILE', 15.999): <AtomGroup with 14 atoms>, ('ARG', 1.008): <AtomGroup with 169 atoms>, ('ARG', 12.011): <AtomGroup with 78 atoms>, ('ARG', 14.007): <AtomGroup with 52 atoms>, ('ARG', 15.999): <AtomGroup with 13 atoms>, ('GLU', 1.008): <AtomGroup with 108 atoms>, ('GLU', 12.011): <AtomGroup with 90 atoms>, ('GLU', 14.007): <AtomGroup with 18 atoms>, ('GLU', 15.999): <AtomGroup with 54 atoms>}
**********************************************************************
File "None", line ?, in default
Failed example:
    ag.groupby(['resnames', 'masses'])('ALA', 15.999)
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[0]>", line 1, in <module>
        ag.groupby(['resnames', 'masses'])('ALA', 15.999)
    TypeError: 'dict' object is not callable
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    ag1.indices
Expected:
    array([3, 3, 1, 1])
Got:
    array([3, 3, 2, 2, 1, 1])
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    ag3.indices  # 0 and 1 are only in ag1, 4 and 6 are only in ag2
Expected:
    [0, 1, 4, 6]
Got:
    array([0, 1, 4, 6])
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    sg = u.segments[[2, 1, 2, 2, 1, 0]]
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[0]>", line 1, in <module>
        sg = u.segments[[2, 1, 2, 2, 1, 0]]
             ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
      File "/mnt/c/Users/sumairaibiA/code/mdanalysis/mdanalysis/package/MDAnalysis/core/groups.py", line 601, in __getitem__
        return self._derived_class(self.ix[item], self.universe)
                                   ~~~~~~~^^^^^^
    IndexError: index 2 is out of bounds for axis 0 with size 1
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    sg
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[1]>", line 1, in <module>
        sg
    NameError: name 'sg' is not defined
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    sg.ix
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[2]>", line 1, in <module>
        sg.ix
        ^^
    NameError: name 'sg' is not defined
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    sg2 = sg.asunique()
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[3]>", line 1, in <module>
        sg2 = sg.asunique()
              ^^
    NameError: name 'sg' is not defined
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    sg2
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[4]>", line 1, in <module>
        sg2
    NameError: name 'sg2' is not defined. Did you mean: 'ag2'?
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    sg2.ix
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[5]>", line 1, in <module>
        sg2.ix
        ^^^
    NameError: name 'sg2' is not defined. Did you mean: 'ag2'?
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    sg2.asunique() is sg2
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[6]>", line 1, in <module>
        sg2.asunique() is sg2
        ^^^
    NameError: name 'sg2' is not defined. Did you mean: 'ag2'?
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    ag.groupby('masses')
Expected:
    {12.010999999999999: <AtomGroup with 462 atoms>,
     14.007: <AtomGroup with 116 atoms>,
     15.999000000000001: <AtomGroup with 134 atoms>}
Got:
    {1.008: <AtomGroup with 5 atoms>, 14.007: <AtomGroup with 1 atom>}
**********************************************************************
File "None", line ?, in default
Failed example:
    ag.groupby(['resnames', 'masses'])
Expected:
    {('ALA', 1.008): <AtomGroup with 95 atoms>,
     ('ALA', 12.011): <AtomGroup with 57 atoms>,
     ('ALA', 14.007): <AtomGroup with 19 atoms>,
     ('ALA', 15.999): <AtomGroup with 19 atoms>},
     ('ARG', 1.008): <AtomGroup with 169 atoms>,
     ...}
Got:
    {('MET', 1.008): <AtomGroup with 5 atoms>, ('MET', 14.007): <AtomGroup with 1 atom>}
**********************************************************************
File "None", line ?, in default
Failed example:
    ag.groupby(['resnames', 'masses'])('ALA', 15.999)
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[0]>", line 1, in <module>
        ag.groupby(['resnames', 'masses'])('ALA', 15.999)
    TypeError: 'dict' object is not callable
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    ag1.indices
Expected:
    array([3, 3, 1, 1])
Got:
    array([3, 3, 2, 2, 1, 1])
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    ag3.indices  # 0 and 1 are only in ag1, 4 and 6 are only in ag2
Expected:
    [0, 1, 4, 6]
Got:
    array([0, 1, 4, 6])
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    sg = u.segments[[2, 1, 2, 2, 1, 0]]
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[0]>", line 1, in <module>
        sg = u.segments[[2, 1, 2, 2, 1, 0]]
             ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
      File "/mnt/c/Users/sumairaibiA/code/mdanalysis/mdanalysis/package/MDAnalysis/core/groups.py", line 601, in __getitem__
        return self._derived_class(self.ix[item], self.universe)
                                   ~~~~~~~^^^^^^
    IndexError: index 2 is out of bounds for axis 0 with size 1
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    sg
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[1]>", line 1, in <module>
        sg
    NameError: name 'sg' is not defined
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    sg.ix
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[2]>", line 1, in <module>
        sg.ix
        ^^
    NameError: name 'sg' is not defined
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    sg2 = sg.unique
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[3]>", line 1, in <module>
        sg2 = sg.unique
              ^^
    NameError: name 'sg' is not defined
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    sg2
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[4]>", line 1, in <module>
        sg2
    NameError: name 'sg2' is not defined. Did you mean: 'ag2'?
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    sg2.ix
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[5]>", line 1, in <module>
        sg2.ix
        ^^^
    NameError: name 'sg2' is not defined. Did you mean: 'ag2'?
**********************************************************************
File "../../../MDAnalysis/core/groups.py", line ?, in default
Failed example:
    sg2.unique is sg2
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[6]>", line 1, in <module>
        sg2.unique is sg2
        ^^^
    NameError: name 'sg2' is not defined. Did you mean: 'ag2'?
**********************************************************************
1 items had failures:
  42 of 148 in default
148 tests in 1 items.
106 passed and 42 failed.
***Test Failed*** 42 failures.

Document: documentation_pages/analysis/base
-------------------------------------------
1 items passed all tests:
   8 tests in default
8 tests in 1 items.
8 passed and 0 failed.
Test passed.

Document: documentation_pages/core/universe
-------------------------------------------
1 items passed all tests:
  24 tests in default
24 tests in 1 items.
24 passed and 0 failed.
Test passed.

Document: documentation_pages/lib/util
--------------------------------------
1 items passed all tests:
  30 tests in default
30 tests in 1 items.
30 passed and 0 failed.
Test passed.

Document: documentation_pages/coordinates/LAMMPS
------------------------------------------------
**********************************************************************
File "../../../MDAnalysis/coordinates/LAMMPS.py", line ?, in default
Failed example:
    for ts in u.trajectory:
        # analyze frame
        if take_this_frame == True:
            with mda.Writer('frame.data') as W:
                W.write(u.atoms)
            break
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[0]>", line 1, in <module>
        for ts in u.trajectory:
                  ^
    NameError: name 'u' is not defined
**********************************************************************
1 items had failures:
   1 of   1 in default
1 tests in 1 items.
0 passed and 1 failed.
***Test Failed*** 1 failures.

Document: documentation_pages/analysis/pca
------------------------------------------
**********************************************************************
File "../../../MDAnalysis/analysis/pca.py", line ?, in default (setup code)
Failed example:
    >>> import MDAnalysis as mda
    >>> import MDAnalysis.analysis.pca as pca
    >>> from MDAnalysis.tests.datafiles import PSF, DCD
    >>> u = mda.Universe(PSF, DCD)
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/site-packages/sphinx/ext/doctest.py", line 484, in compile
        return compile(code, name, self.type, flags, dont_inherit)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<doctest default (setup code)[0]>", line 1
        >>> import MDAnalysis as mda
        ^^
    SyntaxError: invalid syntax
**********************************************************************
File "../../../MDAnalysis/analysis/pca.py", line ?, in default (setup code)
Failed example:
    >>> import MDAnalysis as mda
    >>> import MDAnalysis.analysis.pca as pca
    >>> from MDAnalysis.tests.datafiles import PSF, DCD
    >>> u = mda.Universe(PSF, DCD)
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/site-packages/sphinx/ext/doctest.py", line 484, in compile
        return compile(code, name, self.type, flags, dont_inherit)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<doctest default (setup code)[1]>", line 1
        >>> import MDAnalysis as mda
        ^^
    SyntaxError: invalid syntax
**********************************************************************
1 items had failures:
   2 of   2 in default (setup code)
***Test Failed*** 2 failures.

Document: documentation_pages/converters/OpenMM
-----------------------------------------------
**********************************************************************
File "None", line ?, in default
Failed example:
    import openmm.app as app
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[0]>", line 1, in <module>
        import openmm.app as app
    ModuleNotFoundError: No module named 'openmm'
**********************************************************************
File "None", line ?, in default
Failed example:
    pdbxfile = app.PDBxFile(PDBX)
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[3]>", line 1, in <module>
        pdbxfile = app.PDBxFile(PDBX)
                   ^^^
    NameError: name 'app' is not defined
**********************************************************************
File "None", line ?, in default
Failed example:
    mda.Universe(pdbxfile)
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[4]>", line 1, in <module>
        mda.Universe(pdbxfile)
                     ^^^^^^^^
    NameError: name 'pdbxfile' is not defined
**********************************************************************
1 items had failures:
   3 of   5 in default
5 tests in 1 items.
2 passed and 3 failed.
***Test Failed*** 3 failures.

Document: documentation_pages/lib/formats/libdcd
------------------------------------------------
**********************************************************************
File "../docstring of MDAnalysis.lib.formats.libdcd.DCDFile", line 24, in default
Failed example:
    with DCDFile('foo.dcd') as f:
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/site-packages/sphinx/ext/doctest.py", line 484, in compile
        return compile(code, name, self.type, flags, dont_inherit)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<doctest default[1]>", line 1
        with DCDFile('foo.dcd') as f:
                                     ^
    IndentationError: expected an indented block after 'with' statement on line 1
**********************************************************************
File "../docstring of MDAnalysis.lib.formats.libdcd.DCDFile", line 25, in default
Failed example:
        for frame in f:
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/site-packages/sphinx/ext/doctest.py", line 484, in compile
        return compile(code, name, self.type, flags, dont_inherit)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<doctest default[2]>", line 1
        for frame in f:
    IndentationError: unexpected indent
**********************************************************************
File "../docstring of MDAnalysis.lib.formats.libdcd.DCDFile", line 26, in default
Failed example:
            print(frame.x)
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/site-packages/sphinx/ext/doctest.py", line 484, in compile
        return compile(code, name, self.type, flags, dont_inherit)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<doctest default[3]>", line 1
        print(frame.x)
    IndentationError: unexpected indent
**********************************************************************
1 items had failures:
   3 of   4 in default
4 tests in 1 items.
1 passed and 3 failed.
***Test Failed*** 3 failures.

Document: documentation_pages/analysis/align
--------------------------------------------
**********************************************************************
File "None", line ?, in default
Failed example:
    rmsd(mobile.select_atoms('name CA').positions, ref.select_atoms('name CA').positions, center=True)
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[0]>", line 1, in <module>
        rmsd(mobile.select_atoms('name CA').positions, ref.select_atoms('name CA').positions, center=True)
        ^^^^
    NameError: name 'rmsd' is not defined
**********************************************************************
File "None", line ?, in default
Failed example:
    rmsd(mobile.select_atoms('name CA').positions, ref.select_atoms('name CA').positions,
         superposition=True)
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[0]>", line 1, in <module>
        rmsd(mobile.select_atoms('name CA').positions, ref.select_atoms('name CA').positions,
        ^^^^
    NameError: name 'rmsd' is not defined
**********************************************************************
1 items had failures:
   2 of   2 in default
2 tests in 1 items.
0 passed and 2 failed.
***Test Failed*** 2 failures.

Document: documentation_pages/analysis/encore/similarity
--------------------------------------------------------
**********************************************************************
File "None", line ?, in default
Failed example:
    print(HES)
Expected:
    [[       0.         38279540.04524205]
     [38279540.04524205        0.        ]]
Got:
    [[       0.        38279535.2809184]
     [38279535.2809184        0.       ]]
**********************************************************************
File "None", line ?, in default
Failed example:
    print(HES)
Expected:
    [[       0.         38279540.04524205]
     [38279540.04524205        0.        ]]
Got:
    [[       0.        38279535.2809184]
     [38279535.2809184        0.       ]]
**********************************************************************
File "None", line ?, in default
Failed example:
    print(encore.hes([ens1, ens2], align=True)[0])
Expected:
    [[   0.         6889.89729056]
     [6889.89729056    0.        ]]
Got:
    [[   0.         6889.89687843]
     [6889.89687843    0.        ]]
**********************************************************************
File "None", line ?, in default
Failed example:
    print(encore.hes([ens1, ens2])[0])
Expected:
    [[   0.         6889.89729056]
     [6889.89729056    0.        ]]
Got:
    [[   0.         6889.89687843]
     [6889.89687843    0.        ]]
**********************************************************************
File "None", line ?, in default
Failed example:
    print(HES)
Expected:
    [[       0.         38279540.04524205]
     [38279540.04524205        0.        ]]
Got:
    [[       0.        38279535.2809184]
     [38279535.2809184        0.       ]]
**********************************************************************
File "None", line ?, in default
Failed example:
    print(encore.hes([ens1, ens2], align=True)[0])
Expected:
    [[   0.         6889.89729056]
     [6889.89729056    0.        ]]
Got:
    [[   0.         6889.89687843]
     [6889.89687843    0.        ]]
**********************************************************************
File "None", line ?, in default
Failed example:
    print(encore.hes([ens1, ens2])[0])
Expected:
    [[   0.         6889.89729056]
     [6889.89729056    0.        ]]
Got:
    [[   0.         6889.89687843]
     [6889.89687843    0.        ]]
**********************************************************************
1 items had failures:
   7 of 102 in default
102 tests in 1 items.
95 passed and 7 failed.
***Test Failed*** 7 failures.

Document: documentation_pages/lib/transformations
-------------------------------------------------
1 items passed all tests:
 160 tests in default
160 tests in 1 items.
160 passed and 0 failed.
Test passed.

Document: documentation_pages/coordinates/timestep
--------------------------------------------------
**********************************************************************
File "None", line ?, in default
Failed example:
    ts.dimensions
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[0]>", line 1, in <module>
        ts.dimensions
        ^^
    NameError: name 'ts' is not defined
**********************************************************************
File "None", line ?, in default
Failed example:
    ts.triclinic_dimensions
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[1]>", line 1, in <module>
        ts.triclinic_dimensions
        ^^
    NameError: name 'ts' is not defined
**********************************************************************
1 items had failures:
   2 of   2 in default
2 tests in 1 items.
0 passed and 2 failed.
***Test Failed*** 2 failures.

Document: documentation_pages/core/topology
-------------------------------------------
1 items passed all tests:
   5 tests in default
5 tests in 1 items.
5 passed and 0 failed.
Test passed.

Document: documentation_pages/analysis/rms
------------------------------------------
1 items passed all tests:
   9 tests in default
9 tests in 1 items.
9 passed and 0 failed.
Test passed.

Document: documentation_pages/lib/formats/libmdaxdr
---------------------------------------------------
**********************************************************************
File "../docstring of MDAnalysis.lib.formats.libmdaxdr.TRRFile", line 18, in default
Failed example:
    with TRRFile('foo.trr') as f:
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/site-packages/sphinx/ext/doctest.py", line 484, in compile
        return compile(code, name, self.type, flags, dont_inherit)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<doctest default[1]>", line 1
        with TRRFile('foo.trr') as f:
                                     ^
    IndentationError: expected an indented block after 'with' statement on line 1
**********************************************************************
File "../docstring of MDAnalysis.lib.formats.libmdaxdr.TRRFile", line 19, in default
Failed example:
        for frame in f:
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/site-packages/sphinx/ext/doctest.py", line 484, in compile
        return compile(code, name, self.type, flags, dont_inherit)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<doctest default[2]>", line 1
        for frame in f:
    IndentationError: unexpected indent
**********************************************************************
File "../docstring of MDAnalysis.lib.formats.libmdaxdr.TRRFile", line 20, in default
Failed example:
            print(frame.x)
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/site-packages/sphinx/ext/doctest.py", line 484, in compile
        return compile(code, name, self.type, flags, dont_inherit)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<doctest default[3]>", line 1
        print(frame.x)
    IndentationError: unexpected indent
**********************************************************************
File "../docstring of MDAnalysis.lib.formats.libmdaxdr.XTCFile", line 18, in default
Failed example:
    with XTCFile('foo.trr') as f:
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/site-packages/sphinx/ext/doctest.py", line 484, in compile
        return compile(code, name, self.type, flags, dont_inherit)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<doctest default[1]>", line 1
        with XTCFile('foo.trr') as f:
                                     ^
    IndentationError: expected an indented block after 'with' statement on line 1
**********************************************************************
File "../docstring of MDAnalysis.lib.formats.libmdaxdr.XTCFile", line 19, in default
Failed example:
        for frame in f:
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/site-packages/sphinx/ext/doctest.py", line 484, in compile
        return compile(code, name, self.type, flags, dont_inherit)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<doctest default[2]>", line 1
        for frame in f:
    IndentationError: unexpected indent
**********************************************************************
File "../docstring of MDAnalysis.lib.formats.libmdaxdr.XTCFile", line 20, in default
Failed example:
            print(frame.x)
Exception raised:
    Traceback (most recent call last):
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/doctest.py", line 1359, in __run
        exec(compile(example.source, filename, "single",
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/ibia/anaconda3/envs/mdanalysis-dev/lib/python3.12/site-packages/sphinx/ext/doctest.py", line 484, in compile
        return compile(code, name, self.type, flags, dont_inherit)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<doctest default[3]>", line 1
        print(frame.x)
    IndentationError: unexpected indent
**********************************************************************
1 items had failures:
   6 of   8 in default
8 tests in 1 items.
2 passed and 6 failed.
***Test Failed*** 6 failures.

Doctest summary
===============
  508 tests
   66 failures in tests
    2 failures in setup code
    0 failures in cleanup code

[ 0. , 80.13008 , 0. ],
[40.06504 , 40.06504 , 56.660522]], dtype=float32)

Setting the attribute also works::

.. doctest::

>>> ts.triclinic_dimensions = [[15, 0, 0], [5, 15, 0], [5, 5, 15]]
>>> ts.dimensions
>>> u = mda.Universe(TPR, XTC)
>>> ts_2 = u.trajectory[0]
>>> ts_2.triclinic_dimensions = [[15, 0, 0], [5, 15, 0], [5, 5, 15]]
>>> ts_2.dimensions
array([ 15. , 15.81138802, 16.58312416, 67.58049774,
72.45159912, 71.56504822], dtype=float32)

Expand Down
Loading