Skip to content

Commit c4677ce

Browse files
authored
Remove rasterio tutorial test (#7196)
* Remove rasterio tutorial test * Update tutorial.py
1 parent 6cb97f6 commit c4677ce

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

xarray/tests/test_tutorial.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,3 @@ def test_download_from_github_load_without_cache(
2929
).load()
3030
ds_cache = tutorial.open_dataset(self.testfile, cache_dir=cache_dir).load()
3131
assert_identical(ds_cache, ds_nocache)
32-
33-
def test_download_rasterio_from_github_load_without_cache(
34-
self, tmp_path, monkeypatch
35-
):
36-
cache_dir = tmp_path / tutorial._default_cache_dir_name
37-
with pytest.warns(DeprecationWarning):
38-
arr_nocache = tutorial.open_rasterio(
39-
"RGB.byte", cache=False, cache_dir=cache_dir
40-
).load()
41-
arr_cache = tutorial.open_rasterio(
42-
"RGB.byte", cache=True, cache_dir=cache_dir
43-
).load()
44-
assert_identical(arr_cache, arr_nocache)

xarray/tutorial.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import os
1111
import pathlib
12+
import warnings
1213
from typing import TYPE_CHECKING
1314

1415
import numpy as np
@@ -175,6 +176,12 @@ def open_rasterio(
175176
"""
176177
Open a rasterio dataset from the online repository (requires internet).
177178
179+
.. deprecated:: 0.20.0
180+
181+
Deprecated in favor of rioxarray.
182+
For information about transitioning, see:
183+
https://corteva.github.io/rioxarray/stable/getting_started/getting_started.html
184+
178185
If a local copy is found then always use that to avoid network traffic.
179186
180187
Available datasets:
@@ -204,6 +211,13 @@ def open_rasterio(
204211
----------
205212
.. [1] https://github.com/rasterio/rasterio
206213
"""
214+
warnings.warn(
215+
"open_rasterio is Deprecated in favor of rioxarray. "
216+
"For information about transitioning, see: "
217+
"https://corteva.github.io/rioxarray/stable/getting_started/getting_started.html",
218+
DeprecationWarning,
219+
stacklevel=2,
220+
)
207221
try:
208222
import pooch
209223
except ImportError as e:

0 commit comments

Comments
 (0)