Skip to content

Commit 279f480

Browse files
jeromekelleherbenjeffery
authored andcommitted
Update to tskit 1.0, fix problems with initial state
Closes #2434 Closes #2432
1 parent 7f854ac commit 279f480

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

CHANGELOG.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,28 @@
88
- The `FixedPedigree` simulation model now supports internal samples ({issue}`1855`,
99
{pr}`2321`, {pr}`2326`, {pr}`2388`, {user}`abureau`, {user}`jeromekelleher`).
1010

11+
- Add wheels on Windows ({pr}`2414`, {issue}`2200`,{user}`benjeffery`)
12+
13+
**Maintenance**
14+
1115
- Add support and wheels for Python3.13
1216

1317
- Drop Python 3.9 support, require Python >= 3.10 ({pr}`2418`, {user}`benjeffery`)
1418

15-
- Add wheels on Windows ({pr}`2414`, {issue}`2200`,{user}`benjeffery`)
16-
1719
**Breaking changes**:
1820

21+
- Require tskit >= 1.0 ({issue}`2434`).
22+
1923
- The `.asdict()` methods for Demography, Population, and Event classes in the
2024
demography submodule now return a `__class__` key. This is also stored in their
2125
provenance entries, to help recreate demography objects from provenance.
2226
({pr}`{2368}, {user}`hyanwong`)
2327

28+
**Bugfixes**
29+
30+
- Fix problem with initial_state and tskit 1.0 ({issue}`2434`, {pr}`2432`,
31+
{user}`jeromekelleher'.
32+
2433
## [1.3.4] - 2025-05-01
2534

2635
**Bug fixes**:

msprime/ancestry.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,9 @@ def _parse_sim_ancestry(
897897
if initial_state is not None:
898898
if isinstance(initial_state, tskit.TreeSequence):
899899
initial_state = initial_state.dump_tables()
900-
elif not isinstance(initial_state, tskit.TableCollection):
900+
elif not isinstance(
901+
initial_state, (tskit.TableCollection, tskit.ImmutableTableCollection)
902+
):
901903
raise TypeError(
902904
"initial_state must either be a TreeSequence or TableCollection instance"
903905
)

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ keywords = [
3636
dependencies = [
3737
"numpy>=1.23.5",
3838
"newick>=1.3.0",
39-
"tskit>=0.5.2",
39+
"tskit>=1.0.0",
4040
"demes>=0.2"
4141
]
4242
dynamic = ["version"]
@@ -85,7 +85,7 @@ test = [
8585
"setuptools==80.9.0",
8686
"scipy==1.13.1; python_version<='3.10'",
8787
"scipy==1.16.1; python_version>'3.10'",
88-
"tskit==0.6.4",
88+
"tskit==1.0.0",
8989
"twine==6.2.0"
9090
]
9191

@@ -101,7 +101,7 @@ docs = [
101101
"sphinx-argparse==0.5.2",
102102
"sphinx-book-theme",
103103
"sphinx-issues==5.0.1",
104-
"tskit==0.6.4",
104+
"tskit==1.0.0",
105105
"scipy==1.16.1"
106106
]
107107

@@ -124,7 +124,7 @@ dev = [
124124
"pytest",
125125
"pytest-cov",
126126
"pytest-xdist",
127-
"tskit>=0.5.2",
127+
"tskit>=1.0.0",
128128
"kastore",
129129
"sphinx-book-theme",
130130
"scipy",
@@ -159,4 +159,4 @@ addopts = "-n 4"
159159
testpaths = ["tests"]
160160
filterwarnings = [
161161
"ignore:.*usage of `cmp`.*:DeprecationWarning:demes"
162-
]
162+
]

tests/test_ancestry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2628,7 +2628,7 @@ def test_num_labels(self):
26282628
# Running simulations with different numbers of labels in the default
26292629
# setting should have no effect.
26302630
tables = [
2631-
msprime.simulate(10, num_labels=num_labels, random_seed=1).tables
2631+
msprime.simulate(10, num_labels=num_labels, random_seed=1).dump_tables()
26322632
for num_labels in range(1, 5)
26332633
]
26342634
for t in tables:

0 commit comments

Comments
 (0)