Skip to content

Use imperative mood for one-line docstring summaries #1473

Closed

Description

@peterjc

This a low priority issue for better following the wider Python community style for our docstring documentation. This is a spin out from issue #1170.

For background, read PEP257 first https://www.python.org/dev/peps/pep-0257/ (and note we use reStructuredText for the docstrings, not just plain text).

To test this locally, first install pydocstyle,

$ pip install pydocstyle

Then:

$ pydocstyle Bio/ --select D401 --count
Bio/_utils.py:38 in public function `read_forward`:
        D401: First line should be in imperative mood ('Read', not 'Reads')
...
Bio/Wise/__init__.py:26 in private function `_build_align_cmdline`:
        D401: First line should be in imperative mood; try rephrasing (found 'Helper')
416

If we do manage to make pydocstyle happy, then D401 can be enforced on TravisCI/Tox by updating file Bio/.flake8 which currently ignores it.

Given there are hundreds of docstrings to review, it makes sense to do this in batches, for example by top level folder. If you are going to work on this please comment here first to avoid overlap of effort (e.g. "I'm going to work on Bio/BLAST/ next).

Activity

  1. added
    good first issue
    on Dec 11, 2017
  2. MarkusPiotrowski commented on Dec 11, 2017

    @MarkusPiotrowski
    Contributor

    I'm going to work on Bio/SeqUtils

  3. MarkusPiotrowski commented on Dec 15, 2017

    @MarkusPiotrowski
    Contributor

    I go on with Alphabet, Compass and Data

  4. Gasta88 commented on Dec 18, 2017

    @Gasta88
    Contributor

    I'll take Bio/_utils.py, Bio/SeqRecord.py and Bio/phenotype.

  5. Gasta88 commented on Dec 19, 2017

    @Gasta88
    Contributor

    I'll start with Bio/Nexus, Bio/Wise and Bio/PopGene

  6. Gasta88 commented on Dec 27, 2017

    @Gasta88
    Contributor

    I'll work on Bio/Entrez, Bio/PDB, Bio/FSSP and Bio/Phylo.

  7. peterjc commented on Dec 27, 2017

    @peterjc
    MemberAuthor

    Wow - this is going quicker than I expected - thanks for all the work so far!

  8. Gasta88 commented on Jan 7, 2018

    @Gasta88
    Contributor

    Working on Bio/Uniprot, Bio/motifs, Bio/KEGG, Bio/NMR and Bio/SCOP.

  9. Gasta88 commented on Jan 8, 2018

    @Gasta88
    Contributor

    I'll take Bio/SeqIO, Bio/Crystal and Bio/SearchIO.

  10. peterjc commented on Jan 8, 2018

    @peterjc
    MemberAuthor

    I'll do Bio/Sequencing/*.py now...

    Update: And Bio/Data

    Correction: Markus is already doing Bio/Data

  11. Gasta88 commented on Jan 11, 2018

    @Gasta88
    Contributor

    I'll do Bio/Pathway, Bio/NeuralNetwork and Bio/Blast.

  12. peterjc commented on Jan 12, 2018

    @peterjc
    MemberAuthor

    Good work everyone. We're almost there - just three left:

    $ pydocstyle Bio/ --select D401 --count
    Bio/Data/CodonTable.py:71 in public method `__str__`:
            D401: First line should be in imperative mood ('Return', not 'Returns')
    Bio/Data/CodonTable.py:219 in public function `list_ambiguous_codons`:
            D401: First line should be in imperative mood ('Extend', not 'Extends')
    Bio/Data/CodonTable.py:396 in public function `register_ncbi_table`:
            D401: First line should be in imperative mood ('Turn', not 'Turns')
    3
    

    Markus' pull request #1501 will fix these (and adds the latest NCBI genetic codes to our codon tables).

    Once that's merged, we can start enforcing D401 in the Bio/.flake8 configuration.

  13. peterjc commented on Feb 23, 2018

    @peterjc
    MemberAuthor

    Closed by #1542, thank you for everyone else for all the docstring changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationStylegood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions