Skip to content

Column takeset - #2032

Merged
mergify[bot] merged 1 commit into
tskit-dev:mainfrom
jeromekelleher:take-cols
Mar 8, 2022
Merged

mergify[bot] merged 1 commit into
tskit-dev:mainfrom
jeromekelleher:take-cols

Conversation

@jeromekelleher

Copy link
Copy Markdown
Member

Provide x_table_takeset_columns

Part of #2016, #1977, #537, #538

This is my initial outline for discussion, and completely untested. What do you think @benjeffery?

@codecov

codecov Bot commented Dec 8, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #2032 (c527398) into main (bb43c74) will decrease coverage by 0.20%.
The diff coverage is 90.98%.

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

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2032      +/-   ##
==========================================
- Coverage   93.33%   93.12%   -0.21%     
==========================================
  Files          27       27              
  Lines       25538    26452     +914     
  Branches     1163     1292     +129     
==========================================
+ Hits        23835    24633     +798     
- Misses       1673     1787     +114     
- Partials       30       32       +2     
Flag Coverage Δ
c-tests 92.25% <90.98%> (-0.01%) ⬇️
lwt-tests 89.05% <ø> (ø)
python-c-tests 72.10% <ø> (+<0.01%) ⬆️
python-tests 98.89% <ø> (ø)

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

Impacted Files Coverage Δ
c/tskit/tables.c 90.21% <90.98%> (-0.06%) ⬇️
python/tskit/tables.py 93.46% <0.00%> (-5.44%) ⬇️
python/_tskitmodule.c 90.96% <0.00%> (+0.03%) ⬆️
c/tskit/genotypes.c 92.58% <0.00%> (+2.83%) ⬆️

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 bb43c74...c0ef9e4. Read the comment docs.

@benjeffery benjeffery left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, shame we have to duplicate some logic but a separate function is the way.

Comment thread c/tskit/tables.c Resolved
@benjeffery

Copy link
Copy Markdown
Member

I've rebased to master, trying this out with the kastore changes.

@benjeffery

Copy link
Copy Markdown
Member

Added an initial test and fix. Next step is testing missing columns and bad combos.

@jeromekelleher

Copy link
Copy Markdown
Member Author

Great - can you ping me when you'd like some input here please? (Would it be simpler to start your own PR or is it the same thing to just push to my branch? I don't mind)

@benjeffery

Copy link
Copy Markdown
Member

Great - can you ping me when you'd like some input here please? (Would it be simpler to start your own PR or is it the same thing to just push to my branch? I don't mind)

My plan is to complete the proposal and tests for the IndividualTable, then get feedback. It's almost there so later today. Will push to this one if that's ok!

@benjeffery

Copy link
Copy Markdown
Member

@jeromekelleher Had to move things about to get errors to happen before memory is changed. I think this is worth a review now.

@jeromekelleher

Copy link
Copy Markdown
Member Author

LGTM! I've had a good think about how we might avoid the duplication of NULL logic between here and append_columns but I can't see how it could be done (at least not in a way that would be worse than the code duplication). Press on with this pattern would be my vote.

@benjeffery

Copy link
Copy Markdown
Member

Great, I have commenced the great pasting ritual.

@benjeffery
benjeffery marked this pull request as ready for review March 2, 2022 17:41
@benjeffery

Copy link
Copy Markdown
Member

@jeromekelleher Think this is ready to review now!

@benjeffery

Copy link
Copy Markdown
Member

Just realised we also need takeset indexes too!

@benjeffery

Copy link
Copy Markdown
Member

@jeromekelleher Ok! I think we are good here, I've used these methods over at #2143 successfully.

@benjeffery

Copy link
Copy Markdown
Member

Gah, missing coverage on all the ragged-column-contents error branches. Will add that in.

@benjeffery
benjeffery force-pushed the take-cols branch 5 times, most recently from 38398c7 to dbd2e34 Compare March 8, 2022 00:41
@benjeffery

Copy link
Copy Markdown
Member

Ok, tests added. I think all the remaining uncovered branches are only triggerable by malloc errors.

@jeromekelleher jeromekelleher left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Looks great! Thanks for slogging through this @benjeffery.

I think we just need to add a few tests to cover the check_ragged_column calls on the input. It should be straightforward enough to do by setting x_col_offset = -1 (or something). That will bump up the test coverage quite a bit.

Comment thread c/tskit/tables.c Resolved
Comment thread c/tskit/tables.c Resolved
Comment thread c/tskit/tables.c Resolved
Comment thread c/tskit/tables.c Resolved
Comment thread c/tskit/tables.c Resolved
Comment thread c/tskit/tables.c Resolved
@benjeffery
benjeffery force-pushed the take-cols branch 3 times, most recently from a94a620 to cdb753e Compare March 8, 2022 11:29
@jeromekelleher

Copy link
Copy Markdown
Member Author

Can you ping me when this is ready for a last look please @benjeffery?

@benjeffery

Copy link
Copy Markdown
Member

@jeromekelleher Ok! Coverage looks a lot better.

@jeromekelleher jeromekelleher left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Great, let's merge!

(I can't approve this as it's my PR - you'll need to approve yourself I think)

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.

2 participants