add test whether the ensemble in the database is the one in meas_path
This commit is contained in:
parent
9d0b922db9
commit
32987d5557
1 changed files with 4 additions and 2 deletions
|
|
@ -113,13 +113,15 @@ def check_path_format(result: pd.Series, ensembles: list[str], projects: list[st
|
|||
|
||||
meas_key = p.split('::')[1]
|
||||
ensemble = p.split('/')[1]
|
||||
project = p.split('/')[2].split('::')[0]
|
||||
project = p.split('/')[3].split('.')[0]
|
||||
if not len(meas_key) == 64:
|
||||
raise ValueError(f'meas_key of {p} is scrambled')
|
||||
if ensemble not in ensembles:
|
||||
raise ValueError(f'meas_key of {p} points to an unknown ensemble')
|
||||
if project not in projects:
|
||||
raise ValueError(f'meas_key of {p} points to an unknown project id')
|
||||
raise ValueError(f'meas_key of {p} points to an unknown project id ({project})')
|
||||
if not ensemble == result['ensemble']:
|
||||
raise ValueError(f'Ensemble in database and file does not match for path {p}.')
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue