Merge pull request #59 from s-kuberski/feature/rwf

Bugfix in openQCD routines: r_stop was excluded instead of being the …
This commit is contained in:
Fabian Joswig 2022-02-09 11:15:23 +00:00 committed by GitHub
commit df17f676fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -195,7 +195,9 @@ def read_rwms(path, prefix, version='2.0', names=None, **kwargs):
r_stop_index.append(len(configlist[-1]) - 1)
else:
try:
r_stop_index.append(configlist[-1].index(r_stop[rep]))
r_stop_index.append(configlist[-1].index(r_stop[rep]) + 1)
if r_stop_index[-1] == len(configlist[-1]):
r_stop_index[-1] -= 1
except ValueError:
raise Exception('Config %d not in file with range [%d, %d]' % (
r_stop[rep], configlist[-1][0], configlist[-1][-1])) from None
@ -393,7 +395,9 @@ def extract_t0(path, prefix, dtr_read, xmin, spatial_extent, fit_range=5, **kwar
r_stop_index.append(len(configlist[-1]) - 1)
else:
try:
r_stop_index.append(configlist[-1].index(r_stop[rep]))
r_stop_index.append(configlist[-1].index(r_stop[rep]) + 1)
if r_stop_index[-1] == len(configlist[-1]):
r_stop_index[-1] -= 1
except ValueError:
raise Exception('Config %d not in file with range [%d, %d]' % (
r_stop[rep], configlist[-1][0], configlist[-1][-1])) from None
@ -716,7 +720,9 @@ def read_qtop(path, prefix, c, dtr_cnfg=1, version="openQCD", **kwargs):
r_stop_index.append(len(configlist[-1]) - 1)
else:
try:
r_stop_index.append(configlist[-1].index(r_stop[rep]))
r_stop_index.append(configlist[-1].index(r_stop[rep]) + 1)
if r_stop_index[-1] == len(configlist[-1]):
r_stop_index[-1] -= 1
except ValueError:
raise Exception('Config %d not in file with range [%d, %d]' % (
r_stop[rep], configlist[-1][0], configlist[-1][-1])) from None