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

Function _iris_obj_to_attrs

xarray/convert.py:121–129  ·  view source on GitHub ↗

Return a dictionary of attrs when given an Iris object

(obj)

Source from the content-addressed store, hash-verified

119
120
121def _iris_obj_to_attrs(obj):
122 """Return a dictionary of attrs when given an Iris object"""
123 attrs = {"standard_name": obj.standard_name, "long_name": obj.long_name}
124 if obj.units.calendar:
125 attrs["calendar"] = obj.units.calendar
126 if obj.units.origin != "1" and not obj.units.is_unknown():
127 attrs["units"] = obj.units.origin
128 attrs.update(obj.attributes)
129 return {k: v for k, v in attrs.items() if v is not None}
130
131
132def _iris_cell_methods_to_str(cell_methods_obj):

Callers 1

from_irisFunction · 0.85

Calls 2

itemsMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…