formatting improvements

This commit is contained in:
Fabian Joswig 2021-10-11 13:51:11 +01:00
parent ba9ec24944
commit ff1efd3096
3 changed files with 15 additions and 12 deletions

View file

@ -18,4 +18,5 @@ jobs:
with:
ignore: "E501"
exclude: "pyerrors/__init__.py"
exclude: "pyerrors/input/__init__.py"
path: "pyerrors"

View file

@ -32,8 +32,10 @@ def read_meson_hd5(path, filestem, ens_id, meson='meson_0', tree='meson'):
if not files:
raise Exception('No files starting with', filestem, 'in folder', path)
def get_cnfg_number(n):
return int(n[len(filestem) + 1:-3])
# Sort according to configuration number
get_cnfg_number = lambda x: int(x[len(filestem) + 1:-3])
files.sort(key=get_cnfg_number)
# Check that configurations are evenly spaced