From 254a19f321aac07e3b4a5f1c33e2bc2b3514c53a Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann <82444481+jkuhl-uni@users.noreply.github.com> Date: Mon, 25 Mar 2024 15:50:19 +0100 Subject: [PATCH] Catch error if no replica are found in the geiven directory (#230) --- pyerrors/input/sfcf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyerrors/input/sfcf.py b/pyerrors/input/sfcf.py index 94aa1948..64ce8899 100644 --- a/pyerrors/input/sfcf.py +++ b/pyerrors/input/sfcf.py @@ -184,6 +184,8 @@ def read_sfcf_multi(path, prefix, name_list, quarks_list=['.*'], corr_type_list= else: replica = len([file.split(".")[-1] for file in ls]) // len(set([file.split(".")[-1] for file in ls])) + if replica == 0: + raise Exception('No replica found in directory') if not silent: print('Read', part, 'part of', name_list, 'from', prefix[:-1], ',', replica, 'replica')