Skip to content

Conversation

@jeromekelleher
Copy link
Member

Next step on the road to decapitate (#2240, #2236). The idea is to implement this fully as a TableCollection method (not bothering with ts equivalent) in C.

Then decapitate is just the composition of this function and split_edges. The advantage of doing this function on its own, is that we then don't have to do a C version of decapitate (which requires faddling around with all the node default args again).

What do you think of the definition @petrelharp? Is the name ok? I haven't tested the mutation and migration stuff so far, could well be wrong.

@jeromekelleher jeromekelleher marked this pull request as ready for review May 26, 2022 11:09
@jeromekelleher jeromekelleher marked this pull request as draft May 26, 2022 11:09
@codecov
Copy link

codecov bot commented May 26, 2022

Codecov Report

Merging #2302 (a0080c2) into main (a9082d0) will decrease coverage by 0.05%.
The diff coverage is 75.90%.

❗ Current head a0080c2 differs from pull request most recent head b5b7f1c. Consider uploading reports for the commit b5b7f1c to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2302      +/-   ##
==========================================
- Coverage   93.29%   93.23%   -0.06%     
==========================================
  Files          28       28              
  Lines       26482    26565      +83     
  Branches     1211     1211              
==========================================
+ Hits        24706    24769      +63     
- Misses       1744     1764      +20     
  Partials       32       32              
Flag Coverage Δ
c-tests 92.23% <77.27%> (-0.08%) ⬇️
lwt-tests 89.05% <ø> (ø)
python-c-tests 71.35% <64.70%> (-0.01%) ⬇️
python-tests 98.86% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
python/_tskitmodule.c 90.60% <66.66%> (-0.06%) ⬇️
c/tskit/tables.c 90.20% <77.27%> (-0.12%) ⬇️
python/tskit/tables.py 98.89% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a9082d0...b5b7f1c. Read the comment docs.

@petrelharp
Copy link
Contributor

The name seems good! We also have tables.delete_sites and tables.delete_intervals, which do similar things.

@petrelharp
Copy link
Contributor

The definition also seems good - it does what we want for decapitate. The docstring will definitely need a "seealso decapitate" note, as people might grab this when they need that, though.

@jeromekelleher jeromekelleher force-pushed the delete-older branch 2 times, most recently from e2206e2 to 7d8fda4 Compare May 31, 2022 20:23
@jeromekelleher jeromekelleher force-pushed the delete-older branch 2 times, most recently from a0080c2 to 9465099 Compare June 9, 2022 13:54
@jeromekelleher jeromekelleher marked this pull request as ready for review June 9, 2022 13:54
@jeromekelleher
Copy link
Member Author

I think this is ready to go - I'll update the changelog and docstring (to say maybe you want decapitate?) for this when decapitate is done in #2240

@jeromekelleher jeromekelleher requested a review from benjeffery June 9, 2022 13:56
tsk_table_collection_t *self, tsk_flags_t options);
int tsk_table_collection_compute_mutation_times(
tsk_table_collection_t *self, double *random, tsk_flags_t TSK_UNUSED(options));
tsk_table_collection_t *self, double *random, tsk_flags_t options);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops - you've un-marked tsk_table_collection_compute_mutation_times's options as unused (they are actually unused; I just checked)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tsk_table_collection_t *self, double *random, tsk_flags_t options);
tsk_table_collection_t *self, double *random, tsk_flags_t TSK_UNUSED(options));

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to do this in the header file though, it's just in the .c.

Copy link
Contributor

@petrelharp petrelharp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@benjeffery benjeffery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@mergify mergify bot merged commit 830c9e7 into tskit-dev:main Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants