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
Failing to read XDR offsets is a fatal error #1893
Comments
If we put in an try/except then we should also spit out a |
For now, does deleting the offset file fix this by forcing offsets to regenerate? |
I am saying yes (until someone proves me wrong) – this should always work. |
Better workaround: IIRC |
You're correct @zemanj , MDAnalysis.coordinates.XDR.XDRBaseReader and therefore the XTCReader and TRRReader have u = mda.Universe(data.TPR, data.XTC, refresh_offsets=True) as demonstrated here by monitoring the last-modified time of the offset file: >>> import MDAnalysis as mda; from MDAnalysis.tests import datafiles as data
>>> import os
>>> u = mda.Universe(data.TPR, data.XTC)
>>> offset_file = mda.coordinates.XDR.offsets_filename(u.trajectory.filename)
>>> print(offset_file)
~/anaconda3/envs/mda3/lib/python3.6/site-packages/MDAnalysisTests/data/.adk_oplsaa.xtc_offsets.npz
>>> print(os.path.getmtime(offset_file))
1573257681.0
>>> # load again: nothing changes
>>> u = mda.Universe(data.TPR, data.XTC)
>>> print(os.path.getmtime(offset_file))
1573257681.0
>>> # refresh: offset file is modified
>>> u = mda.Universe(data.TPR, data.XTC, refresh_offsets=True)
>>> print(os.path.getmtime(offset_file))
1573257862.0 |
Sometimes loading xdr offsets fails.
This shouldn't cause the entire file loading process to fail. It should be possible wrap offset loading in a try/except to regenerate the offsets if needed
The text was updated successfully, but these errors were encountered: