6
6
7
7
import numpy .testing as npt
8
8
import pytest
9
+ from packaging .version import Version
9
10
from pygmt import binstats
11
+ from pygmt .clib import __gmt_version__
10
12
from pygmt .enums import GridRegistration , GridType
11
13
from pygmt .helpers import GMTTempFile
12
14
@@ -51,6 +53,11 @@ def test_binstats_no_outgrid():
51
53
npt .assert_allclose (temp_grid .mean (), 4227489 )
52
54
53
55
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
+ )
54
61
def test_binstats_quantile ():
55
62
"""
56
63
Test binstats quantile statistic functionality.
@@ -67,6 +74,7 @@ def test_binstats_quantile():
67
74
assert temp_grid .dims == ("y" , "x" )
68
75
assert temp_grid .gmt .gtype is GridType .CARTESIAN
69
76
assert temp_grid .gmt .registration is GridRegistration .GRIDLINE
77
+ assert temp_grid .dtype == "float32"
70
78
npt .assert_allclose (temp_grid .max (), 15047685 )
71
79
npt .assert_allclose (temp_grid .min (), 53 )
72
80
npt .assert_allclose (temp_grid .median (), 543664.5 )
0 commit comments