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

Add examples of using numpy traversal methods #150

Open
benjeffery opened this issue Nov 26, 2021 · 2 comments
Open

Add examples of using numpy traversal methods #150

benjeffery opened this issue Nov 26, 2021 · 2 comments

Comments

@benjeffery
Copy link
Member

See tskit-dev/tskit#1788

@hyanwong
Copy link
Member

I discussed this with @jeromekelleher - we wondered whether the example in the tutorial would be better moved to a section of the docs (not the tutorials), designed for simple examples like this. There we could illustrate 4 methods of getting the total branch length of a tree:

  1. Using tree.nodes() to iterate through
  2. Using numpy arrays
  3. High performance, using numpy arrays and numba
  4. Using the built-in branch length method

It would be nice to illustrate the difference in speed between the two, by picking an example that took (e.g.) 1 sec for method (1).

@hyanwong
Copy link
Member

hyanwong commented Dec 1, 2021

An example of 2. is given in tskit-dev/tskit#1788 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants