Skip to content

Commit cf55fd7

Browse files
hyanwongmergify[bot]
authored andcommitted
Remove an unused parameter from make_ancestors_ts
make_ancestors_ts is not exposed, but it's still confusing to have a param that is never used.
1 parent 1f63180 commit cf55fd7

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

tests/test_evaluation.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -529,9 +529,7 @@ class TestMakeAncestorsTs:
529529

530530
def verify_from_source(self, ts, remove_leaves):
531531
samples = tsinfer.SampleData.from_tree_sequence(ts, use_sites_time=False)
532-
ancestors_ts = tsinfer.make_ancestors_ts(
533-
samples, ts, remove_leaves=remove_leaves
534-
)
532+
ancestors_ts = tsinfer.make_ancestors_ts(ts, remove_leaves=remove_leaves)
535533
tsinfer.check_ancestors_ts(ancestors_ts)
536534
for engine in [tsinfer.PY_ENGINE, tsinfer.C_ENGINE]:
537535
final_ts = tsinfer.match_samples(samples, ancestors_ts, engine=engine)
@@ -546,9 +544,7 @@ def verify_from_inferred(self, remove_leaves):
546544
ts = msprime.simulate(15, recombination_rate=1, mutation_rate=2, random_seed=3)
547545
samples = tsinfer.SampleData.from_tree_sequence(ts)
548546
inferred = tsinfer.infer(samples)
549-
ancestors_ts = tsinfer.make_ancestors_ts(
550-
samples, inferred, remove_leaves=remove_leaves
551-
)
547+
ancestors_ts = tsinfer.make_ancestors_ts(inferred, remove_leaves=remove_leaves)
552548
tsinfer.check_ancestors_ts(ancestors_ts)
553549
for engine in [tsinfer.PY_ENGINE, tsinfer.C_ENGINE]:
554550
final_ts = tsinfer.match_samples(samples, ancestors_ts, engine=engine)

tests/test_inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1788,7 +1788,7 @@ def test_diploid_individuals(self):
17881788
samples.add_individual(ploidy=2, location=[100 * j], metadata={"X": j})
17891789
for var in ts.variants():
17901790
samples.add_site(var.site.position, var.genotypes)
1791-
ancestors_ts = eval_util.make_ancestors_ts(samples, ts)
1791+
ancestors_ts = eval_util.make_ancestors_ts(ts)
17921792
self.verify(samples, ancestors_ts)
17931793

17941794

tsinfer/eval_util.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,11 +440,11 @@ def subset_sites(ts, position):
440440
return tables.tree_sequence()
441441

442442

443-
def make_ancestors_ts(samples, ts, remove_leaves=False):
443+
def make_ancestors_ts(ts, remove_leaves=False):
444444
"""
445445
Return a tree sequence suitable for use as an ancestors tree sequence from the
446-
specified source tree sequence using the samples in the specified sample
447-
data. If remove_leaves is True, remove any nodes that are at time zero.
446+
specified source tree sequence. If remove_leaves is True, remove any nodes that
447+
are at time zero.
448448
449449
We generally assume that this is a standard tree sequence, as output by
450450
msprime.simulate. We remove populations, as normally ancestors tree sequences
@@ -693,7 +693,7 @@ def run_perfect_inference(
693693
if use_ts:
694694
# Use the actual tree sequence that was provided as the basis for copying.
695695
logger.info("Using provided tree sequence")
696-
ancestors_ts = make_ancestors_ts(sample_data, ts, remove_leaves=True)
696+
ancestors_ts = make_ancestors_ts(ts, remove_leaves=True)
697697
else:
698698
ancestor_data = formats.AncestorData(sample_data)
699699
build_simulated_ancestors(

0 commit comments

Comments
 (0)