Skip to content

Commit

Permalink
Catch error if no replica are found in the geiven directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuhl-uni committed Mar 25, 2024
1 parent df1873b commit f169985
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyerrors/input/sfcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down

0 comments on commit f169985

Please sign in to comment.