Added option to ignore timestamps when loading xtc indexfiles.

This commit is contained in:
Niels Müller
2017-06-30 14:34:57 +02:00
parent 2f1d2e8451
commit edc1bd759a
2 changed files with 7 additions and 7 deletions

View File

@ -21,7 +21,7 @@ FILE_EXTENSIONS = {
}
def open(filename):
def open(filename, ignore_index_timestamps=False):
"""Open a supported gromacs file. Currently supported file formats: tpr, xtc."""
ext = filename.split('.')[-1]
if ext in FILE_EXTENSIONS:
@ -30,7 +30,7 @@ def open(filename):
if not os.path.exists(indexfile):
print('Generating Index for xtc file. This may take a while...')
index_xtcfile(filename)
return FILE_EXTENSIONS[ext](filename, indexfile)
return FILE_EXTENSIONS[ext](filename, indexfile, ignore_timestamps=ignore_index_timestamps)
else:
return FILE_EXTENSIONS[ext](filename)
else: