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

Function _get_iris_args

xarray/convert.py:67–77  ·  view source on GitHub ↗

Converts the xarray attrs into args that can be passed into Iris

(attrs)

Source from the content-addressed store, hash-verified

65
66
67def _get_iris_args(attrs):
68 """Converts the xarray attrs into args that can be passed into Iris"""
69 # iris.unit is deprecated in Iris v1.9
70 import cf_units
71
72 args = {"attributes": _filter_attrs(attrs, iris_forbidden_keys)}
73 args.update(_pick_attrs(attrs, ("standard_name", "long_name")))
74 unit_args = _pick_attrs(attrs, ("calendar",))
75 if "units" in attrs:
76 args["units"] = cf_units.Unit(attrs["units"], **unit_args)
77 return args
78
79
80# TODO: Add converting bounds from xarray to Iris and back

Callers 1

to_irisFunction · 0.85

Calls 3

_filter_attrsFunction · 0.85
_pick_attrsFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…