From c4c06b5864c467b766b5ef41ad4c97203d084a69 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Fri, 29 Apr 2022 11:18:41 +0100 Subject: [PATCH] fix: in input.hadrons._get_files the suffix '.h5. is now conditionally removed. --- pyerrors/input/hadrons.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyerrors/input/hadrons.py b/pyerrors/input/hadrons.py index e9097625..8297149c 100644 --- a/pyerrors/input/hadrons.py +++ b/pyerrors/input/hadrons.py @@ -18,7 +18,7 @@ def _get_files(path, filestem, idl): raise Exception('No files starting with', filestem, 'in folder', path) def get_cnfg_number(n): - return int(n[len(filestem) + 1:-3]) + return int(n.replace(".h5", "")[len(filestem) + 1:]) # From python 3.9 onward the safer 'removesuffix' method can be used. # Sort according to configuration number files.sort(key=get_cnfg_number)