docs: expand docstrings in amino_acid_distance, util, and anopheles#1135
docs: expand docstrings in amino_acid_distance, util, and anopheles#1135Komal2022 wants to merge 2 commits intomalariagen:masterfrom
Conversation
|
Hi @Komal2022, could you adjust your PR so that the docstrings follow the same format that is used everywhere else in the codebase? |
Hi @jonbrenas, thanks for the feedback! I want to make sure I get this right, looking at the codebase I can see different styles used (e.g. brief one-liners for some private functions, full numpydoc for others like _jackknife_ci). Could you point me to a specific function whose docstring format you'd like me to follow? I want to be consistent with your preference. |
|
Hi @Komal2022, my apologies, it was indeed not a very clear explanation of what I meant. Only public functions need to have a docstring and it should look like: There is more freedom for private functions (but the again, users should never see any of that) and comments in the code are at least as important as a description of the input and output. I think, the relationship between the input and output in some functions is self-evident for some of the functions (e.g., For |
|
@jonbrenas Done! I've reverted the private function docstrings and kept only the amino_acid_distance.py public function documentation. Thanks for the clear explanation, really helpful for understanding the codebase conventions. |
Summary
This PR expands and improves docstrings across three files to make the
codebase more accessible and easier to understand for new contributors
and users.
Changes
malariagen_data/amino_acid_distance.pygrantham_score()with Parameters and Returns sectionssneath_dist()with Parameters and Returns sectionsmalariagen_data/util.py_jitter()with Parameters and Returns sections_hash_params()with Parameters and Returns sections_haplotype_frequencies()with Parameters and Returns sectionsmalariagen_data/anopheles.py_block_jackknife_cohort_diversity_stats()describing its parameters, and return value
Motivation
Several internal functions lacked sufficient documentation, making it
harder for new contributors to understand the codebase. These changes
follow the existing numpydoc style used throughout the project.