mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 06:40:24 +01:00
Catch error if no replica are found in the geiven directory (#230)
This commit is contained in:
parent
0df5882d1f
commit
254a19f321
1 changed files with 2 additions and 0 deletions
|
@ -184,6 +184,8 @@ def read_sfcf_multi(path, prefix, name_list, quarks_list=['.*'], corr_type_list=
|
||||||
|
|
||||||
else:
|
else:
|
||||||
replica = len([file.split(".")[-1] for file in ls]) // len(set([file.split(".")[-1] for file in ls]))
|
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:
|
if not silent:
|
||||||
print('Read', part, 'part of', name_list, 'from', prefix[:-1], ',', replica, 'replica')
|
print('Read', part, 'part of', name_list, 'from', prefix[:-1], ',', replica, 'replica')
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue