Skip to content

Added docstrings D102 to public method on Bio.Wise - #2005

Merged
peterjc merged 2 commits into
biopython:masterfrom
svalqui:issue_1963_Bio_Wise
Apr 13, 2019
Merged

peterjc merged 2 commits into
biopython:masterfrom
svalqui:issue_1963_Bio_Wise

Conversation

@svalqui

@svalqui svalqui commented Apr 10, 2019

Copy link
Copy Markdown
Contributor

This pull request addresses issue #1963

  • I hereby agree to dual licence this and any previous contributions under both
    the Biopython License Agreement AND the BSD 3-Clause License.

  • I have read the CONTRIBUTING.rst file and understand that AppVeyor and
    TravisCI will be used to confirm the Biopython unit tests and flake8 style
    checks pass with these changes.

  • I have added my name to the alphabetical contributors listings in the files
    NEWS.rst and CONTRIB.rst as part of this pull request, am listed
    already, or do not wish to be listed. (This acknowledgement is optional.)

@codecov

codecov Bot commented Apr 10, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #2005 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2005      +/-   ##
==========================================
- Coverage   85.07%   85.07%   -0.01%     
==========================================
  Files         312      312              
  Lines       50161    50161              
==========================================
- Hits        42673    42672       -1     
- Misses       7488     7489       +1
Impacted Files Coverage Δ
Bio/Wise/dnal.py 34.66% <ø> (ø) ⬆️
Bio/Wise/__init__.py 80.35% <ø> (ø) ⬆️
Bio/Wise/psw.py 70.12% <ø> (ø) ⬆️
Bio/Graphics/BasicChromosome.py 93.71% <0%> (-0.32%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update efbb646...4095544. Read the comment docs.

Comment thread Bio/Wise/dnal.py
@@ -116,6 +117,7 @@ def __str__(self):


def align(pair, match=_SCORE_MATCH, mismatch=_SCORE_MISMATCH, gap=_SCORE_GAP_START, extension=_SCORE_GAP_EXTENSION, **keywds):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you break the line after extension=_SCORE_GAP_EXTENSION? (To make it <80 char; we do not enforce this yet)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be nice, but isn't essential for this pull request focused on the docstrings.

Comment thread Bio/Wise/psw.py
@@ -133,7 +143,7 @@ def align(pair,
gap_start=None,
gap_extension=None,
*args, **keywds):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be a matter of taste, but I would put all the arguments in one or two lines (not exceeding 79 characters).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Largely personal taste, and we have no compelling reason to change this as part of this pull request.

(Separately I am becoming a fan of the code formatting tool black which would decide this kind of thing automatically)

@peterjc

peterjc commented Apr 13, 2019

Copy link
Copy Markdown
Member

Looks good - Markus is right there are some unrelated style issues we could work on, but nothing which blocks merging your docstring work. Thank you!

@peterjc
peterjc merged commit 1f0d242 into biopython:master Apr 13, 2019
@MarkusPiotrowski

Copy link
Copy Markdown
Contributor

A different discussion and yes, offen a matter of personal taste, but I hate what black would do to with expressions in matching brackets, e.g.:

# in:

ImportantClass.important_method(exc, limit, lookup_lines, capture_locals, extra_argument)

# out:

ImportantClass.important_method(
    exc, limit, lookup_lines, capture_locals, extra_argument
)

And I find it even more terrible, what it would do to function arguments:

# out:

def very_important_function(
    template: str,
    *variables,
    file: os.PathLike,
    engine: str,
    header: bool = True,
    debug: bool = False,
):
    """Applies `variables` to the `template` and writes to `file`."""
    with open(file, "w") as f:
        ...

@peterjc

peterjc commented Apr 13, 2019

Copy link
Copy Markdown
Member

As you say a matter of taste - I had some niggles with black's style, I still don't agree with all the choices, but it has grown on me - and delegating this is liberating (both on solo projects, and likely more so on group projects). I've filed #2008 as a more visible place to have this discussion.

@svalqui

svalqui commented Apr 13, 2019

Copy link
Copy Markdown
Contributor Author

@MarkusPiotrowski , My apologies, I couldn't include your feedback on time I will consider for future PR.
This PR had take me more than expected as I had difficulties installing wise 2.4.1, to give me a better sense of what the module does, It has not work on Ubuntu 18.04; wise 2.4.1 seems stale, so I am not sure about the future of Bio.Wise.
Cheers,

@MarkusPiotrowski

Copy link
Copy Markdown
Contributor

@svalqui No problem, everything's fine! I know it's often hard to add meaninful docstrings, because you need to understand what the code is really doing. I also made this experience several times!

svalqui added a commit to svalqui/biopython that referenced this pull request May 14, 2019
@svalqui
svalqui deleted the issue_1963_Bio_Wise branch May 16, 2019 04:22
@peterjc peterjc mentioned this pull request Jan 8, 2020
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants