-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4780,6 +4780,21 @@ def __str__(self): | |
| ] | ||
| ) | ||
|
|
||
| def link_ancestors(self, samples, ancestors): | ||
| """ | ||
| See :meth:`TableCollection.link_ancestors`. | ||
| """ | ||
| samples = util.safe_np_int_cast(samples, np.int32) | ||
| ancestors = util.safe_np_int_cast(ancestors, np.int32) | ||
| ll_edge_table = self._llts.link_ancestors(samples, ancestors) | ||
| return EdgeTable(ll_table=ll_edge_table) | ||
|
|
||
| def map_ancestors(self, *args, **kwargs): | ||
| """ | ||
| Deprecated alias for :meth:`link_ancestors`. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe this is our opportunity to remove
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. although that would doubtless break someone's code somewhere...
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| """ | ||
| return self.link_ancestors(*args, **kwargs) | ||
|
|
||
| _MUTATOR_METHODS = { | ||
| "clear", | ||
| "sort", | ||
|
|
@@ -4803,8 +4818,6 @@ def __str__(self): | |
| "ibd_segments", | ||
| "fromdict", | ||
| "simplify", | ||
| "link_ancestors", | ||
| "map_ancestors", | ||
| } | ||
|
|
||
| def copy(self): | ||
|
|
||
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?