Skip to content

Commit

Permalink
TST:merge: Handle rasterio 1.4 merge test differences (#818)
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 authored Oct 31, 2024
1 parent f3ad955 commit 7f94df0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), "test_data")
TEST_INPUT_DATA_DIR = os.path.join(TEST_DATA_DIR, "input")
TEST_COMPARE_DATA_DIR = os.path.join(TEST_DATA_DIR, "compare")
RASTERIO_GE_14 = version.parse(rasterio.__version__) >= version.parse("1.4.0")
GDAL_GE_36 = version.parse(rasterio.__gdal_version__) >= version.parse("3.6.0")
GDAL_GE_361 = version.parse(rasterio.__gdal_version__) >= version.parse("3.6.1")
GDAL_GE_364 = version.parse(rasterio.__gdal_version__) >= version.parse("3.6.4")
Expand Down
7 changes: 5 additions & 2 deletions test/integration/test_integration_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from rioxarray import open_rasterio
from rioxarray.merge import merge_arrays, merge_datasets
from test.conftest import TEST_INPUT_DATA_DIR
from test.conftest import RASTERIO_GE_14, TEST_INPUT_DATA_DIR


@pytest.mark.parametrize("squeeze", [True, False])
Expand Down Expand Up @@ -82,7 +82,10 @@ def test_merge__different_crs(dataset):
(-7300984.0238134, 5003618.5908794, -7224054.1109682, 5050108.6101528),
)
assert merged.rio.shape == (84, 139)
assert_almost_equal(test_sum, -131734881)
if RASTERIO_GE_14:
assert_almost_equal(test_sum, -126821853)
else:
assert_almost_equal(test_sum, -131734881)

assert_almost_equal(
tuple(merged.rio.transform()),
Expand Down

0 comments on commit 7f94df0

Please sign in to comment.