-
Notifications
You must be signed in to change notification settings - Fork 1
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
PyOpenSci REVIEW - minor updates #43
Conversation
Codecov ReportBase: 84.58% // Head: 85.19% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #43 +/- ##
==========================================
+ Coverage 84.58% 85.19% +0.61%
==========================================
Files 11 11
Lines 837 831 -6
==========================================
Hits 708 708
+ Misses 129 123 -6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Wow, you have been busy! Just a quick note concerning itertuples:
Each row is a namedtuple, not a tuple. This means you can access the elements by their name, not just by their position. |
i = getattr(row, "Index") | ||
hmm_group = getattr(row, "hmm") |
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 can be changed to
row.Index
row.hmm
Not so ugly anymore, right? 😸
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 see! that pleases me greatly 😄 I really did not want to use getattr
.
Hi @Batalex , sorry, I got carried away with the merging yesterday. Actually, this is the first time I partake in a code review like this. What would you say is the best course of action to discuss the changes? i.e., add you as a collaborator and request Thanks again for all your suggestions. They have been very useful! |
This PR covers the following comments from reviewer (@Batalex) in PyOpenSci:
I agree, but, anyway I modified init to explicitly import all the classes, we don't want to be frowned upon.
Thanks, already taken care of. Now python >= 3.8.
Great, thanks for catching this!
Right! Modified.
:)
:)
Right, thanks for catching this.
Thanks. It's there so one can run "pynteny app --help" from the command line. I know this is not necessary. I left it there for consistency with the other subcommands. Perhaps in future versions "pyteny app" could have proper arguments, e.g. select port.
Thanks. I'm leaving it as it is for now but will consider this suggestion in future settings.
Right, removed, not sure why they were there in the first place.
Thank you!
Right, subcomand.download does not have
required
arguments. I removed it. As of the ìnstancepynteny
in cli.main, is there to avoid printing of the class descriptor to the command line.Ok
Right, removed.
While I appreciate the suggestion, I don't feel like it would improve the readability of the code in this case. With your suggestion, the reader would have to jump to the beginning of the file to understand that "-1" means "neg" and "1", "pos". I personally think that the lambda expression is closer to how one would describe the functionality in plain English.
Thanks for the suggestion. I have removed the equality to True as it is not necessary.
Alright, changed.
Thanks for the suggestion. I'll leave the filter for now. I feel it is somewhat more idiomatic.
Awesome! Will leave it as it is (lack of time) but will definitely consider it in future occurrences.
Haha did not know this method existed. Convenient. Thanks
Right, changed, thanks!
Thanks for the suggestion, but if I understand correctly, then the value of the attribute could be modified outside the method, and I want to prevent that. Since getter methods are not pythonic, I'll rename it "hits" and decorate it with @Property.
Thanks for the suggestion. Definitely will try it out. It's a pitty that the code gets uglier this way. Don't consider myself a python expert, but it seems to me that the python community is having some internal conflicts between efficiency and code readability (pythonicity).
Thanks, changed!
Makes sense, changed!
Thanks, changed.
Thanks, changed.
Alright. I removed try-except and added a logger.error to check label format.
I see. Thanks for catching this. I assumed that tuple styling would be similar to list. But I see now that's not the case. I'll change it to
tuple[str, ...]
since this appears to be the equivalent oflist[str]
.Created a property and removed
_input_file_str
, it's just fine to call.as_posix
when required. Thanks.I could make it a global constant. However, defining the constant at the beginning of the module implies that the reader would have to go up to see its value and then down again to the function. Since this constant is only used by one class method, I think that making it global is not necessary.
That was the original idea, but now Pynteny targets python >= 3.8. That's a pity because parenthesized context managers look cool.
That makes sense. I have converted this block of code into a function.