Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: Handle dtype nodata test failures #823

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Changes from all 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
27 changes: 23 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,13 @@ def test_reproject_transform_missing_shape():
"dtype, expected_nodata",
[
(numpy.uint8, 255),
(numpy.int8, -128),
pytest.param(
numpy.int8,
-128,
marks=pytest.mark.xfail(
not RASTERIO_GE_14, reason="Not worried about it if it works on latest."
),
),
(numpy.uint16, 65535),
(numpy.int16, -32768),
(numpy.uint32, 4294967295),
Expand All @@ -2194,8 +2201,20 @@ 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.xfail(
not RASTERIO_GE_14, reason="Not worried about it if it works on latest."
),
),
pytest.param(
numpy.int64,
-9223372036854775808,
marks=pytest.mark.xfail(
not RASTERIO_GE_14, reason="Not worried about it if it works on latest."
),
),
],
)
def test_reproject_default_nodata(dtype, expected_nodata):
Expand Down
Loading