Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

[frames_from_files] ValueError: largest specified index is larger than trajectory length #958

Closed
sonyahanson opened this issue Oct 12, 2016 · 2 comments

Comments

@sonyahanson
Copy link

Getting ValueError: largest specified index is larger than trajectory length even with staged trajectories.

@maxentile and I had seen this for non-staged trajectories that we had reason to believe were being continuously updated. This was mentioned previously (#892). More recently this problem has been happening with trajectories that have been copied to a different folder and aren't actively updated.

traj = frames_from_files(trajfiles, top, indexes, chunksize, stride, reader=reader)
 File "/cbio/jclab/home/hansons/opt/anaconda/lib/python2.7/site-packages/pyemma/coordinates/data/util/frames_from_file.py", line 111, in frames_from_files
   length))
ValueError: largest specified index (436 * stride=436 * 1=436) is larger than trajectory length '/cbio/jclab/home/hansons/sims/AZ/SYK/11407/run7-clone19.h5' = 240

Also, of note, if I try and run the same analysis on just that trajectory, the error does not occur and everything runs fine. There is also so far no evidence that the HDF5 file itself is bad.

Also note pyemma version:

conda list| grep pyemma
pyemma                    2.2.6               np110py27_0    omnia
@marscher marscher changed the title ValueError: largest specified index is larger than trajectory length [frames_from_files] ValueError: largest specified index is larger than trajectory length Oct 17, 2016
@marscher
Copy link
Member

The check in the function is correct, I've double checked it. So the question is why the indices you're passing in are out of bounds. Does it also happen if you use two trajectories (the "faulty" one + an arbitrary or subsequent one)?

@franknoe the test here only uses one trajectory, so maybe this case is not covered for hmm?
https://github.com/markovmodel/PyEMMA/blob/devel/pyemma/msm/tests/test_hmsm.py#L387-L398

@sonyahanson
Copy link
Author

Hmmm. No error with two trajectories (the "faulty" one + an arbitrary or subsequent one).

marscher added a commit to marscher/PyEMMA that referenced this issue Oct 20, 2016
…frame_i)

The error was to obtain the maximum on a 2d array (itraj, frame_i) and not only
frame indices.

- added test to check for correct error message (by regex).
- also removed obsolete binding for frame_from_file.

Fixes markovmodel#958
marscher added a commit to marscher/PyEMMA that referenced this issue Oct 20, 2016
…frame_i)

The error was to obtain the maximum on a 2d array (itraj, frame_i) and not only
frame indices.

- added test to check for correct error message (by regex).
- reset the return_traj_obj to initial state.
- also removed obsolete binding for frame_from_file.

Fixes markovmodel#958
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants