From d0072f5c7b6fb92358623d1146dae64674fc9e0b Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Thu, 27 Jan 2022 10:54:09 +0000 Subject: [PATCH] feat: input.hadrons now check if all configurations specified in idl are really found and throws an error if not. --- pyerrors/input/hadrons.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyerrors/input/hadrons.py b/pyerrors/input/hadrons.py index 1d7b9f67..6dfbfd3e 100644 --- a/pyerrors/input/hadrons.py +++ b/pyerrors/input/hadrons.py @@ -1,6 +1,7 @@ import os import h5py import numpy as np +from collections import Counter from ..obs import Obs, CObs from ..correlators import Corr @@ -32,6 +33,10 @@ def _get_files(path, filestem, idl): filtered_files.append(line) cnfg_numbers.append(no) + if idl: + if Counter(list(idl)) != Counter(cnfg_numbers): + raise Exception("Not all configurations specified in idl found (" + str(list(Counter(list(idl)) - Counter(cnfg_numbers))) + "missing)") + # Check that configurations are evenly spaced dc = np.unique(np.diff(cnfg_numbers)) if np.any(dc < 0):