Add DRAGON cross-language parity test#389
Open
marouenbg wants to merge 1 commit into
Open
Conversation
Add a parity test asserting that the netZooPy DRAGON pipeline (lambdas, shrunken covariance, precision matrix, partial correlation matrix) matches a fixed snapshot. The same shared inputs and gold values are mirrored in netZooR's tests/testthat/dragon_parity/ -- if both tests pass, the two implementations agree to 1e-5 (atol). Inputs are generated deterministically by tests/dragon_parity/regenerate.py from simulate_dragon_data with seed=20250510, then byte-identical CSVs are committed to both repos. Kappa / p-values are not covered, since netZooR's estimate_kappa_dragon and estimate_p_values_dragon are unimplemented stubs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a parity test that pins netZooPy's DRAGON outputs to a fixed numeric snapshot. The same shared inputs and gold values are committed byte-identical in netZooR (companion PR linked below). If both tests pass, the two implementations agree to 1e-5 absolute tolerance.
What's covered
lambdas(penalty parameters)What's not covered
estimate_kappa_dragonandestimate_p_values_dragonin DRAGON.R are empty function bodies; the publicdragon()prints "not yet implemented in R; to estimate p-values, use netZooPy"). When netZooR gains a κ/p-value implementation, this parity test should be extended.Fixtures
X1.csv(50×20),X2.csv(50×15) — generated deterministically bytests/dragon_parity/regenerate.pyfromsimulate_dragon_data(seed=20250510), then column-scaled.lambdas.txt,cov.csv,prec.csv,ggm.csv. Snapshot of netZooPy's pipeline at the time the fixtures were generated.tests/testthat/dragon_parity/.Local results
R and Python agree two orders of magnitude tighter than the 1e-5 tolerance.
Companion PR
Test plan
pytest tests/test_dragon_parity.py— 2 passed locallytests/test_dragon.py🤖 Generated with Claude Code