Catch error if no replica are found in the geiven directory (#230)

This commit is contained in:
Justus Kuhlmann 2024-03-25 15:50:19 +01:00 committed by GitHub
parent 0df5882d1f
commit 254a19f321
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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')