From d6e15cc1647909cebde734a5d6b92f262b234112 Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Thu, 21 Feb 2019 10:49:23 +1100 Subject: [PATCH] Remove tutorial.load_dataset as planned for 0.12; and remove remaining uses in docs and examples. --- doc/examples/monthly-means.rst | 2 +- doc/gallery/plot_cartopy_facetgrid.py | 2 +- doc/gallery/plot_colorbar_center.py | 2 +- doc/gallery/plot_control_colorbar.py | 2 +- doc/gallery/plot_lines_from_2d.py | 2 +- xarray/tutorial.py | 17 ----------------- 6 files changed, 5 insertions(+), 22 deletions(-) diff --git a/doc/examples/monthly-means.rst b/doc/examples/monthly-means.rst index 7cc47eb2847..16d8aaa32ec 100644 --- a/doc/examples/monthly-means.rst +++ b/doc/examples/monthly-means.rst @@ -92,7 +92,7 @@ Open the ``Dataset`` .. code:: python - ds = xr.tutorial.load_dataset('rasm') + ds = xr.tutorial.open_dataset('rasm').load() print(ds) diff --git a/doc/gallery/plot_cartopy_facetgrid.py b/doc/gallery/plot_cartopy_facetgrid.py index 3eded115263..5da58f3f03c 100644 --- a/doc/gallery/plot_cartopy_facetgrid.py +++ b/doc/gallery/plot_cartopy_facetgrid.py @@ -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* diff --git a/doc/gallery/plot_colorbar_center.py b/doc/gallery/plot_colorbar_center.py index 4818b737632..88511a2d327 100644 --- a/doc/gallery/plot_colorbar_center.py +++ b/doc/gallery/plot_colorbar_center.py @@ -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)) diff --git a/doc/gallery/plot_control_colorbar.py b/doc/gallery/plot_control_colorbar.py index 5802a57cf31..e7a275e8d86 100644 --- a/doc/gallery/plot_control_colorbar.py +++ b/doc/gallery/plot_control_colorbar.py @@ -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 diff --git a/doc/gallery/plot_lines_from_2d.py b/doc/gallery/plot_lines_from_2d.py index 93d7770238e..25691867fdf 100644 --- a/doc/gallery/plot_lines_from_2d.py +++ b/doc/gallery/plot_lines_from_2d.py @@ -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 diff --git a/xarray/tutorial.py b/xarray/tutorial.py index 3f92bd9a400..6b61c916434 100644 --- a/xarray/tutorial.py +++ b/xarray/tutorial.py @@ -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()