Skip to content

Conversation

@molpopgen
Copy link
Member

@molpopgen molpopgen commented May 3, 2021

Fixes #1327

PR Checklist:

  • Tests that fully cover new/changed functionality.
  • Documentation including tutorial content if appropriate.
  • Changelogs, if there are API changes.

@codecov
Copy link

codecov bot commented May 3, 2021

Codecov Report

Merging #1337 (6e906bc) into main (cf38edb) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head 6e906bc differs from pull request most recent head 6760f6e. Consider uploading reports for the commit 6760f6e to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1337      +/-   ##
==========================================
- Coverage   93.85%   93.83%   -0.02%     
==========================================
  Files          26       26              
  Lines       22349    22344       -5     
  Branches     1060     1060              
==========================================
- Hits        20975    20967       -8     
- Misses       1340     1343       +3     
  Partials       34       34              
Flag Coverage Δ
c-tests 92.41% <100.00%> (-0.04%) ⬇️
lwt-tests 92.97% <ø> (ø)
python-c-tests 95.19% <ø> (ø)
python-tests 98.80% <ø> (ø)

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

Impacted Files Coverage Δ
c/tskit/tables.c 90.80% <100.00%> (-0.06%) ⬇️
c/tskit/trees.c 94.87% <100.00%> (ø)

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 cf38edb...6760f6e. Read the comment docs.

@jeromekelleher
Copy link
Member

jeromekelleher commented May 4, 2021

Looks great, thanks for this @molpopgen. I'd be inclined to do a "hard break" here by removing the TSK_NO_BUILD_INDEXES flag and not adding the new TSK_BUILD_INDEXES_IF_ABSENT. The old behaviour is just plain weird I think, and the only code we're likely to break is the test suite (which we can fix by calling build_indexes after load, if we need to). I'd see it as a pre-1.0 opportunity to clean things up a bit.

What do you think?

@benjeffery
Copy link
Member

What do you think?

I know I originally suggested the flag, as a way to avoid any breakage, but now thinking about it I think it will be such a rare thing that it isn't worth the complexity.

@molpopgen
Copy link
Member Author

Sounds good. I'll undo the new flag, remove the old, etc..

Copy link
Member

@jeromekelleher jeromekelleher left a comment

Choose a reason for hiding this comment

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

Looks great, thanks @molpopgen. Some minor tweaks to the tests and we're good to merge.

We should also update the CHANGELOG, since this is an API and semantics breaking change.

unlink(_tmp_file_name);
errno = 0;

/* Trying to dump without first sorting fails */
Copy link
Member

Choose a reason for hiding this comment

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

We should be able to dump and load the unsorted tables without problems. Can just change the test to asserting ret is 0.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this is taken care of.

/* Trying to dump without first sorting fails */
ret = tsk_table_collection_dump(&t1, _tmp_file_name, 0);
CU_ASSERT_EQUAL_FATAL(ret, TSK_ERR_EDGES_NOT_SORTED_PARENT_TIME);
/* ret = tsk_table_collection_dump(&t1, _tmp_file_name, 0); */
Copy link
Member

Choose a reason for hiding this comment

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

stray comments here

@jeromekelleher
Copy link
Member

Looks great @molpopgen - just need to delete a few stray comments and squash

* API/behaviour change: remove TSK_NO_BUILD_INDEXES
@molpopgen
Copy link
Member Author

@jeromekelleher -- I think this is ready. Go ahead and merge!

@mergify mergify bot merged commit 495f8df into tskit-dev:main May 5, 2021
@benjeffery
Copy link
Member

Sorry, meant to check this over earlier, but LGTM too! Thanks @molpopgen

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.

Semantics for table/treeseq "dump" functions.

3 participants