You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've talked about having a numba support for tskit in various places, so let's add a new optional module "tskit.jit" which provides basic utilities for numba. This would be an optional dependency, and have an entirely separate namespace. E.g
importtskit.jitastsjitimportnumbaasnb@nb.njitdefalgorithm(tree_pos)
whiletree_pos.next():
forjinrange(tree_pos.out_range[0], tree_pos.out_range[1]):
e=tree_pos.edge_removal_order[j]
# Do something with out edge ID eforjinrange(tree_pos.in_range[0], tree_pos.in_range[1]):
e=tree_pos.edge_insertion_order[j]
# Do something with in edge ID etree_pos=tsjit.TreePosition(ts)
algorithm(tree_pos)
This should enable a lot of downstream algorithms and reduce code duplication.
So, to be clear, this would not be installed by default and would only be included in the install if we did pip install tskit[jit] or something similar.
Activity
jeromekelleher commentedon Apr 7, 2025
So, to be clear, this would not be installed by default and would only be included in the install if we did
pip install tskit[jit]or something similar.gregorgorjanc commentedon Apr 7, 2025
Is this so you don't depend on numba by default?
jeromekelleher commentedon Apr 7, 2025
Yep. It's a tricky dependency, not needed by downstream things like msprime.
benjeffery commentedon Jun 13, 2025
See also #2778
benjeffery commentedon Sep 22, 2025
Fixed in several PRs e.g. #3225, #3256, #3255