Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporarily expect failures for some grdcontour and grdview tests #503

Merged
merged 1 commit into from
Jul 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion pygmt/tests/test_grdcontour.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,27 @@
Test Figure.grdcontour
"""
import os
from packaging.version import Version

import numpy as np
import pytest

from .. import Figure
from .. import Figure, clib
from ..exceptions import GMTInvalidInput
from ..datasets import load_earth_relief


TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), "data")
TEST_CONTOUR_FILE = os.path.join(TEST_DATA_DIR, "contours.txt")

with clib.Session() as lib:
gmt_version = Version(lib.info["version"])


@pytest.mark.xfail(
condition=gmt_version < Version("6.1.0"),
reason="Baseline image not updated to use earth relief grid in GMT 6.1.0",
)
@pytest.mark.mpl_image_compare
def test_grdcontour():
"""Plot a contour image using an xarray grid
Expand All @@ -26,6 +34,10 @@ def test_grdcontour():
return fig


@pytest.mark.xfail(
condition=gmt_version < Version("6.1.0"),
reason="Baseline image not updated to use earth relief grid in GMT 6.1.0",
)
@pytest.mark.mpl_image_compare
def test_grdcontour_labels():
"""Plot a contour image using a xarray grid
Expand All @@ -44,6 +56,10 @@ def test_grdcontour_labels():
return fig


@pytest.mark.xfail(
condition=gmt_version < Version("6.1.0"),
reason="Baseline image not updated to use earth relief grid in GMT 6.1.0",
)
@pytest.mark.mpl_image_compare
def test_grdcontour_slice():
"Plot an contour image using an xarray grid that has been sliced"
Expand All @@ -68,6 +84,10 @@ def test_grdcontour_file():
return fig


@pytest.mark.xfail(
condition=gmt_version < Version("6.1.0"),
reason="Baseline image not updated to use earth relief grid in GMT 6.1.0",
)
@pytest.mark.mpl_image_compare
def test_grdcontour_interval_file_full_opts():
""" Plot based on external contour level file """
Expand Down
44 changes: 42 additions & 2 deletions pygmt/tests/test_grdview.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
Tests grdview
"""
import pytest
from packaging.version import Version

from .. import Figure, which
from .. import Figure, clib, which
from ..datasets import load_earth_relief
from ..exceptions import GMTInvalidInput
from ..helpers import data_kind

with clib.Session() as lib:
gmt_version = Version(lib.info["version"])


@pytest.fixture(scope="module")
def grid():
Expand Down Expand Up @@ -62,6 +66,10 @@ def test_grdview_with_perspective(grid):
return fig


@pytest.mark.xfail(
condition=gmt_version < Version("6.1.0"),
reason="Baseline image not updated to use earth relief grid in GMT 6.1.0",
)
@pytest.mark.mpl_image_compare
def test_grdview_with_perspective_and_zscale(grid):
"""
Expand All @@ -74,6 +82,10 @@ def test_grdview_with_perspective_and_zscale(grid):
return fig


@pytest.mark.xfail(
condition=gmt_version < Version("6.1.0"),
reason="Baseline image not updated to use earth relief grid in GMT 6.1.0",
)
@pytest.mark.mpl_image_compare
def test_grdview_with_perspective_and_zsize(grid):
"""
Expand All @@ -97,6 +109,10 @@ def test_grdview_with_cmap_for_image_plot(grid):
return fig


@pytest.mark.xfail(
condition=gmt_version < Version("6.1.0"),
reason="Baseline image not updated to use earth relief grid in GMT 6.1.0",
)
@pytest.mark.mpl_image_compare
def test_grdview_with_cmap_for_surface_monochrome_plot(grid):
"""
Expand All @@ -108,6 +124,10 @@ def test_grdview_with_cmap_for_surface_monochrome_plot(grid):
return fig


@pytest.mark.xfail(
condition=gmt_version < Version("6.1.0"),
reason="Baseline image not updated to use earth relief grid in GMT 6.1.0",
)
@pytest.mark.mpl_image_compare
def test_grdview_with_cmap_for_perspective_surface_plot(grid):
"""
Expand All @@ -116,11 +136,15 @@ def test_grdview_with_cmap_for_perspective_surface_plot(grid):
"""
fig = Figure()
fig.grdview(
grid=grid, cmap="oleron", surftype="s", perspective=[225, 30], zscale=0.005,
grid=grid, cmap="oleron", surftype="s", perspective=[225, 30], zscale=0.005
)
return fig


@pytest.mark.xfail(
condition=gmt_version < Version("6.1.0"),
reason="Baseline image not updated to use earth relief grid in GMT 6.1.0",
)
@pytest.mark.mpl_image_compare
def test_grdview_on_a_plane(grid):
"""
Expand All @@ -132,6 +156,10 @@ def test_grdview_on_a_plane(grid):
return fig


@pytest.mark.xfail(
condition=gmt_version < Version("6.1.0"),
reason="Baseline image not updated to use earth relief grid in GMT 6.1.0",
)
@pytest.mark.mpl_image_compare
def test_grdview_on_a_plane_with_colored_frontal_facade(grid):
"""
Expand All @@ -143,6 +171,10 @@ def test_grdview_on_a_plane_with_colored_frontal_facade(grid):
return fig


@pytest.mark.xfail(
condition=gmt_version < Version("6.1.0"),
reason="Baseline image not updated to use earth relief grid in GMT 6.1.0",
)
@pytest.mark.mpl_image_compare
def test_grdview_with_perspective_and_zaxis_frame(grid):
"""
Expand All @@ -154,6 +186,10 @@ def test_grdview_with_perspective_and_zaxis_frame(grid):
return fig


@pytest.mark.xfail(
condition=gmt_version < Version("6.1.0"),
reason="Baseline image not updated to use earth relief grid in GMT 6.1.0",
)
@pytest.mark.mpl_image_compare
def test_grdview_surface_plot_styled_with_contourpen(grid):
"""
Expand All @@ -176,6 +212,10 @@ def test_grdview_surface_mesh_plot_styled_with_meshpen(grid):
return fig


@pytest.mark.xfail(
condition=gmt_version < Version("6.1.0"),
reason="Baseline image not updated to use earth relief grid in GMT 6.1.0",
)
@pytest.mark.mpl_image_compare
def test_grdview_on_a_plane_styled_with_facadepen(grid):
"""
Expand Down