From dfc7d76545eea063dae9609e059f1e1e55a6b59a Mon Sep 17 00:00:00 2001 From: Illviljan <14371165+Illviljan@users.noreply.github.com> Date: Wed, 16 Mar 2022 19:49:15 +0100 Subject: [PATCH 1/3] Remove test_rasterio_vrt_network --- xarray/tests/test_backends.py | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py index e0bc0b10437..4696c41552f 100644 --- a/xarray/tests/test_backends.py +++ b/xarray/tests/test_backends.py @@ -4775,32 +4775,6 @@ def test_rasterio_vrt_with_src_crs(self): with pytest.warns(DeprecationWarning), xr.open_rasterio(vrt) as da: assert da.crs == src_crs - @network - def test_rasterio_vrt_network(self): - # Make sure loading w/ rasterio give same results as xarray - import rasterio - - # use same url that rasterio package uses in tests - prefix = "https://landsat-pds.s3.amazonaws.com/L8/139/045/" - image = "LC81390452014295LGN00/LC81390452014295LGN00_B1.TIF" - httpstif = prefix + image - with rasterio.Env(aws_unsigned=True): - with rasterio.open(httpstif) as src: - with rasterio.vrt.WarpedVRT(src, crs="epsg:4326") as vrt: - expected_shape = vrt.width, vrt.height - expected_res = vrt.res - # Value of single pixel in center of image - lon, lat = vrt.xy(vrt.width // 2, vrt.height // 2) - expected_val = next(vrt.sample([(lon, lat)])) - with pytest.warns(DeprecationWarning), xr.open_rasterio(vrt) as da: - actual_shape = da.sizes["x"], da.sizes["y"] - actual_res = da.res - actual_val = da.sel(dict(x=lon, y=lat), method="nearest").data - - assert actual_shape == expected_shape - assert actual_res == expected_res - assert expected_val == actual_val - class TestEncodingInvalid: def test_extract_nc4_variable_encoding(self): From 29119cc53949a09f64ed0a41a444587f74e31dd5 Mon Sep 17 00:00:00 2001 From: Illviljan <14371165+Illviljan@users.noreply.github.com> Date: Wed, 16 Mar 2022 19:53:02 +0100 Subject: [PATCH 2/3] Update test_backends.py --- xarray/tests/test_backends.py | 1 + 1 file changed, 1 insertion(+) diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py index 4696c41552f..615fedd3234 100644 --- a/xarray/tests/test_backends.py +++ b/xarray/tests/test_backends.py @@ -4776,6 +4776,7 @@ def test_rasterio_vrt_with_src_crs(self): assert da.crs == src_crs + class TestEncodingInvalid: def test_extract_nc4_variable_encoding(self): var = xr.Variable(("x",), [1, 2, 3], {}, {"foo": "bar"}) From ae116a6100631a126a08e2865cfc400d77cde78d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 16 Mar 2022 18:54:59 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- xarray/tests/test_backends.py | 1 - 1 file changed, 1 deletion(-) diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py index 615fedd3234..4696c41552f 100644 --- a/xarray/tests/test_backends.py +++ b/xarray/tests/test_backends.py @@ -4776,7 +4776,6 @@ def test_rasterio_vrt_with_src_crs(self): assert da.crs == src_crs - class TestEncodingInvalid: def test_extract_nc4_variable_encoding(self): var = xr.Variable(("x",), [1, 2, 3], {}, {"foo": "bar"})