Skip to content

Commit

Permalink
TST: Handle dtype nodata test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 committed Nov 1, 2024
1 parent 3ca29fb commit da65fc5
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions test/integration/test_integration_rioxarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from rioxarray.rioxarray import _generate_spatial_coords, _make_coords
from test.conftest import (
GDAL_GE_361,
RASTERIO_GE_14,
TEST_COMPARE_DATA_DIR,
TEST_INPUT_DATA_DIR,
_assert_xarrays_equal,
Expand Down Expand Up @@ -805,7 +806,7 @@ def test_reproject_match__non_geospatial(dummy_dataset_non_geospatial):
def test_reproject_match__geographic_dataset():
lat = [0.1, 0.15, 0.2]
lon = [0.1, 0.15, 0.2]
data = numpy.arange(1, 10).reshape(3, 3)
data = numpy.arange(1, 10, dtype=numpy.float32).reshape(3, 3)
ds = xarray.Dataset(
data_vars={
"foo": (["lat", "lon"], data),
Expand Down Expand Up @@ -2185,7 +2186,7 @@ def test_reproject_transform_missing_shape():
"dtype, expected_nodata",
[
(numpy.uint8, 255),
(numpy.int8, -128),
pytest.param(numpy.int8, -128, marks=pytest.mark.xfailif(not RASTERIO_GE_14)),
(numpy.uint16, 65535),
(numpy.int16, -32768),
(numpy.uint32, 4294967295),
Expand All @@ -2194,8 +2195,16 @@ def test_reproject_transform_missing_shape():
(numpy.float64, numpy.nan),
(numpy.complex64, numpy.nan),
(numpy.complex128, numpy.nan),
(numpy.uint64, 18446744073709551615),
(numpy.int64, -9223372036854775808),
pytest.param(
numpy.uint64,
18446744073709551615,
marks=pytest.mark.xfailif(not RASTERIO_GE_14),
),
pytest.param(
numpy.int64,
-9223372036854775808,
marks=pytest.mark.xfailif(not RASTERIO_GE_14),
),
],
)
def test_reproject_default_nodata(dtype, expected_nodata):
Expand Down

0 comments on commit da65fc5

Please sign in to comment.