Conditions | 4 |
Total Lines | 12 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import os |
||
7 | def test_PDD_pdist(data_dir, reference_data): |
||
8 | for name in reference_data: |
||
9 | if len(reference_data[name]) == 1: |
||
10 | continue |
||
11 | |||
12 | pdds = [s["PDD100"] for s in reference_data[name]] |
||
13 | cdm = amd.PDD_pdist(pdds) |
||
14 | loaded = np.load(str(data_dir / f"{name}_cdm.npz")) |
||
15 | reference_cdm = loaded["cdm"] |
||
16 | |||
17 | if not np.amax(np.abs(cdm - reference_cdm)) < 1e-8: |
||
18 | pytest.fail("PDD_pdist disagrees with reference.") |
||
19 |