From b1221cb76d63172190fb1c02651e841c316a0b36 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Fri, 21 Jan 2022 13:28:12 +0000 Subject: [PATCH] fix: sfcf_read now correctly throws an exception when append mode files were not found. --- pyerrors/input/sfcf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyerrors/input/sfcf.py b/pyerrors/input/sfcf.py index a060c6b7..305d53cd 100644 --- a/pyerrors/input/sfcf.py +++ b/pyerrors/input/sfcf.py @@ -290,6 +290,8 @@ def read_sfcf(path, prefix, name, quarks='.*', noffset=0, wf=0, wf2=0, if not fnmatch.fnmatch(exc, prefix + '*.' + name): ls = list(set(ls) - set([exc])) ls.sort(key=lambda x: int(re.findall(r'\d+', x)[-1])) + if len(ls) == 0: + raise Exception('File(s) for correlator ' + name + ' not found.') pattern = 'name ' + name + '\nquarks ' + quarks + '\noffset ' + str(noffset) + '\nwf ' + str(wf) if b2b: pattern += '\nwf_2 ' + str(wf2)