diff options
| author | Pjotr Prins <pjotr.public01@thebird.nl> | 2026-11-15 03:49:02 +0000 |
|---|---|---|
| committer | Pjotr Prins <pjotr.public01@thebird.nl> | 2026-11-15 03:49:02 +0000 |
| commit | a2f47b25669568f84965c8efd3b6f9ecac572144 (patch) | |
| tree | 2efe09d89f903bcd6c3035a68b764fc77aa6a4c1 /test/python/test_dev_token.py | |
| parent | 4f2117ce6bbd065059775eaebd98b00135159847 (diff) | |
| download | genenetwork4-a2f47b25669568f84965c8efd3b6f9ecac572144.tar.gz | |
correlation: port the reference suites' cases, and note what is not portable
The cases genenetwork2 and genenetwork3 assert, copied so GN4 answers the same questions the same way: - genenetwork3 test_normalize_values: only pairs where both sides have a value survive; - genenetwork3 test_generate_input: the dataset row keeps its positions, a missing value is an empty field rather than a skipped one; - genenetwork3 test_parse_results, with its own fixture file (data/correlation/sorted_results.txt): |r| descending, positives and negatives interleaved; - genenetwork3 test_get_samples: an unparseable value never reaches a correlation, and only shared sample keys are used; - the overlap boundary GN3 encodes as `num_overlap > 5`, which is where MIN_OVERLAP = 6 comes from. What is *not* portable is most of their suites, and that is worth writing down rather than discovering again: GN2's correlation unit tests are all mocks (compute_corr_coeff_p_value patched out, header strings, a three-value tuple), GN3's test_correlation is plumbing around the same mock, and test_rust_correlation tests the file/JSON layer that this implementation deliberately does not have -- it calls the engine in memory. None of them assert a single r or p, because those come from scipy at run time. One port needed widening: GN3's get_samples fixture has four shared samples, which is below its own minimum overlap, so asserting a correlation on it is impossible in both implementations; the fixture is widened and the assertion is that an unparseable value costs exactly its own pair.
Diffstat (limited to 'test/python/test_dev_token.py')
0 files changed, 0 insertions, 0 deletions
