msprime icon indicating copy to clipboard operation
msprime copied to clipboard

Initial outline for Trajectory refactoring

Open jeromekelleher opened this issue 2 years ago • 4 comments

Here's a rough outline for what I'm thinking the low-level C will look like. I think it's worth getting things right here in the Python version before looking at the C --- it's much faster to try different things out here.

As discussed in #1803

Does this look like roughly the right design @andrewkern, @molpopgen?

Looks like we're missing quite a bit of stuff from the Python version though @andrewkern?

jeromekelleher avatar Aug 12 '21 14:08 jeromekelleher

Codecov Report

Merging #1808 (e73e8aa) into main (7a49bc6) will decrease coverage by 0.01%. The diff coverage is 87.69%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1808      +/-   ##
==========================================
- Coverage   90.92%   90.90%   -0.02%     
==========================================
  Files          20       20              
  Lines       10511    10538      +27     
  Branches     2226     2231       +5     
==========================================
+ Hits         9557     9580      +23     
- Misses        497      498       +1     
- Partials      457      460       +3     
Flag Coverage Δ
C 90.90% <87.69%> (-0.02%) :arrow_down:
python 97.52% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lib/util.h 100.00% <ø> (ø)
lib/msprime.c 85.38% <87.50%> (-0.01%) :arrow_down:
lib/util.c 98.06% <100.00%> (+0.01%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7a49bc6...e73e8aa. Read the comment docs.

codecov[bot] avatar Aug 12 '21 14:08 codecov[bot]

This looks like it is on the right track. One source of confusion, for me at least, is how msprime's "new" ploidy argument gets handled here? This came up in the review of the other PR from @andrewkern -- the neutral fixation time being tested was 2n instead of 4n, and it wasn't clear (to me) why. Presumably, these trajectories should be considering an effective size of ploidy*n?

molpopgen avatar Aug 12 '21 17:08 molpopgen

We don't have ploidy in the Python version @molpopgen, but we probably should. But yes, I think it would be best if we did things in the general case with arbitrary ploidy.

jeromekelleher avatar Aug 12 '21 17:08 jeromekelleher

But yes, I think it would be best if we did things in the general case with arbitrary ploidy.

Yeah, seems prudent to iron out any wrinkles ASAP

molpopgen avatar Aug 12 '21 18:08 molpopgen