-
Notifications
You must be signed in to change notification settings - Fork 79
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
GenotypeAllele encoding and documentation for pushing to Record #285
Conversation
Pull Request Test Coverage Report for Build 415805844
💛 - Coveralls |
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 good overall, thanks! As a first quick pass, I'd fix the clippy variable does not need to be mutable
warnings, there are several that seem easy to fix?
I saw those, but they were from before this pull request, so I figured maybe they served some point and left them. Anyway, that should be fixed now. There's still a couple of clippy warnings relating to code I'm not familiar with, though. |
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.
Thanks @malthesr, I didn't realize the clippy warnings were there before, thanks for fixing!
I don't have strong opinions about your choices on the docs side of things, I reckon I'll defer the verdict to the other two reviewers @tedil and @dlaehnemann ;)
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'll just add my two cents regarding the doctests: I really like this split of hiding complexity that is not relevant to the functionality that the doctest is actually testing and showing, but pointing to the module docs for the necessary setup. This sounds like the solution we've been looking for all along! :D
One tiny thing: You included some relative links within the docs. Is there a way to link to the doctest in the module docs, directly. That way, the hidden complexity would simply be one click away. But never mind if this is not quickly done.
Good idea, @dlaehnemann, and thank you for the reviews from all three of you. I've added direct links from the three doc tests that mention the module level docs. (I also fixed the monospace font on two other links I'd missed last time). |
Addresses the remaining points in #224:
From<i32> for GenotypeAllele
, copying the code from the oldfrom_encoded
method. Also included a bit of testing for this in the tests for the previousFrom<GenotypeAllele> for i32
, ensuring that converting back and forth does nothing.from_encoded
, deprecating the method from0.36.0
onwards.Record
:set_rid
,push_genotypes
, andpush_format_float
.The doc tests all require quite a bit of setup to compile. I've hidden this from the doc, with a note about the presuppositions and a reference to the module level docs, which gives a full example. I'm not sure this is the best way to do it, but including all the setup code seems to me to divert attention from the main point.
Moreover, the setup requires a lot of code duplication, which is not nice, but I couldn't find a way to centralise the setup so long as
#[cfg(doctest)]
doesn't work for this case (see Rust issue #67295).Very happy to hear any other takes on how to organise this.