From a7ff26ed9c369bc20737153d13064c83eaec24bf Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Fri, 4 Mar 2022 17:25:30 +0000 Subject: [PATCH] fix: only allow irregularly spaced configs in hadrons input if idl is specified. --- 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 41b437a2..e9097625 100644 --- a/pyerrors/input/hadrons.py +++ b/pyerrors/input/hadrons.py @@ -45,9 +45,11 @@ def _get_files(path, filestem, idl): raise Exception("Unsorted files") if len(dc) == 1: idx = range(cnfg_numbers[0], cnfg_numbers[-1] + dc[0], dc[0]) - else: + elif idl: idx = idl warnings.warn("Configurations are not evenly spaced.", RuntimeWarning) + else: + raise Exception("Configurations are not evenly spaced.") return filtered_files, idx