-
Notifications
You must be signed in to change notification settings - Fork 77
Individual parents #866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Individual parents #866
Conversation
This is not looking good. Pulled from main and trying again |
Yes, looks like it needs a rebase. This guide might help, if you're not familiar with rebasing. |
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. |
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 Report
@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@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? |
@benjeffery Sorry, I was really MIA on this lately. Thank you |
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. |
There was a problem hiding this 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.
python/tskit/tables.py
Outdated
class IndividualTableRow: | ||
flags: int | ||
location: np.ndarray | ||
parents: np.array |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@jeromekelleher , @benjeffery Please ignore the last two commits then. I will make the corrections above and squash. |
@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 |
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:
Once that's done, open a new PR, which we (the maintainers) can then pick up and complete. How does that sound? |
Closing this in favour of #1125 |
Implement a ragged parent column, as per #852