-
Notifications
You must be signed in to change notification settings - Fork 73
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
Add left
and right
arguments to TreeSequence.trees()
#24
Comments
After discussion on #121, I think the best approach here is to add This isn't hard to do, but will require implementation at the C level. |
Copied from #121: Note that some of the docs use the words [left,right) rather than [start, stop), e.g. https://tskit.readthedocs.io/en/latest/python-api.html#tskit.TreeSequence.edge_diffs . "left" and "right" have the advantage that it's clearer (to me anyway) that we are talking about a length of genome and not e.g. tree indexes, or node times. But it has the disadvantage that it seems weird to specify e.g. |
Thinking about how to implement this, I think the right way to do it is to add a The rest of the functionality can be built on this then. |
Adding this to the 1.0 milestone for now as something to review and plan ahead for. |
To match the |
Also we can implement this quiet efficiently since #2661 was merged |
start
and stop
arguments to TreeSequence.trees()left
and right
arguments to TreeSequence.trees()
These should be seen as analogous to the
start
andstop
arguments to Python's builtinrange
, and be specified in tree sequence coordinates. We should initially ensure that start < stop, but in future we could allow start > stop, and enable reverse iteration in this way.It would be best to do this with a low-level
sparse_tree_seek()
method to position the tree at the correct location.The text was updated successfully, but these errors were encountered: