Skip to content

Commit 210e997

Browse files
committed
Update cf_role docs
1 parent 499a753 commit 210e997

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

cf_xarray/accessor.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,6 +1481,13 @@ def cf_roles(self) -> dict[str, list[str]]:
14811481
References
14821482
----------
14831483
Please refer to the CF conventions document : http://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#coordinates-metadata
1484+
1485+
Examples
1486+
--------
1487+
>>> import cf_xarray
1488+
>>> from cf_xarray.datasets import dsg
1489+
>>> dsg.cf.cf_roles
1490+
{'profile_id': ['profile'], 'trajectory_id': ['trajectory']}
14841491
"""
14851492
if isinstance(self._obj, Dataset):
14861493
variables = self._obj.variables

doc/quickstart.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ Sometimes it is more useful to extract the actual variable names associated with
8989
- {py:attr}`Dataset.cf.axes`,
9090
- {py:attr}`Dataset.cf.bounds`,
9191
- {py:attr}`Dataset.cf.cell_measures`,
92+
- {py:attr}`Dataset.cf.cf_roles`,
9293
- {py:attr}`Dataset.cf.coordinates`,
9394
- {py:attr}`Dataset.cf.formula_terms`, and
9495
- {py:attr}`Dataset.cf.standard_names`.

0 commit comments

Comments
 (0)