Skip to content

Commit a9e3881

Browse files
authored
Mark test_binstats_quantile as xfail in the GMT Legacy Tests workflow (#4087)
GMT 6.4 gives different results to GMT 6.5+ for binstats quantile statistic, xref GenericMappingTools/gmt#8243
1 parent 2b96907 commit a9e3881

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pygmt/tests/test_binstats.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
import numpy.testing as npt
88
import pytest
9+
from packaging.version import Version
910
from pygmt import binstats
11+
from pygmt.clib import __gmt_version__
1012
from pygmt.enums import GridRegistration, GridType
1113
from pygmt.helpers import GMTTempFile
1214

@@ -51,6 +53,11 @@ def test_binstats_no_outgrid():
5153
npt.assert_allclose(temp_grid.mean(), 4227489)
5254

5355

56+
# TODO(GMT>=6.5.0): Remove the xfail marker for the upstream bug fixed in GMT 6.5.0.
57+
@pytest.mark.xfail(
58+
condition=Version(__gmt_version__) < Version("6.5.0"),
59+
reason="Upstream bug fixed in https://github.com/GenericMappingTools/gmt/pull/8243",
60+
)
5461
def test_binstats_quantile():
5562
"""
5663
Test binstats quantile statistic functionality.
@@ -67,6 +74,7 @@ def test_binstats_quantile():
6774
assert temp_grid.dims == ("y", "x")
6875
assert temp_grid.gmt.gtype is GridType.CARTESIAN
6976
assert temp_grid.gmt.registration is GridRegistration.GRIDLINE
77+
assert temp_grid.dtype == "float32"
7078
npt.assert_allclose(temp_grid.max(), 15047685)
7179
npt.assert_allclose(temp_grid.min(), 53)
7280
npt.assert_allclose(temp_grid.median(), 543664.5)

0 commit comments

Comments
 (0)