MCPcopy
hub / github.com/pydata/xarray / encode_dataset_coordinates

Function encode_dataset_coordinates

xarray/conventions.py:744–763  ·  view source on GitHub ↗

Encode coordinates on the given dataset object into variable specific and global attributes. When possible, this is done according to CF conventions. Parameters ---------- dataset : Dataset Object to encode. Returns ------- variables : dict attrs : dict

(dataset: Dataset)

Source from the content-addressed store, hash-verified

742
743
744def encode_dataset_coordinates(dataset: Dataset):
745 """Encode coordinates on the given dataset object into variable specific
746 and global attributes.
747
748 When possible, this is done according to CF conventions.
749
750 Parameters
751 ----------
752 dataset : Dataset
753 Object to encode.
754
755 Returns
756 -------
757 variables : dict
758 attrs : dict
759 """
760 non_dim_coord_names = set(dataset.coords) - set(dataset.dims)
761 return _encode_coordinates(
762 dataset._variables, dataset.attrs, non_dim_coord_names=non_dim_coord_names
763 )
764
765
766def cf_encoder(variables: T_Variables, attributes: T_Attrs):

Callers 1

Calls 1

_encode_coordinatesFunction · 0.85

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…