From 960cd0e42607ce8b79490a0c7ae566f70894385f Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Sun, 6 Sep 2020 10:30:51 +1200 Subject: [PATCH] Revert plotting across dateline workarounds (#585) Remove workarounds added because plotting grids across the dateline would crash, not needed since bumping minimum required GMT version to 6.1.1. * Revert runfirst workaround for test_grdimage_over_dateline * Revert grdtrack example workaround in #531 crashing due to bad meridian * Remove unneeded pytest mpl_image_compare and runfirst markers --- Makefile | 6 +----- examples/gallery/grid/track_sampling.py | 2 +- pygmt/tests/test_grdimage.py | 4 ---- setup.cfg | 5 ----- 4 files changed, 2 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index cb27e1d9a3d..3f643a7d2ad 100644 --- a/Makefile +++ b/Makefile @@ -29,11 +29,7 @@ test: @echo "" @cd $(TESTDIR); python -c "import $(PROJECT); $(PROJECT).show_versions()" @echo "" - # There are two steps to the test here because `test_grdimage_over_dateline` - # passes only when it runs before the other tests. - # See also https://github.com/GenericMappingTools/pygmt/pull/476 - cd $(TESTDIR); pytest -m runfirst $(PYTEST_ARGS) $(PROJECT) - cd $(TESTDIR); pytest -m 'not runfirst' $(PYTEST_ARGS) $(PROJECT) + cd $(TESTDIR); pytest $(PYTEST_ARGS) $(PROJECT) cp $(TESTDIR)/coverage.xml . cp -r $(TESTDIR)/htmlcov . rm -r $(TESTDIR) diff --git a/examples/gallery/grid/track_sampling.py b/examples/gallery/grid/track_sampling.py index 0c01d099eab..66bd9cb2316 100644 --- a/examples/gallery/grid/track_sampling.py +++ b/examples/gallery/grid/track_sampling.py @@ -24,7 +24,7 @@ fig = pygmt.Figure() # Plot the earth relief grid on Cylindrical Stereographic projection, masking land areas -fig.basemap(region="d", frame=True, projection="Cyl_stere/8i") +fig.basemap(region="g", frame=True, projection="Cyl_stere/150/-20/8i") fig.grdimage(grid=grid, cmap="gray") fig.coast(land="#666666") # Plot using circles (c) of 0.15cm, the sampled bathymetry points diff --git a/pygmt/tests/test_grdimage.py b/pygmt/tests/test_grdimage.py index 37b5fca822a..8f4398ff8fd 100644 --- a/pygmt/tests/test_grdimage.py +++ b/pygmt/tests/test_grdimage.py @@ -76,10 +76,6 @@ def test_grdimage_fails(): fig.grdimage(np.arange(20).reshape((4, 5))) -# This test needs to run first before the other tests (on Linux at least) so -# that a black image isn't plotted due to an `inf` value when resampling. -# See also https://github.com/GenericMappingTools/pygmt/pull/476 -@pytest.mark.runfirst @pytest.mark.mpl_image_compare def test_grdimage_over_dateline(xrgrid): """ diff --git a/setup.cfg b/setup.cfg index 812f2e81962..deac1a59a36 100644 --- a/setup.cfg +++ b/setup.cfg @@ -12,8 +12,3 @@ max-line-length = 88 max-doc-length = 79 exclude = pygmt/_version.py - -[tool:pytest] -markers = - mpl_image_compare: compare generated plots with correct baseline version - runfirst: runs the test(s) first before the other ones