-
Notifications
You must be signed in to change notification settings - Fork 79
add keep_unary_in_individuals to python and test #1156
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
Conversation
|
Yeah, proposal seems good to me @petrelharp. We can see how keep_unary_flag = False
keep_unary_in_individuals = False
if keep_unary == "individuals":
keep_unary_in_individuals = True
else:
keep_unary_flag = keep_unaryThat should be safe enough? |
|
Sounds good. I think I'm handing this over to @hyanwong though; LMK if you'd like me to have a go at something (it'll be later in the week, though). |
|
I can easily implement this calling syntax, and the simplify fix. It's the forward time simulations for the testing that I'm dreading. FWIW, my test code in SLiM simply slices through a Wright-Fisher TS at a fixed time, allocating individuals to all the nodes, then, post- |
|
As I mentioned in #1120 I think the main extra extension would be to allow a bit flag specifying the nodes with matching flags to keep if unary. I'm not sure how this would be incorporated into the scheme above that @petrelharp suggests, although I'm sure it would be possible somehow. |
|
Well, let's see. How about
I can't jump in on this at the moment (but have time to write this up while my MCMCs are running). |
Should we have some string values that are the equivalent of True and False, so that people can move to using strings. For example, the string values could be "all", "in_individuals", "". I guess we would also want the default to be |
|
Also, I assume I should add this in to the python implementation of simplify in |
|
And I just remembered another options we might want for unary nodes (this is, I think, what we want in tsinfer), which is to keep unary nodes only if they are not unary somewhere else in the tree sequence. In other works, delete unary nodes in the ancestry only if they are unary everywhere. |
|
Closed in favour of #1190 |
Will close #1120; see discussion there; just getting things started.
In particular, I like the idea of having
keep_unary=(True|False|"individuals"), though - seems appropriate, given that keep_unary_individuals should give a strict subset of keep_unary, and extensible. Were I to do this, I'd keep the low-level interface the same, and just do the translation in the pythonTableCollection.simplifycode.