Skip to content

Commit 1b51681

Browse files
committed
Remove tutorial.load_dataset
as planned for 0.12; and remove remaining uses in docs and examples.
1 parent 6f7602f commit 1b51681

7 files changed

+9
-22
lines changed

doc/examples/monthly-means.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Open the ``Dataset``
9292

9393
.. code:: python
9494
95-
ds = xr.tutorial.load_dataset('rasm')
95+
ds = xr.tutorial.open_dataset('rasm').load()
9696
print(ds)
9797
9898

doc/gallery/plot_cartopy_facetgrid.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import xarray as xr
2323

2424
# Load the data
25-
ds = xr.tutorial.load_dataset('air_temperature')
25+
ds = xr.tutorial.open_dataset('air_temperature')
2626
air = ds.air.isel(time=[0, 724]) - 273.15
2727

2828
# This is the map projection we want to plot *onto*

doc/gallery/plot_colorbar_center.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import xarray as xr
1414

1515
# Load the data
16-
ds = xr.tutorial.load_dataset('air_temperature')
16+
ds = xr.tutorial.open_dataset('air_temperature')
1717
air = ds.air.isel(time=0)
1818

1919
f, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(8, 6))

doc/gallery/plot_control_colorbar.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import xarray as xr
1313

1414
# Load the data
15-
air_temp = xr.tutorial.load_dataset('air_temperature')
15+
air_temp = xr.tutorial.open_dataset('air_temperature')
1616
air2d = air_temp.air.isel(time=500)
1717

1818
# Prepare the figure

doc/gallery/plot_lines_from_2d.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import xarray as xr
1818

1919
# Load the data
20-
ds = xr.tutorial.load_dataset('air_temperature')
20+
ds = xr.tutorial.open_dataset('air_temperature')
2121
air = ds.air - 273.15 # to celsius
2222

2323
# Prepare the figure

doc/whats-new.rst

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ Breaking changes
3030
By `Maximilian Roos <https://github.com/max-sixty>`_.
3131
- `cyordereddict` is no longer used as an optional dependency (:issue:`2744`).
3232
By `Joe Hamman <https://github.com/jhamman>`_.
33+
- ``xarray.tutorial.load_dataset`` has been removed as scheduled in Xarray 0.11.
34+
Instead, you can use ``tutorial.open_dataset(...).load()`` which allows you
35+
to use tutorial datasets with dask.
36+
By `Zac Hatfield-Dodds <https://github.com/Zac-HD>`_.
3337

3438
Enhancements
3539
~~~~~~~~~~~~

xarray/tutorial.py

-17
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,3 @@ def open_dataset(name, cache=True, cache_dir=_default_cache_dir,
8787
_os.remove(localfile)
8888

8989
return ds
90-
91-
92-
def load_dataset(*args, **kwargs):
93-
"""
94-
`load_dataset` will be removed in version 0.12. The current behavior of
95-
this function can be achived by using `tutorial.open_dataset(...).load()`.
96-
97-
See Also
98-
--------
99-
open_dataset
100-
"""
101-
warnings.warn(
102-
"load_dataset` will be removed in xarray version 0.12. The current "
103-
"behavior of this function can be achived by using "
104-
"`tutorial.open_dataset(...).load()`.",
105-
DeprecationWarning, stacklevel=2)
106-
return open_dataset(*args, **kwargs).load()

0 commit comments

Comments
 (0)