-
Notifications
You must be signed in to change notification settings - Fork 79
Add link-ancestors to TreeSequence and ImmutableTableCollection #3312
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3312 +/- ##
==========================================
- Coverage 89.80% 89.73% -0.07%
==========================================
Files 29 29
Lines 31026 31079 +53
Branches 5679 5686 +7
==========================================
+ Hits 27863 27890 +27
- Misses 1777 1802 +25
- Partials 1386 1387 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
I think the motivation for not making this a TS method earlier was that the API seemed not totally mature. But maybe that ship has sailed. |
|
|
||
| def map_ancestors(self, *args, **kwargs): | ||
| """ | ||
| Deprecated alias for :meth:`link_ancestors`. |
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.
maybe this is our opportunity to remove map_ancestors?
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.
although that would doubtless break someone's code somewhere...
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.
Let's not bother - it's not doing any harm and no point in breaking code if we don't have to
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.
LGTM!
|
I meant "looks good except the code coverage" |
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.
LGTM. I think we need some test coverage, including some basic tests that just check that it runs and gives a meaningful result on a simple tree sequence (or over the example tree sequences).
Also need test coverage on the low-level meth obvs
| assert ancestor_table == lib_result | ||
| ts_result = ts.link_ancestors(samples, ancestors) | ||
| assert ancestor_table == ts_result | ||
| if _tskit.HAS_NUMPY_2: |
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.
I don't think the HAS_NUMPY_2 thing is needed, should work either way right?
|
|
||
| def map_ancestors(self, *args, **kwargs): | ||
| """ | ||
| Deprecated alias for :meth:`link_ancestors`. |
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.
Let's not bother - it's not doing any harm and no point in breaking code if we don't have to
Fixes #3311
As this method doesn't mutate tables - shouldn't it be on
TreeSequenceandImmutableTC?