-
Notifications
You must be signed in to change notification settings - Fork 78
Set .span property for Interval #811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
de2ffd9 to
686f7c6
Compare
|
Tests are very minimal, but I can't think of any corner cases, really. |
|
It'd be nice to do a bit more testing. To pass these tests, all I'd need to do is have @property
def span(self):
return 1.0 |
686f7c6 to
f60f589
Compare
|
Like this? I simply changed it to test a few trees. |
python/tests/test_highlevel.py
Outdated
| self.assertGreater(ts.num_trees, 1) | ||
| breakpoints = list(ts.breakpoints()) | ||
| self.assertEqual(breakpoints[0], 0) | ||
| self.assertAlmostEqual(breakpoints[-1], ts.sequence_length) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be exactly equal, shouldn't they? We'd only expect numerical differences if we've performed some calculations on the values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine. I wasn't sure how the breakpoints were calculated, but if the last one is simply passed through from the seq length, then that should be fine. I'll change it.
jeromekelleher
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks @hyanwong. Minor comment.
benjeffery
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @hyanwong I missed the notifications on your push. Looks good modulo JK's comment.
f60f589 to
6367e37
Compare
|
Should be done now |
No description provided.