Skip to content

Commit

Permalink
Black lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
weiji14 committed Sep 3, 2020
1 parent 847814b commit 8286d7e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions pygmt/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class GMTVersionError(GMTError):
Raised when an incompatible version of GMT is being used.
"""


class GMTImageComparisonFailure(AssertionError):
"""
Raised when a comparison between two images fails.
Expand Down
8 changes: 4 additions & 4 deletions pygmt/helpers/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def check_figures_equal(fig_ref, fig_test, fig_prefix=None, tol=0.0):

os.makedirs(result_dir, exist_ok=True)

ref_image_path = os.path.join(result_dir, fig_prefix + '-expected.png')
test_image_path = os.path.join(result_dir, fig_prefix + '.png')
ref_image_path = os.path.join(result_dir, fig_prefix + "-expected.png")
test_image_path = os.path.join(result_dir, fig_prefix + ".png")

fig_ref.savefig(ref_image_path)
fig_test.savefig(test_image_path)
Expand All @@ -31,5 +31,5 @@ def check_figures_equal(fig_ref, fig_test, fig_prefix=None, tol=0.0):
for key in ["actual", "expected"]:
err[key] = os.path.relpath(err[key])
raise GMTImageComparisonFailure(
'images not close (RMS %(rms).3f):\n\t%(actual)s\n\t%(expected)s '
% err)
"images not close (RMS %(rms).3f):\n\t%(actual)s\n\t%(expected)s " % err
)
3 changes: 2 additions & 1 deletion pygmt/tests/test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import pygmt
from matplotlib.testing.decorators import check_figures_equal

@check_figures_equal(extensions=['png'])

@check_figures_equal(extensions=["png"])
def test_plot(fig_test, fig_ref):
fig_test.subplots().plot([1, 3, 5])
fig_ref.subplots().plot([0, 1, 2], [1, 3, 5])
4 changes: 2 additions & 2 deletions pygmt/tests/test_grdimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ def test_grdimage_over_dateline(xrgrid):

def test_grdimage_central_longitude(grid):
fig1 = Figure()
fig1.grdimage("@earth_relief_01d_g", projection="W120/15c", cmap='geo')
fig1.grdimage("@earth_relief_01d_g", projection="W120/15c", cmap="geo")

fig2 = Figure()
fig2.grdimage(grid, projection="W120/15c", cmap='geo')
fig2.grdimage(grid, projection="W120/15c", cmap="geo")

check_figures_equal(fig1, fig2)

0 comments on commit 8286d7e

Please sign in to comment.