Repository navigation
docstring D205, D400 (one line summary) & D301 (slashes) - #1462
Conversation
Includes some misc docstring cleanup in the files updated.
0163f1d to
1f5b6ac
Compare
Codecov Report
@@ Coverage Diff @@
## master #1462 +/- ##
======================================
Coverage 84.8% 84.8%
======================================
Files 321 321
Lines 49312 49312
======================================
Hits 41817 41817
Misses 7495 7495
Continue to review full report at Codecov.
|
|
@bow Are the @etal, @brandoninvergo @lijax are the Comment welcomed on the other modules docstrings changed too, thanks! |
Also now enforces this via TravisCI/Tox style checks.
This also adds a doctest to the module clarifying the text.
As far as I can tell, these backslashes are all used literally in the docstrings, and thus the docstrings should be in raw mode (fixes pydocstyle D301).
Passing a literal tab character in a command line string is problematic (and would require quoting which our wrapper does not attempt to do). Instead, BWA itself understands the backslash-t notation to insert a tab in the read group string. This means when constructing the argument in Python, we need to escape the backslash - or use a raw string. This also fixes the doctest output which was showing white space in the expected output of the command line as a string. Bonus: This is the last D301 issue from pydocstyle/flake8
Cross reference issue 1170.
|
@saketkc could you check the changes to the |
| input_bam=in_bam) | ||
| >>> print(samtools_merge_cmd) | ||
| >>> merge_cmd = SamtoolsMergeCommandline(out_bam=out_bam, | ||
| ... input_bam=in_bam) |
There was a problem hiding this comment.
It does look wrong on GitHub, I agree. Maybe emacs stuck a tab in there? I must check that...
| @staticmethod | ||
| def _print_default_format_warning(file_format): | ||
| """Temporary warning (similar to a deprecation warning) that files are being downloaded in mmCIF""" | ||
| """Print a warning to stdout. |
There was a problem hiding this comment.
Should this end with '(PRIVATE)' like in Bio/Nexus/Nexus.py so as to keep this consistent?
There was a problem hiding this comment.
Yes, especially since it is so short. Good spot.
|
|
||
| def _part(clades): | ||
| """Recursive function of adam consensus algorithm""" | ||
| """Recursive function of Adam Consensus algorithm.""" |
|
|
||
| def _sub_clade(clade, term_names): | ||
| """Extract a compatible subclade that only contains the given terminal names""" | ||
| """Extract a compatible subclade that only contains the given terminal names.""" |
There was a problem hiding this comment.
Ideally, but it is already a very long line.
| """Returns a list of column short names from the 'Fields' | ||
| comment line. | ||
| """ | ||
| """Return column short names line from 'Fields' comment line.""" |
| # sequence properties # | ||
| def _set_seq(self, seq, seq_type): | ||
| """Checks the given sequence for attribute setting | ||
| """Checks the given sequence for attribute setting. |
|
|
||
| def _fetch_counts_matrix(self, int_id): | ||
| """Fetch the counts matrix from the JASPAR DB by the internal ID | ||
| """Fetch the counts matrix from the JASPAR DB by the internal ID. |
| def _adjust_aa_seq(fraglist): | ||
| """Transforms three-letter amino acid codes into one-letters in the | ||
| given HSPFragments. | ||
| """Transform fragment's 3-letter amino acid codes to one-letter (PRIVATE). |
There was a problem hiding this comment.
Probably 'Transform 3-letter AA codes of input fragments to one-letter codes (PRIVATE).' is a better description.
| """Final processing of a parsed clade. Removes the node's parent and | ||
| returns it. | ||
| """ | ||
| """Final processing of parsed clade. Removes node's parent and return it.""" |
|
The Phylo and PDB changes look fine to me. |
Saket Choudhary noted many of the docstrings for private methods and functions lacked our convention of (PRIVATE) at the end of the one line summary. TODO: Review the full code base for this. I also made many of these docstrings use imperative mood (pydocstyle D401 style check).
There are hundreds more, this grep command will find all those after a single line def statement: grep --include '*.py' -rn -A 1 "def _[a-z]" Bio BioSQL | grep '"""' | grep -v "(PRIVATE)"
|
I've logged #1466 for missing |
|
Thank you all - those extra eyes caught a few things I'd missed. |
This pull request addresses issue #1170
@etal @JoaoRodrigues do the PDB changes make sense?
(Further commits to follow for remaining cases in
Bio.PhyloandBio.SearchIO)Update: Expanded from D205 to also cover D400 and D301 as well.