Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion .github/workflows/ci_tests_legacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
# push:
# branches: [ main ]
# Uncomment the 'pull_request' line below to trigger the workflow in PR
# pull_request:
pull_request:
# types: [ready_for_review]
# paths:
# - 'pygmt/**'
Expand Down
14 changes: 11 additions & 3 deletions pygmt/tests/test_binstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

import numpy.testing as npt
import pytest
from packaging.version import Version
from pygmt import binstats
from pygmt.clib import __gmt_version__
from pygmt.enums import GridRegistration, GridType
from pygmt.helpers import GMTTempFile

Expand Down Expand Up @@ -67,7 +69,13 @@ def test_binstats_quantile():
assert temp_grid.dims == ("y", "x")
assert temp_grid.gmt.gtype is GridType.CARTESIAN
assert temp_grid.gmt.registration is GridRegistration.GRIDLINE
assert temp_grid.dtype == "float32"
npt.assert_allclose(temp_grid.max(), 15047685)
npt.assert_allclose(temp_grid.min(), 53)
npt.assert_allclose(temp_grid.median(), 543664.5)
npt.assert_allclose(temp_grid.mean(), 1661363.6)
if Version(__gmt_version__) > Version("6.4.0"):
npt.assert_allclose(temp_grid.min(), 53)
npt.assert_allclose(temp_grid.median(), 543664.5)
npt.assert_allclose(temp_grid.mean(), 1661363.6)
else: # TODO(GMT>=6.5.0): Remove if-condition with different min/median/mean values
npt.assert_allclose(temp_grid.min(), 0)
npt.assert_allclose(temp_grid.median(), 330700.0)
npt.assert_allclose(temp_grid.mean(), 1459889.1)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure which values are the correct ones. Do we want to check in upstream GMT on what might have changed binstat from GMT 6.4 to 6.5?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely related to GenericMappingTools/gmt#8243.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the reminder, forgot about that thread! Have changed to an xfail in commit 1dc2e42