Skip to content

Commit

Permalink
Merge pull request #156 from tskit-dev/coalescent_time_internal
Browse files Browse the repository at this point in the history
Use Unscaled Time Internally
  • Loading branch information
awohns authored Jun 2, 2021
2 parents e38d05b + b7262ae commit 2c200bc
Show file tree
Hide file tree
Showing 5 changed files with 197 additions and 159 deletions.
4 changes: 2 additions & 2 deletions tests/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ def test_cached_prior(self):
if os.path.isfile(fn):
raise AssertionError(f"The file {fn} already exists. Delete before testing")
with self.assertLogs(level="WARNING") as log:
priors_approx10 = ConditionalCoalescentTimes(10)
priors_approx10 = ConditionalCoalescentTimes(10, Ne=1)
assert len(log.output) == 1
assert "user cache" in log.output[0]
priors_approx10.add(10)
# Check we have created the prior file
assert os.path.isfile(fn)
priors_approxNone = ConditionalCoalescentTimes(None)
priors_approxNone = ConditionalCoalescentTimes(None, Ne=1)
priors_approxNone.add(10)
assert np.allclose(priors_approx10[10], priors_approxNone[10], equal_nan=True)
# Test when using a bigger n that we're using the precalculated version
Expand Down
Loading

0 comments on commit 2c200bc

Please sign in to comment.