Skip to content

Commit 2a6136e

Browse files
authored
Fix the sphinterpolate failing test in the GMT Dev Tests (#3894)
1 parent 4af6d20 commit 2a6136e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pygmt/tests/test_sphinterpolate.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44

55
from pathlib import Path
66

7+
import numpy as np
78
import numpy.testing as npt
89
import pytest
10+
from packaging.version import Version
911
from pygmt import sphinterpolate
1012
from pygmt.datasets import load_sample_data
1113
from pygmt.enums import GridRegistration, GridType
@@ -42,4 +44,6 @@ def test_sphinterpolate_no_outgrid(mars):
4244
npt.assert_allclose(temp_grid.max(), 14628.144)
4345
npt.assert_allclose(temp_grid.min(), -6908.1987)
4446
npt.assert_allclose(temp_grid.median(), 118.96849)
45-
npt.assert_allclose(temp_grid.mean(), 272.60593)
47+
# TODO(NumPy>=2.3.0): Remove the numpy version check.
48+
mean = 272.60568 if Version(np.__version__) >= Version("2.3.0dev") else 272.60593
49+
npt.assert_allclose(temp_grid.mean(), mean)

0 commit comments

Comments
 (0)