Repository navigation
constify C Table API - #919
Conversation
|
📖 Docs for this PR can be previewed here |
|
There are a few more functions in the Table API that I am still investigating. Specifically the |
|
Thanks for picking this up @castedo! To avoid large conflicts we can merge as you have chunks ready. |
Codecov Report
@@ Coverage Diff @@
## main #919 +/- ##
=======================================
Coverage 93.43% 93.43%
=======================================
Files 25 25
Lines 20065 20083 +18
Branches 808 808
=======================================
+ Hits 18747 18765 +18
Misses 1281 1281
Partials 37 37
Continue to review full report at Codecov.
|
|
Ready for review now. There is a type change which I'd like to bring to attention. The type change is part of making a number of other functions const-correct, namely the The high-level semantic clarficiation I've coded is the following: that the eight In the current This is consistent with the |
|
FYI, the unsuccessful check is due to |
This is a flakey test introduced by #909. I'll re-run circle CI. |
4619308 to
2060d1b
Compare
benjeffery
left a comment
There was a problem hiding this comment.
Yikes, thanks for this @castedo - looks like a lot of work.
All these changes make sense to me.
I'll ping @molpopgen for a quick look - ignore if you're too busy with teaching.
It's so much easier to suggest an API should use Originally I thought this work would be tweaking a few function declarations. But I ended up deciding I should actually confirm that const parameters really don't get changed. And in confirming that, I basically was figuring out what parameters should be const for all the functions that get called. It was kind of fun figuring out what the code does! I keep hoping I'm going to spot an interesting bug. |
jeromekelleher
left a comment
There was a problem hiding this comment.
I think this a big improvement and a significant boost for library correctness and documentation - thanks very much for taking this on @castedo! I have a few questions and I think there's a some minor inconsistencies in places, but I think we should do this.
I was worried about const poisoning, but it doesn't seem to have affected our test code at all, and we have compiler flags on very high paranoia settings so that seems fine.
Keep looking, I'm sure there's some there! 😉 |
2060d1b to
c238d57
Compare
|
I've resolved remaining comments. This should be ready to merge. Looks like the build fail is another timeout and not real fail. However, related to the comments is two parts of the header file I have not "constified". One is this section of "Undocumented methods": Line 2787 in c238d57 which looks like there could be some clarification on what params are or are not left unmodified. However, when reading the implementation code, it wasn't quickly clear to me. And then there is the "experimental IBD API" section: Line 2876 in c238d57 which I haven't bothered to read at all really. I'm inclined to skip them, but mainly because I don't totally understand the implementation code. |
I've saved that fun for last 😄, specificly the last of three PRs. I've staged the most straight forward const-ifications in the two current open PRs. The third stage I have not PR'd yet but have most of it stached away locally in git. It changes way more files. We can see how scary it looks in a third draft PR. |
jeromekelleher
left a comment
There was a problem hiding this comment.
LGTM, thanks @castedo! Looking forward to the next installation¬!
c238d57 to
e1dac15
Compare
As a first stage for #844 I am focusing on the Table API which does not depend on other parts of the C API.
I will probably have this "constification" of the Table API ready today.
I'm not sure how long it will take the do the rest of the C API yet. But this topic branch focused on only the Table API could be merged before the rest of the C API is constified.