Skip to content

Commit 7201603

Browse files
committed
Add a test to check we properly scale for Ne
1 parent 85a51f3 commit 7201603

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_accuracy.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,13 @@ def test_basic(
132132

133133
spearmans_r = scipy.stats.spearmanr(expected, observed).correlation
134134
assert spearmans_r >= min_vals["spearmans_r"][src]
135+
136+
@pytest.mark.parametrize("Ne", [0.1, 1, 400])
137+
def test_scaling(self, Ne):
138+
"""
139+
Test that we are in the right theoretical ballpark given known Ne
140+
"""
141+
ts = tskit.Tree.generate_comb(2).tree_sequence
142+
dts = tsdate.date(ts, Ne=Ne, mutation_rate=None)
143+
# Check the date is within 10% of the expected
144+
assert 0.9 < dts.node(dts.first().root).time / (2 * Ne) < 1.1

0 commit comments

Comments
 (0)