Skip to content

Commit

Permalink
Merge pull request #78 from phobson/follow-linter
Browse files Browse the repository at this point in the history
take the linter's advice
  • Loading branch information
phobson authored Aug 23, 2020
2 parents 99f1b98 + a3134fc commit cb11c33
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 22 deletions.
8 changes: 1 addition & 7 deletions check_probscale.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import sys
import matplotlib

matplotlib.use("agg")

from matplotlib.pyplot import style

style.use("classic")

from probscale import tests


status = tests.test(*sys.argv[1:])
sys.exit(status)
2 changes: 1 addition & 1 deletion probscale/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
def test(*args):
try:
import pytest
except ImportError as e:
except ImportError:
raise ImportError("`pytest` is required to run the test suite")

options = [resource_filename("probscale", "tests")]
Expand Down
1 change: 0 additions & 1 deletion probscale/tests/test_formatters.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import numpy

import pytest
import numpy.testing as nptest

from probscale import formatters

Expand Down
5 changes: 2 additions & 3 deletions probscale/tests/test_probscale.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import os
import sys

import numpy
import matplotlib.pyplot as plt

try:
from scipy import stats
except: # pragma: no cover
except ImportError: # pragma: no cover
stats = None

import pytest
Expand Down Expand Up @@ -127,7 +126,7 @@ def test_sign_with_nan_no_warning(mn):
assert numpy.isnan(res)


def test_sign_with_nan_no_warning(mn):
def test_sign_with_nan_no_warning_inv(mn):
with pytest.warns(None) as record:
res = mn._approx_inv_erf(numpy.nan)
assert not record
Expand Down
2 changes: 1 addition & 1 deletion probscale/tests/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_fit_arguments_valid(which, kwarg):
assert result == which


@pytest.mark.parametrize(("kwarg",), [("fitprobs",), ("fitlogs",),])
@pytest.mark.parametrize("kwarg", ["fitprobs", "fitlogs"])
def test_fit_arguments_invalid(kwarg):
with pytest.raises(ValueError):
validate.fit_argument("junk", kwarg)
Expand Down
9 changes: 3 additions & 6 deletions probscale/tests/test_viz.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import sys
from functools import wraps

import numpy
import matplotlib.lines
import matplotlib.pyplot as plt

try:
from scipy import stats
except: # pragma: no cover
except ImportError: # pragma: no cover
stats = None

try:
import seaborn
except: # pragma: no cover
except ImportError: # pragma: no cover
seaborn = None

from probscale import viz
Expand Down Expand Up @@ -1075,6 +1072,6 @@ def test_probplot_with_FacetGrid_with_markers(usemarkers):
_lines = filter(
lambda x: isinstance(x, matplotlib.lines.Line2D), fg.ax.get_children()
)
result_markers = {l.get_label(): l.get_marker() for l in _lines}
result_markers = {line.get_label(): line.get_marker() for line in _lines}
expected_markers = dict(zip(species, markers))
assert expected_markers == result_markers
1 change: 0 additions & 1 deletion probscale/viz.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import copy

import numpy
from matplotlib import pyplot

from .probscale import _minimal_norm
from . import validate
Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#
# Usage: python setup.py install


import os
from setuptools import setup, find_packages


Expand Down

0 comments on commit cb11c33

Please sign in to comment.