Skip to content

flake8 D300 """triple double quotes""" in Tests - #2016

Merged
peterjc merged 4 commits into
biopython:masterfrom
peterjc:d300
Apr 19, 2019
Merged

peterjc merged 4 commits into
biopython:masterfrom
peterjc:d300

Conversation

@peterjc

@peterjc peterjc commented Apr 18, 2019

Copy link
Copy Markdown
Member

This pull request is somewhat related to issue #883 / #2014.

  • 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.)

@peterjc
peterjc requested a review from bow as a code owner April 18, 2019 15:13
@peterjc

peterjc commented Apr 18, 2019

Copy link
Copy Markdown
Member Author

Forgot to check in test_SearchIO_hmmer3_text.py, hang on...

@codecov

codecov Bot commented Apr 18, 2019 •

Copy link
Copy Markdown

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2016      +/-   ##
=========================================
+ Coverage    85.1%   85.1%   +<.01%     
=========================================
  Files         314     314              
  Lines       50302   50302              
=========================================
+ Hits        42809   42811       +2     
+ Misses       7493    7491       -2
Impacted Files Coverage Δ
Bio/Graphics/BasicChromosome.py 94.33% <0%> (+0.62%) ⬆️

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 4cf0c19...3509c5f. Read the comment docs.

@peterjc

peterjc commented Apr 18, 2019

Copy link
Copy Markdown
Member Author

Interesting, I broke test_31b1_hmmscan_001

Comment thread Tests/test_SearchIO_hmmer3_text.py Resolved
Comment thread Tests/test_NCBITextParser.py Resolved
Comment thread Tests/test_ProtParam.py Resolved
Comment thread Tests/test_ProtParam.py Outdated

def test_get_molecular_weight_identical(self):
"Test calculating the protein molecular weight agrees with calculation from Bio.SeqUtils"
"""Calculating the protein molecular weight agrees with calculation from Bio.SeqUtils."""

@MarkusPiotrowski MarkusPiotrowski Apr 18, 2019 •

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.

Not related to this PR, but I wonder if this and the following test make sense, since molecular_weight of ProtParam.ProteinAnalysis is just a call to the module's function:

 def molecular_weight(self):
    """Calculate MW from Protein sequence."""
    return molecular_weight(self.sequence, monoisotopic=self.monoisotopic)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not sure, haven't looked at that for a long time.

Comment thread Tests/test_phenotype.py
del numpy
except ImportError:
from Bio import MissingExternalDependencyError
raise MissingExternalDependencyError(

@MarkusPiotrowski MarkusPiotrowski Apr 18, 2019 •

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.

Again not direclty related to this PR, but I would sort and seperate the import stuff like this (PEP-8):

import json
import unittest
import warnings

try:
    import numpy
    del numpy
except ImportError:
    from Bio import MissingExternalDependencyError
    raise MissingExternalDependencyError(
        "Install NumPy if you want to use Bio.phenotype.")

from Bio._py3k import StringIO
from Bio import BiopythonExperimentalWarning

with warnings.catch_warnings():
    warnings.simplefilter('ignore', BiopythonExperimentalWarning)
    from Bio import phenotype

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

You mean first standard library imports, then own library imports (here Bio, BioSQL), finally any local imports (e.g. the BioSQL tests do that). I agree, we should work towards that.

@MarkusPiotrowski MarkusPiotrowski left a comment

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.

Wow, what an effort! I have two or three comments, would be nice to know your opinion about them.

@peterjc

peterjc commented Apr 19, 2019

Copy link
Copy Markdown
Member Author

@MarkusPiotrowski Lots of good questions, I have addressed the two specific issues in the changes on the pull request, and replied to the others. Thank you for looking at this so carefully!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants