Require a moments-popgen with the corrected pi2 term - #186
Merged
Conversation
Below 1.5.3 the cython genotype kernel carries a sign error in the single-population pi2 correction, so the unphased parity cases in test_moments_ld.py compared against wrong reference values and failed while pg_gpu was right. moments-popgen also caps mpmath and scipy, and for these the conda solve takes precedence over the pypi one, so the caps are restated on the feature. Without them the environment quietly resolves to an older moments instead of reporting the conflict.
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.
Problem
Two unphased parity cases in
tests/test_moments_ld.pyfail on the currenttrunk:
TestFourPopLD::test_ld_sums_match[geno]TestAltCodedSiteParity::test_agree_on_plain_disagree_on_alt_coded[geno]Both mismatch only on
pi2_0_0_0_0andpi2_1_1_1_1, the single-populationpi2 terms. Below moments-popgen 1.5.3 the cython genotype kernel carries a
sign error in the
pi2(i,i;i,i)correction polynomial, so those tests werecomparing against wrong reference values. pg_gpu's kernel has the correct
term, so the failures were never a defect on our side. The environment was
resolving 1.5.0 because the dependency was unconstrained.
Fix
Pin
moments-popgen >= 1.5.3.The pin alone does not solve. moments-popgen also caps
mpmath < 1.4andscipy < 1.17, and for both the conda solve takes precedence over the pypione, so the solve fails outright unless the caps are restated as conda
dependencies on the feature. They are scoped to
feature.moments, so onlythe parity-comparison environment is held back; the default environment is
unchanged.
Verification
Local GPU run, since CI has no GPU:
pytest tests/test_moments_ld.py(moments env): was 34 passed / 2 failed,now 36 passed, 6 skipped, 3 xfailed, 0 failed
pytest tests/ -n 10(default env): 1253 passed, unchangedruff check pg_gpu/ tests/ examples/: cleanResolved versions in the moments environment: moments-popgen 1.6.0,
scipy 1.16.3, mpmath 1.3.0.