MCPcopy Index your code
hub / github.com/pydata/xarray / f

Function f

xarray/coding/cftimeindex.py:133–146  ·  view source on GitHub ↗
(self, min_cftime_version=min_cftime_version)

Source from the content-addressed store, hash-verified

131 """Adapted from pandas.tseries.index._field_accessor"""
132
133 def f(self, min_cftime_version=min_cftime_version):
134 if TYPE_CHECKING:
135 import cftime
136 else:
137 cftime = attempt_import("cftime")
138
139 if Version(cftime.__version__) >= Version(min_cftime_version):
140 return get_date_field(self._data, name)
141 else:
142 raise ImportError(
143 f"The {name:!r} accessor requires a minimum "
144 f"version of cftime of {min_cftime_version}. Found an "
145 f"installed version of {cftime.__version__}."
146 )
147
148 f.__name__ = name
149 f.__doc__ = docstring

Callers

nothing calls this directly

Calls 2

attempt_importFunction · 0.90
get_date_fieldFunction · 0.85

Tested by

no test coverage detected