-
Notifications
You must be signed in to change notification settings - Fork 77
First pass at changing .length to .span #169
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
Codecov Report
@@ Coverage Diff @@
## master #169 +/- ##
==========================================
+ Coverage 85.95% 85.95% +<.01%
==========================================
Files 16 16
Lines 8705 8707 +2
Branches 1670 1670
==========================================
+ Hits 7482 7484 +2
Misses 732 732
Partials 491 491
Continue to review full report at Codecov.
|
Looks good, needs some tests though. Just need to ensure that length == span == (right - left) somewhere. |
Done, shall I squash? |
python/tskit/trees.py
Outdated
:attr:`.length`, which describes the length of the interval | ||
covered by the tree in genomic coordinates. | ||
(note that this is not related to the deprecated property :attr:`.length` | ||
which is a deprecated alias for the genomic :attr:`.span` covered by a tree) |
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.
deprecated twice here.
python/tests/test_highlevel.py
Outdated
@@ -1407,6 +1407,9 @@ def test_deprecated_apis(self): | |||
self.assertEqual( | |||
ts.get_pairwise_diversity(samples), ts.pairwise_diversity(samples)) | |||
self.assertTrue(np.array_equal(ts.get_samples(), ts.samples())) | |||
# Test APIs for a single tree in a ts | |||
self.assertEqual(ts.first().get_length, ts.first().span) | |||
self.assertEqual(ts.first().length, ts.first().span) |
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.
Be nice to check this somewhere on on not just the first tree. Also, check
l, r = tree.interval
tree.span == r -
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.
Yep - I've just re-written it (and put it in a more sensible place). Thanks.
OK looks good, can you squash please? (The |
11d1e06
to
77b9259
Compare
Done. Thanks for the tip. Will look into it |
Thanks @hyanwong, merging. |
Closes #29