Skip to content

Conversation

@benjeffery
Copy link
Member

Fixes #2207
Added an error for this case.

@codecov
Copy link

codecov bot commented May 3, 2022

Codecov Report

Merging #2233 (3f95078) into main (61a844a) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2233   +/-   ##
=======================================
  Coverage   93.30%   93.30%           
=======================================
  Files          27       27           
  Lines       26003    26009    +6     
  Branches     1165     1165           
=======================================
+ Hits        24262    24268    +6     
  Misses       1711     1711           
  Partials       30       30           
Flag Coverage Δ
c-tests 92.23% <100.00%> (+<0.01%) ⬆️
lwt-tests 89.05% <ø> (ø)
python-c-tests 72.06% <ø> (ø)
python-tests 98.87% <ø> (ø)

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

Impacted Files Coverage Δ
c/tskit/core.h 100.00% <ø> (ø)
c/tskit/core.c 97.89% <100.00%> (+0.01%) ⬆️
c/tskit/trees.c 95.00% <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 61a844a...3f95078. Read the comment docs.

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.

Good catch, but I think the implementation is uncovering another bug?

c/tskit/trees.c Outdated
tsk_memset(self, 0, sizeof(*self));
if (options & TSK_TAKE_OWNERSHIP) {
self->tables = tables;
if (tables->edges.options & TSK_NO_EDGE_METADATA) {
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't the flag be TSK_TABLE_NO_METADATA though? I thought that was the point of that flag - any table that has no metadata would use it. the TSK_TC_NO_EDGE_METADATA was a way to send that flag to edge_table_init.

Maybe we should wait until #2224 is in before tackling this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, they have the same value as I haven't rebased, so if I had rebased my mistake would have been revealed.

I've rebased and fixed this.

@benjeffery benjeffery force-pushed the test_take_no_edge_metadata branch from 20d3c63 to 3f95078 Compare May 3, 2022 15:22
@benjeffery
Copy link
Member Author

benjeffery commented May 4, 2022

@jeromekelleher I think this is ready to go now.

@mergify mergify bot merged commit 21e4785 into tskit-dev:main May 4, 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.

Check behaviour is tested for the combination of TSK_NO_EDGE_METADATA and TSK_TAKE_OWNERSHIP

2 participants