Conditions | 4 |
Total Lines | 14 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import os |
||
21 | @pytest.fixture(scope='session', autouse=True) |
||
22 | def reference_data(data_dir): |
||
23 | """Data fixture of amd.PeriodicSet objects to use in tests.""" |
||
24 | |||
25 | filenames = ['cubic', 'T2_experimental', 'CSD_families'] |
||
26 | refs = {} |
||
27 | for name in filenames: |
||
28 | path = str(data_dir / f'{name}.pkl') |
||
29 | with open(path, 'rb') as f: |
||
30 | data = pickle.load(f) |
||
31 | if not data: |
||
32 | raise ValueError(f'Data not found in path {path}') |
||
33 | refs[name] = data |
||
34 | return refs |
||
35 |