Skip to content

Commit

Permalink
Add xc.tutorial.load_dataset() API
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvothecoder committed Oct 3, 2024
1 parent e3dda64 commit 83ff4fc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions conda-env/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ dependencies:
- pandoc
- ipython # Required for nbsphinx syntax highlighting
- gsw-xarray # Required for vertical regridding example
- pooch # Required for xarray tutorial data
# Quality Assurance
# ==================
- types-python-dateutil
Expand Down
1 change: 1 addition & 0 deletions xcdat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
)
from xcdat.spatial import SpatialAccessor # noqa: F401
from xcdat.temporal import TemporalAccessor # noqa: F401
from xcdat.tutorial import load_dataset # noqa: F401
from xcdat.utils import compare_datasets # noqa: F401

__version__ = "0.7.2"
11 changes: 11 additions & 0 deletions xcdat/tutorial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import xarray as xr
from xarray.tutorial import load_dataset as xr_load_dataset

import xcdat.bounds # noqa: F401


def load_dataset(name: str) -> xr.Dataset:
ds = xr_load_dataset(name)
ds = ds.bounds.add_missing_bounds(axes=["X", "Y", "T"])

Check warning on line 9 in xcdat/tutorial.py

View check run for this annotation

Codecov / codecov/patch

xcdat/tutorial.py#L8-L9

Added lines #L8 - L9 were not covered by tests

return ds

Check warning on line 11 in xcdat/tutorial.py

View check run for this annotation

Codecov / codecov/patch

xcdat/tutorial.py#L11

Added line #L11 was not covered by tests

0 comments on commit 83ff4fc

Please sign in to comment.