fix: in input.hadrons._get_files the suffix '.h5. is now conditionally

removed.
This commit is contained in:
Fabian Joswig 2022-04-29 11:18:41 +01:00
parent 912629b845
commit c4c06b5864

View file

@ -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)