add test whether the ensemble in the database is the one in meas_path

This commit is contained in:
Justus Kuhlmann 2026-05-06 19:47:05 +02:00
commit 32987d5557
Signed by: jkuhl
GPG key ID: 00ED992DD79B85A6

View file

@ -113,13 +113,15 @@ def check_path_format(result: pd.Series, ensembles: list[str], projects: list[st
meas_key = p.split('::')[1] meas_key = p.split('::')[1]
ensemble = 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: if not len(meas_key) == 64:
raise ValueError(f'meas_key of {p} is scrambled') raise ValueError(f'meas_key of {p} is scrambled')
if ensemble not in ensembles: if ensemble not in ensembles:
raise ValueError(f'meas_key of {p} points to an unknown ensemble') raise ValueError(f'meas_key of {p} points to an unknown ensemble')
if project not in projects: 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}.')