Skip to content

Commit 3bad0cb

Browse files
DOC: Update open_zarr decode_cf docstring (#11165)
And type hint
1 parent e561396 commit 3bad0cb

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

xarray/backends/zarr.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,7 +1419,7 @@ def open_zarr(
14191419
mask_and_scale=True,
14201420
decode_times=True,
14211421
concat_characters=True,
1422-
decode_coords=True,
1422+
decode_coords: Literal["coordinates", "all"] | bool = True,
14231423
drop_variables=None,
14241424
consolidated=None,
14251425
overwrite_encoded_chunks=False,
@@ -1487,9 +1487,17 @@ def open_zarr(
14871487
form string arrays. Dimensions will only be concatenated over (and
14881488
removed) if they have no corresponding variable and if they are only
14891489
used as the last dimension of character arrays.
1490-
decode_coords : bool, optional
1491-
If True, decode the 'coordinates' attribute to identify coordinates in
1492-
the resulting dataset.
1490+
decode_coords : bool or {"coordinates", "all"}, optional
1491+
Controls which variables are set as coordinate variables:
1492+
1493+
- "coordinates" or True: Set variables referred to in the
1494+
``'coordinates'`` attribute of the datasets or individual variables
1495+
as coordinate variables.
1496+
- "all": Set variables referred to in ``'grid_mapping'``, ``'bounds'`` and
1497+
other attributes as coordinate variables.
1498+
1499+
Only existing variables can be set as coordinates. Missing variables
1500+
will be silently ignored.
14931501
drop_variables : str or iterable, optional
14941502
A variable or list of variables to exclude from being parsed from the
14951503
dataset. This may be useful to drop variables with problems or

0 commit comments

Comments
 (0)