-
Notifications
You must be signed in to change notification settings - Fork 87
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
Convert demographic models to Demes YAML files #1233
base: main
Are you sure you want to change the base?
Conversation
Some issues arising from the Demes conversion:
|
Generally looks good to me. I'm pleasantly surprised with how well the autoconversions have gone. I think we're just going to have to break the population IDs and there's not a lot we can do about that. We'll need to think through the consequences and see how we manage the breakage. We haven't done a release in 2 years though, so I think there's going to be a pretty painful process of getting things up to release quality anyway. |
Yes, this looks great! But, I'm (again) a bit lost with the time units conversion. Could you write down what your philosophy is here? I guess I'm trying to sort out in which time units should values be written in:
|
It would be nice to clean up the time units, but completely fixing that might be a bit beyond the scope of the present PR. Your input as to what we should aspire to here would be very valuable!
I want the time units in the .yaml file to reflect the description of the demographic model from the originating publication(s). I think this is the least confusing option, and least error prone for new models going forward. Publications for the current stdpopsim demographic models will need to be checked manually, and I've not done that yet. This should (eventually) happen in this PR. We have an
I'm not sure. But either choice should be easy to implement once conversion to YAML is complete. I don't think we need to touch this in the current PR.
I think these should all remain in generations. So, no change. In this PR, the conversion to generations will probably happen when the model is read in from the catalog (to keep the internal representation as an msprime.Demography for now). Later, we could pivot away from this and maybe do the conversion to generations when/as needed for each simulation engine. There is some weirdness/redundancy in time unit conversion in the slim engine, as discussed in #1197. We should fix this, but that is beyond the scope of the current PR. Ideally, this PR won't touch the slim engine at all. In some future PR, we can convert the Demes model to a SLiM representation directly instead of first converting via msprime.DemographyDebugger. I have some demes->SLiM experiments here in case you're interested. But it's not a drop-in replacement for what we have in stdpopsim. |
That sounds great. What's the role of the |
It's an ad-hoc data structure used here to convert the stdpopsim demographic model into the time units used in the original publication, so that those units can be used when converting to the Demes YAML file. This info isn't properly recorded in the demographic models (those are all in generations). I think the |
one question i have on the time unit conventions now -- should we specify in the documentation which units (gens vs years) that models should be implemented in? looking at #1197 it seems like given the redundancy that @grahamgower built into the slim engine, the issue before was more about style and clarity than correctness. i'd say that we could force devs to just, say, do everything in generations for all future models. |
Please just ignore what I did with conversion of time units for the SLiM engine - it was a mistake which we should fix at some point. It's confusing and unnecessary. We should definitely be clear in the dev docs about how we want folks to write models. We could force everyone to write models in generations, but do you think this is the best thing to do for model clarity and correctness? It means that model writers will convert units (probably manually) from what is written in a publication. |
I'm with you - specifying things in the units of the original publication is the way to go. |
Fyi, @mufernando is using a yaml over in #1256 |
If anyone is interested in picking up this PR and pushing it over the line, please shout out! |
Closes #962.
Lots of decisions needed as to how we proceed, but this shows the basic shape of things. Bikeshedding welcome!