Skip to content

Conversation

ivan-krukov
Copy link
Member

Implement a ragged parent column, as per #852

@ivan-krukov
Copy link
Member Author

This is not looking good. Pulled from main and trying again

@jeromekelleher
Copy link
Member

Yes, looks like it needs a rebase. This guide might help, if you're not familiar with rebasing.

@jeromekelleher
Copy link
Member

Probably got hit by #862, which made a big change to the low-level module. I can jump in and bring things up to date if you're getting stuck.

@ivan-krukov
Copy link
Member Author

Looks like I was able to resolve the merge conflict. The failing tests are checking the output file formats. Should be relatively easy to adjust that

@codecov
Copy link

codecov bot commented Sep 28, 2020

Codecov Report

Merging #866 (d6efcb1) into main (e1eef38) will decrease coverage by 0.06%.
The diff coverage is 86.39%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #866      +/-   ##
==========================================
- Coverage   93.70%   93.63%   -0.07%     
==========================================
  Files          26       26              
  Lines       21050    21204     +154     
  Branches      894      894              
==========================================
+ Hits        19724    19855     +131     
- Misses       1289     1312      +23     
  Partials       37       37              
Flag Coverage Δ
c-tests 92.33% <75.26%> (-0.16%) ⬇️
lwt-tests 92.78% <92.00%> (-0.03%) ⬇️
python-c-tests 94.88% <100.00%> (+0.03%) ⬆️
python-tests 98.64% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
c/tskit/tables.c 90.48% <75.26%> (-0.27%) ⬇️
python/_tskitmodule.c 91.37% <100.00%> (+0.06%) ⬆️
python/lwt_interface/tskit_lwt_interface.h 95.04% <100.00%> (+0.12%) ⬆️
python/tskit/tables.py 99.60% <100.00%> (+<0.01%) ⬆️
python/tskit/trees.py 97.47% <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 e1eef38...d6efcb1. Read the comment docs.

@benjeffery
Copy link
Member

@ivan-krukov Just checking in as this PR has been inactive for a couple of months - are you planning to pick this up? Looks like it is close to done, I can finish it off if you're busy with other things?

@ivan-krukov
Copy link
Member Author

@benjeffery Sorry, I was really MIA on this lately.
I am now looking into merging this again. Looks like there are a few conflicts, but they are minor.
Would you mind giving this a review when it is ready?

Thank you

@jeromekelleher
Copy link
Member

Great, thanks @ivan-krukov! Would you mind bringing this up to date by rebasing please? If you get bogged down in git stuff Ben or I can help out.

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.

This looks great @ivan-krukov! I've had a medium scan of the changes, and I think you've basically covered everything. The rest is going to be tricky compatibility stuff that it's probably best if @benjeffery and I do.

So, how about we take this PR from here? If you could rebase and squash the commits please I think we can finish this up pretty quickly then.

class IndividualTableRow:
flags: int
location: np.ndarray
parents: np.array
Copy link
Member

Choose a reason for hiding this comment

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

np.ndarray

return headers, rows

def add_row(self, flags=0, location=None, metadata=None):
def add_row(self, flags=0, location=None, parents=None, metadata=None):
Copy link
Member

Choose a reason for hiding this comment

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

For strict compatibility we should put the parents at the of the args list. I'm tempted to make everything after flags a keyword-only argument though. @benjeffery, any thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

Same point applies in a few other places where we're updating the public API.

Copy link
Member

Choose a reason for hiding this comment

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

A few months back we considered reviewing the API to make more args keyword-only. I think it's a good idea.

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 also think this is a good idea. Much of this commit is just duplicating the location table code. I feel like a lot of this can be streamlined.

goto out;
}
if (parents_offset[num_rows] != parents_length) {
ret = TSK_ERR_BAD_OFFSET;
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 try to cover this line. @benjeffery, where do we catch this sort of stuff again?

Copy link
Member

Choose a reason for hiding this comment

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

This sort of thing should be hit by adding the column to the list of ragged columns in test_tables.py:845. I'm not sure why it isn't, but could look into it.

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've added that at test_tables.py:847, in addition to some basic tests below. I was also confused why the codecov/patch did not pass.

@ivan-krukov
Copy link
Member Author

@jeromekelleher , @benjeffery Please ignore the last two commits then. I will make the corrections above and squash.

@ivan-krukov
Copy link
Member Author

@benjeffery @jeromekelleher I am embarrassed to admit that I am having trouble with squashing the commits. It seems that since it has diverged so long ago, I am getting more merge conflicts.

Could you please merge this for me? The #individual_parents_squash_me is up-to-date with the changes

https://github.com/ivan-krukov/tskit/tree/individual_parent_squash_me

Thank you

@jeromekelleher
Copy link
Member

I had a go at rebasing this @ivan-krukov, but it's a bit of a mess unfortunately because it cuts across some large code changes that happened since (mainly, the "constification" of the C API and also pulling out the dict interface in the Python C layer into the "lwt" file). I think it's best to go down the when rebasing goes wrong path.

I'd suggest doing the following:

  1. Apply your diff to a clean branch. Focus on the C library first - get that cleaned up, compiling and passing tests. Add just those changes in one commit.
  2. Next look at the _msprimemodule.c and lwt_interface.c. The diff will be messy here, but it should be possible to identify your bits that should go in either file. Get those compiling and passing the test_lowlevel.py tests. Commit those changes.
  3. Finally bring the Python code up to date, and commit.

Once that's done, open a new PR, which we (the maintainers) can then pick up and complete.

How does that sound?

@ivan-krukov ivan-krukov mentioned this pull request Jan 22, 2021
3 tasks
@ivan-krukov
Copy link
Member Author

Closing this in favour of #1125

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