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

DCD Reader timeseries does not read backwards #922

Closed
jdetle opened this issue Aug 1, 2016 · 2 comments
Closed

DCD Reader timeseries does not read backwards #922

jdetle opened this issue Aug 1, 2016 · 2 comments

Comments

@jdetle
Copy link
Contributor

jdetle commented Aug 1, 2016

Expected behaviour

In creation of a DCD timeseries, a step of -1 should yield a timeseries that travels backwards across a DCD file.

Actual behaviour

The DCD timeseries will behave as if a step of 1 was given, and the increment from the start.

Code to reproduce the behaviour

import MDAnalysis as mda
u = mda.Universe(PSF, DCD)
atoms = u.select_atoms('backbone and name CA')
ts =  u.trajectory.timeseries(atoms)
ts_negative = u.trajectory.timeseries(atoms, start=5, stop=1, step=-1)

# (ts[:, 5:1:-1, :] != ts_negative
# ts_negative == ts[:, 5:9:1, :] 

Current reason for this behavior

Trying to grok the C code. Give me a few hours, days, months

Current version of MDAnalysis:

0.15.1-dev0

@orbeckst orbeckst changed the title DCD Reader does not read backwards DCD Reader timeseries does not read backwards Sep 14, 2016
@orbeckst
Copy link
Member

This was fixed with #1372:

>>> np.allclose(ts[:, 5:1:-1, :], ts_negative)
True

(and this test was run under Python 3 ;-))

@orbeckst
Copy link
Member

@kain88-de I am awarding this one to you post-closure ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants