Skip to content

Commit

Permalink
Remove tutorial.load_dataset
Browse files Browse the repository at this point in the history
as planned for 0.12; and remove remaining uses in docs and examples.
  • Loading branch information
Zac-HD committed Feb 20, 2019
1 parent 562ffb8 commit d6e15cc
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 22 deletions.
2 changes: 1 addition & 1 deletion doc/examples/monthly-means.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Open the ``Dataset``

.. code:: python
ds = xr.tutorial.load_dataset('rasm')
ds = xr.tutorial.open_dataset('rasm').load()
print(ds)
Expand Down
2 changes: 1 addition & 1 deletion doc/gallery/plot_cartopy_facetgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import xarray as xr

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

# This is the map projection we want to plot *onto*
Expand Down
2 changes: 1 addition & 1 deletion doc/gallery/plot_colorbar_center.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import xarray as xr

# Load the data
ds = xr.tutorial.load_dataset('air_temperature')
ds = xr.tutorial.open_dataset('air_temperature')
air = ds.air.isel(time=0)

f, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(8, 6))
Expand Down
2 changes: 1 addition & 1 deletion doc/gallery/plot_control_colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import xarray as xr

# Load the data
air_temp = xr.tutorial.load_dataset('air_temperature')
air_temp = xr.tutorial.open_dataset('air_temperature')
air2d = air_temp.air.isel(time=500)

# Prepare the figure
Expand Down
2 changes: 1 addition & 1 deletion doc/gallery/plot_lines_from_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import xarray as xr

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

# Prepare the figure
Expand Down
17 changes: 0 additions & 17 deletions xarray/tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,3 @@ def open_dataset(name, cache=True, cache_dir=_default_cache_dir,
_os.remove(localfile)

return ds


def load_dataset(*args, **kwargs):
"""
`load_dataset` will be removed in version 0.12. The current behavior of
this function can be achived by using `tutorial.open_dataset(...).load()`.
See Also
--------
open_dataset
"""
warnings.warn(
"load_dataset` will be removed in xarray version 0.12. The current "
"behavior of this function can be achived by using "
"`tutorial.open_dataset(...).load()`.",
DeprecationWarning, stacklevel=2)
return open_dataset(*args, **kwargs).load()

0 comments on commit d6e15cc

Please sign in to comment.