Skip to content

Commit

Permalink
Added known failures
Browse files Browse the repository at this point in the history
  • Loading branch information
jdetle committed Aug 1, 2016
1 parent 76ec586 commit 0f62787
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package/MDAnalysis/coordinates/src/dcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ __read_timeseries(PyObject *self, PyObject *args)
for (i=0;i<n_frames;i++) {
if (step > 1 && i>0) {
// Check if we have fixed atoms
- // XXX not done
// XXX not done
/* Figure out how many steps to step over, if step = n, np array
slicing treats this as skip over n-1, read the nth. */
numskip = step -1;
Expand Down
18 changes: 15 additions & 3 deletions testsuite/MDAnalysisTests/coordinates/test_dcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
RefNAMDtriclinicDCD)
from MDAnalysisTests.coordinates.base import BaseTimestepTest
from MDAnalysisTests import module_not_found, tempdir

from MDAnalysisTests.plugins.knownfailure import knownfailure

@attr('issue')
def TestDCD_Issue32():
Expand Down Expand Up @@ -137,18 +137,30 @@ def test_volume(self):

def test_timeseries_slicing(self):
# check that slicing behaves correctly
# should fail before issue #914 resolved
# should before issue #914 resolved
x = [(0, 1, 1), (1,1,1), (1, 2, 1), (1, 2, 2), (1, 4, 2), (1, 4, 4),
(0, 5, 5), (3, 5, 1), (5, 0, -2), (5, 0, -1), (None, None, None)]
(0, 5, 5), (3, 5, 1), (None, None, None)]
for start, stop, step in x:
yield self._slice_generation_test, start, stop, step

def test_backwards_stepping(self):
x = [(4, 0, -1), (5, 0, -2), (5, 0, -4)]
for start, stop, step in x:
yield self._failed_slices_test, start, stop, step

def _slice_generation_test(self, start, stop, step):
self.u = mda.Universe(PSF, DCD)
ts = self.u.trajectory.timeseries(self.u.atoms)
ts_skip = self.u.trajectory.timeseries(self.u.atoms, start, stop, step)
assert_array_almost_equal(ts[:, start:stop:step,:], ts_skip, 5)

@knownfailure()
def _failed_slices_test(self, start, stop, step):
self.u = mda.Universe(PSF, DCD)
ts = self.u.trajectory.timeseries(self.u.atoms)
ts_skip = self.u.trajectory.timeseries(self.u.atoms, start, stop, step)
assert_array_almost_equal(ts[:, start:stop:step,:], ts_skip, 5)


def test_DCDReader_set_dt(dt=100., frame=3):
u = mda.Universe(PSF, DCD, dt=dt)
Expand Down

0 comments on commit 0f62787

Please sign in to comment.