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

time slice in samples #1692

Closed
mufernando opened this issue Sep 10, 2021 · 2 comments · Fixed by #1700
Closed

time slice in samples #1692

mufernando opened this issue Sep 10, 2021 · 2 comments · Fixed by #1700
Labels
enhancement New feature or request Python API Issue is about the Python API

Comments

@mufernando
Copy link
Member

I always seem to want to get samples from a tree sequence within a time slice. Although this is not hard to do, I thought more people might be running into this situation and we could add a start_time and end_time argument to TreeSequence.samples(). This could be done just on the Python API end with a simple boolean mask applied on top of the array (the same way we do it for populations), see here.

Let me know if you think this is worth implementing and I can work on a PR.

@jeromekelleher
Copy link
Member

I like it! My only hesitancy is about the names of the parameters --- would min_time and max_time be better? "start" and "end" imply a process, but we're not simulating here. max and min have an unambiguous interpretation in terms of the values of the time array.

@mufernando
Copy link
Member Author

I really like the idea of min/max as names for the parameters. Will work on a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Python API Issue is about the Python API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants