-
Notifications
You must be signed in to change notification settings - Fork 79
constify rest of public C API and tsk_tree_t types #940
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
Conversation
|
📖 Docs for this PR can be previewed here |
610f23b to
64a6525
Compare
Codecov Report
@@ Coverage Diff @@
## main #940 +/- ##
=======================================
Coverage 93.40% 93.40%
=======================================
Files 25 25
Lines 20357 20362 +5
Branches 825 825
=======================================
+ Hits 19014 19019 +5
Misses 1306 1306
Partials 37 37
Continue to review full report at Codecov.
|
93db149 to
d6e1f3a
Compare
|
Congrats on reaching the last of 4 commits to constify almost all of tskit! Here's some high level commentary. Firstly, I have not tried to const literally everything in tskit. As mentioned I've completely skipped haplotype_matching.h/c. Most everything in all the other files has been constified. Everything in the "tree API" is now const correct. But surely there are some other smaller stuctures and functions which I have skipped. I was mainly working towards full constification of the tree API and was opportunistic about other code if it looked relatively easy. So, more so than the other commits, this one touches more files even though it's less lines changed. Until now, everything I've changed I doubt actually changed what machine code is compiled in any non-trivial way. It's mostly all been 'compiler type sugar'. But in this commit there are two exceptions.
The old code has So I went with the solution of dropping the bool and have two separate pointers to a sample index map. One is a const pointer which always points to the sample index map to use and the other pointer is optional and is what needs to get freed if it is there. In the process of making this change, I went I ahead and split out some init logic into a separate function. |
jeromekelleher
left a comment
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.
Looks great, thanks again for all the hard work here @castedo. One minor comment above.
d6e1f3a to
c364619
Compare
|
All resolved. Good to merge. |
jeromekelleher
left a comment
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.
LGTM, thanks @castedo!
- stats.{h,c}
- newick tree converter
- tsk_vargen_t
- kc_distance and tsk_diff_iter
c364619 to
8aaf2b2
Compare
|
@jeromekelleher and @benjeffery, so now that this is finally all merged in. I'm curious what worked well or not so well as far as having lots of branches? Definitely one take away is to only have ONE branch marked as non-draft when there is a chain of dependent branches/PR. Did this feel like too many small merges? I was tilting towards lots of small PRs as an experiment. With a chain of changes like this, was it worth it to have the "future" branches available as GitHub PRs rather than just topic branchs that can mentioned and then "manually" diffed? One take way I'm thinking of following is that there is never more than one draft PR among the "future" branchs. So even though there might be a logical chain of 3+ branches, one is non-draft read-to-review, the next one is draft, and all further one exist as non-PR topic branches that are in-waiting and can be mentioned/linked to, but aren't yet github PRs. |
|
I think it worked better than having one huge PR. Was managing the branches annoying? Multiple open PRs isn't an issue as long as they are ready to discuss. |
|
From the maintainers perspective having a sequence of PRs is infinitely better than one giant one. I didn't really pay attention to how you were managing the sequencing @castedo, I just focused on the sequentially-ready ones. This worked well for me. |
I did not find managing multiple non-rebased "topic" branches annoying. However I did find attempting to have multiple rebased Another thing I discovered is that my So my take-away from this experiment is the following: Assuming one wants to preserve git history for a topic branch (it's easier to not), manage the topic branch with this life-cycle:
That last step 6) is needed so that all other topic branches depending on |
Builds on top of #939 and final PR for #844.
Consitfies more or less everything else except haplotype_matching.h. Wasn't clear whether that header is used enough to be worth constifying. I've barely read it.
This the final PR for where a few final touches in trees.h cause a bunch of changes across many files.