Skip to content

Commit 2dbac3a

Browse files
committed
Make inference unittests work with tskit 0.2.0 missing data output
1 parent 515c8e1 commit 2dbac3a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/test_inference.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ class TestZeroInferenceSites(unittest.TestCase):
311311
Tests for the degenerate case in which we have no inference sites.
312312
"""
313313
def verify(self, genotypes):
314-
genotypes = np.array(genotypes, dtype=np.int8)
314+
genotypes = np.array(genotypes, dtype=np.uint8)
315315
m = genotypes.shape[0]
316316
with tsinfer.SampleData(sequence_length=m + 1) as sample_data:
317317
for j in range(m):
@@ -610,13 +610,13 @@ def verify_inserted_ancestors(self, ts):
610610
with tsinfer.SampleData(sequence_length=ts.sequence_length) as sample_data:
611611
for v in ts.variants():
612612
sample_data.add_site(v.position, v.genotypes, v.alleles)
613-
614613
ancestor_data = tsinfer.AncestorData(sample_data)
615614
tsinfer.build_simulated_ancestors(sample_data, ancestor_data, ts)
616615
ancestor_data.finalise()
617616

618-
A = np.zeros(
619-
(ancestor_data.num_sites, ancestor_data.num_ancestors), dtype=np.uint8)
617+
A = np.full(
618+
(ancestor_data.num_sites, ancestor_data.num_ancestors),
619+
tskit.MISSING_DATA, dtype=np.int8)
620620
start = ancestor_data.ancestors_start[:]
621621
end = ancestor_data.ancestors_end[:]
622622
ancestors = ancestor_data.ancestors_haplotype[:]

0 commit comments

Comments
 (0)