From abbb234257c3ba565db6538ca4a64e9a3ca1c2aa Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Fri, 4 Mar 2022 17:03:49 +0000 Subject: [PATCH] feat: hadrons input can now handle irregularly spaced ensembles. A warning is triggered in these cases. --- pyerrors/input/hadrons.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyerrors/input/hadrons.py b/pyerrors/input/hadrons.py index 75a19aea..41b437a2 100644 --- a/pyerrors/input/hadrons.py +++ b/pyerrors/input/hadrons.py @@ -1,4 +1,5 @@ import os +import warnings from collections import Counter import h5py import numpy as np @@ -45,7 +46,8 @@ def _get_files(path, filestem, idl): if len(dc) == 1: idx = range(cnfg_numbers[0], cnfg_numbers[-1] + dc[0], dc[0]) else: - raise Exception('Configurations are not evenly spaced.') + idx = idl + warnings.warn("Configurations are not evenly spaced.", RuntimeWarning) return filtered_files, idx