Skip to content

Commit 23d2284

Browse files
authored
Add a test for xarray grid shading (#581)
Add a test for xarray grid shading but mark it "xfail" due to upstream bug.
1 parent 6deb388 commit 23d2284

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

pygmt/tests/test_grdimage.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,27 @@ def test_grdimage_file():
6969
return fig
7070

7171

72+
@pytest.mark.xfail(reason="Upstream bug in GMT 6.1.1")
73+
@check_figures_equal()
74+
def test_grdimage_xarray_shading(grid, fig_ref, fig_test):
75+
"""
76+
Test that shading works well for xarray.
77+
See https://github.com/GenericMappingTools/pygmt/issues/364
78+
"""
79+
fig_ref, fig_test = Figure(), Figure()
80+
kwargs = dict(
81+
region=[-180, 180, -90, 90],
82+
frame=True,
83+
projection="Cyl_stere/6i",
84+
cmap="geo",
85+
shading=True,
86+
)
87+
88+
fig_ref.grdimage("@earth_relief_01d_g", **kwargs)
89+
fig_test.grdimage(grid, **kwargs)
90+
return fig_ref, fig_test
91+
92+
7293
def test_grdimage_fails():
7394
"Should fail for unrecognized input"
7495
fig = Figure()

0 commit comments

Comments
 (0)