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

from_ms(): fix various issues with -es/-ej commands. #352

Merged
merged 1 commit into from
Jul 5, 2021

Conversation

grahamgower
Copy link
Member

Closes #350.
Closes #351.


This has introduced some ugliness into the main loop in ms.py:build_graph(), but I'm not sure much can be done about that. At least it paves the way for being able to write a to_ms() function and expect the output to be round-tripped. I've done a cursory search of the literature for some complex looking ms commands, and added tests that these can be converted to a demes graph (several failed before the code refactoring here, because simultaneous -ej/-es commands seem to be used widely by ms afficionados).

I haven't added SCRM's -eps command, but that shouldn't be too hard now (assuming someone requests it).
https://github.com/scrm/scrm/wiki/Command-Line-Options#population-splits--merges

@codecov
Copy link

codecov bot commented Jul 5, 2021

Codecov Report

Merging #352 (8091a32) into main (506b5dc) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #352   +/-   ##
=======================================
  Coverage   99.92%   99.92%           
=======================================
  Files           5        5           
  Lines        1308     1369   +61     
=======================================
+ Hits         1307     1368   +61     
  Misses          1        1           
Impacted Files Coverage Δ
demes/__main__.py 100.00% <ø> (ø)
demes/demes.py 100.00% <100.00%> (ø)
demes/ms.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 506b5dc...8091a32. Read the comment docs.

Copy link
Member

@jeromekelleher jeromekelleher left a comment

Choose a reason for hiding this comment

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

LGTM. Jeez these are ugly ms commands!

@grahamgower grahamgower merged commit 3e53eef into popsim-consortium:main Jul 5, 2021
@grahamgower
Copy link
Member Author

Ping me if you see any other crazy ms commands in your travels, and I'll double check things work as expected.

@grahamgower grahamgower deleted the ms branch July 6, 2021 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants