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

Function _iris_cell_methods_to_str

xarray/convert.py:132–145  ·  view source on GitHub ↗

Converts an Iris cell methods into a string

(cell_methods_obj)

Source from the content-addressed store, hash-verified

130
131
132def _iris_cell_methods_to_str(cell_methods_obj):
133 """Converts an Iris cell methods into a string"""
134 cell_methods = []
135 for cell_method in cell_methods_obj:
136 names = "".join(f"{n}: " for n in cell_method.coord_names)
137 intervals = " ".join(
138 f"interval: {interval}" for interval in cell_method.intervals
139 )
140 comments = " ".join(f"comment: {comment}" for comment in cell_method.comments)
141 extra = f"{intervals} {comments}".strip()
142 if extra:
143 extra = f" ({extra})"
144 cell_methods.append(names + cell_method.method + extra)
145 return " ".join(cell_methods)
146
147
148def _name(iris_obj, default="unknown"):

Callers 1

from_irisFunction · 0.85

Calls 2

stripMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…