Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

- Add support for Python 3.13, minimum version is now 3.10.

- Make tsdate compatible with tskit 1.0.0.

## [0.2.3] - 2025-06-07

**Breaking changes**
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ classifiers = [
"Topic :: Scientific/Engineering :: Bio-Informatics",
]
dependencies = [
"tskit>=0.5.8",
"tskit>=1.0.0",
"numpy",
"scipy>=1.13.0",
"numba>=0.58.1",
Expand Down Expand Up @@ -91,7 +91,7 @@ docs = [
"pandas==2.3.2",
"stdpopsim==0.3.0",
"tsinfer==0.4.1",
"tskit==0.6.4",
"tskit==1.0.0",
"jupyter-book==1.0.4.post1",
"sphinx-issues==5.0.1",
"sphinx-argparse==0.5.2",
Expand Down
3 changes: 3 additions & 0 deletions tests/test_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ def test_multiple_mutations_same_node_and_pos(self):
tables.mutations.add_row(site=s, node=1, derived_state="1", time=1.5)
tables.mutations.add_row(site=s, node=1, derived_state="2", time=1)
tables.mutations.add_row(site=s, node=1, derived_state="3", time=0.5)
tables.sort()
tables.build_index()
tables.compute_mutation_parents()
ts = tsdate.date(tables.tree_sequence(), mutation_rate=1)
assert np.all(np.diff(ts.mutations_time) < 0)
for m in ts.mutations():
Expand Down
6 changes: 3 additions & 3 deletions tests/utility_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,9 +979,9 @@ def single_tree_ts_2mutations_n3():
)
mutations = io.StringIO(
"""\
site node derived_state
0 3 1
0 1 0
site node derived_state parent
0 3 1 -1
0 1 0 0
"""
)
return tskit.load_text(
Expand Down
2 changes: 2 additions & 0 deletions tsdate/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ def remove_edges(ts, edge_id_remove_list):
tables.edges.append(e)
assert len(new_edges) == 0
tables.sort()
tables.build_index()
tables.compute_mutation_parents()
return tables.tree_sequence()


Expand Down
2 changes: 2 additions & 0 deletions tsdate/phasing.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,4 +463,6 @@ def rephase_singletons(ts, use_node_times=True, random_seed=None):
tables.mutations.node = mutations_node
tables.mutations.time = mutations_time
tables.sort()
tables.build_index()
tables.compute_mutation_parents()
return tables.tree_sequence()
2 changes: 2 additions & 0 deletions tsdate/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,8 @@ def split_disjoint_nodes(ts, *, record_provenance=None):
# Update the mutations table
tables.mutations.node = mutations_node
tables.sort()
tables.build_index()
tables.compute_mutation_parents()

assert np.array_equal(
tables.nodes.time[tables.mutations.node], ts.nodes_time[ts.mutations_node]
Expand Down