Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve symmetric migrations into pairs of asymmetric migrations. #268

Merged
merged 2 commits into from
Apr 7, 2021

Conversation

grahamgower
Copy link
Member

Also restores the migration simplification code that was removed
in commit e2a7e05 (#209).

Closes #263.

@github-actions
Copy link

github-actions bot commented Apr 5, 2021

Binder 👈 Launch a binder notebook on this branch for commit e92bc57

I will automatically update this comment whenever this PR is modified

Binder 👈 Launch a binder notebook on this branch for commit ed105ea

@codecov
Copy link

codecov bot commented Apr 5, 2021

Codecov Report

Merging #268 (ed105ea) into main (db58a7b) will increase coverage by 0.54%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #268      +/-   ##
==========================================
+ Coverage   96.14%   96.69%   +0.54%     
==========================================
  Files           7        7              
  Lines        1064     1058       -6     
==========================================
  Hits         1023     1023              
+ Misses         41       35       -6     
Impacted Files Coverage Δ
demes/__init__.py 87.50% <ø> (ø)
demes/convert/msprime_.py 92.98% <100.00%> (+3.09%) ⬆️
demes/demes.py 100.00% <100.00%> (ø)

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 db58a7b...ed105ea. Read the comment docs.

Also restores the migration simplification code that was removed
in commit e2a7e05 (popsim-consortium#209).

Closes popsim-consortium#263.
Fixes jupyter-book/docutils-0.17 incompatilibity.
Copy link
Member

@apragsdale apragsdale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me! Lots of fiddling, but I think it will end up simplifying things again quite a bit. I also like that it gets the migration simplification back in there when using asdict_simplified :)

@@ -11,7 +12,6 @@
Builder,
Epoch,
AsymmetricMigration,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we only have AsymmetricMigration as the internal continuous migration class, should we call it simply Migration? Or leave it as AsymmetricMigration so that we leave open the option of reintroducing SymmetricMigration?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, good question. I left it as AsymmetricMigration initially because it was easiest at the first stage of refactoring. But having this be explicit might help reduce confusion (at the expense of verbosity). And as you say, its not implausible that we'd introduce something called SymmetricMigration again in the future. But I don't have a strong opinion on what this should be called.

Copy link
Member

@apragsdale apragsdale Apr 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, it was more of a question than suggestion that we should change it anyway. I'm happy to keep it as AsymmetricMigration, as it does reduce any possible confusion (and also allows us to introduce a SymmetricMigration if we are compelled to in the future again). Most users will still just see the add_migration function in the Builder, and won't even know how it is being represented behind the scene, I imagine.

@grahamgower grahamgower merged commit 2edec27 into popsim-consortium:main Apr 7, 2021
@grahamgower grahamgower deleted the migration branch April 8, 2021 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nail down semantics for many-deme symmetric migrations
2 participants