Skip to content

Commit

Permalink
use load_dataset with xr.tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
coxipi committed Nov 28, 2024
1 parent e9ea021 commit c7241a7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/notebooks/customize.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"outputs": [],
"source": [
"tasmax = (\n",
" xr.tutorial.open_dataset(\"air_temperature\")\n",
" xr.tutorial.load_dataset(\"air_temperature\")\n",
" .air.resample(time=\"D\")\n",
" .max(keep_attrs=True)\n",
")\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/notebooks/sdba-advanced.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"outputs": [],
"source": [
"# Daily temperature data from xarray's tutorials\n",
"ds = xr.tutorial.open_dataset(\"air_temperature\").resample(time=\"D\").mean()\n",
"ds = xr.tutorial.load_dataset(\"air_temperature\").resample(time=\"D\").mean()\n",
"tas = ds.isel(lat=0, lon=0).air\n",
"\n",
"# Compute the smoothed series\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/units.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"outputs": [],
"source": [
"# See the Usage page for details on opening datasets, subsetting and resampling.\n",
"ds = xr.tutorial.open_dataset(\"air_temperature\")\n",
"ds = xr.tutorial.load_dataset(\"air_temperature\")\n",
"tas = (\n",
" ds.air.sel(lat=40, lon=270, method=\"nearest\")\n",
" .resample(time=\"D\")\n",
Expand Down Expand Up @@ -193,7 +193,7 @@
"metadata": {},
"outputs": [],
"source": [
"ds = xr.tutorial.open_dataset(\"air_temperature\")\n",
"ds = xr.tutorial.load_dataset(\"air_temperature\")\n",
"tas_6h = ds.air.sel(\n",
" lat=40, lon=270, method=\"nearest\"\n",
") # no resampling, original data is 6-hourly\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/notebooks/usage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"source": [
"# Show that data is not at a daily time frequency\n",
"\n",
"ds6h = xr.tutorial.open_dataset(\"air_temperature\")\n",
"ds6h = xr.tutorial.load_dataset(\"air_temperature\")\n",
"xr.infer_freq(ds6h.time)"
]
},
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sdba/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def ref_hist_sim_tuto(socket_enabled): # noqa: F841
"""

def _ref_hist_sim_tuto(sim_offset=3, delta=0.1, smth_win=3, trend=True):
ds = xr.tutorial.open_dataset("air_temperature")
ds = xr.tutorial.load_dataset("air_temperature")
ref = ds.air.resample(time="D").mean(keep_attrs=True)
hist = ref.rolling(time=smth_win, min_periods=1).mean(keep_attrs=True) + delta
hist.attrs["units"] = ref.attrs["units"]
Expand Down

0 comments on commit c7241a7

Please sign in to comment.