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

Method __post_init__

xarray/core/extension_array.py:250–260  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

248 array: T_ExtensionArray
249
250 def __post_init__(self):
251 if not isinstance(self.array, pd.api.extensions.ExtensionArray):
252 raise TypeError(f"{self.array} is not a pandas ExtensionArray.")
253 # This does not use the UNSUPPORTED_EXTENSION_ARRAY_TYPES whitelist because
254 # we do support extension arrays from datetime, for example, that need
255 # duck array support internally via this class. These can appear from `DatetimeIndex`
256 # wrapped by `PandasIndex` internally, for example.
257 if not is_allowed_extension_array(self.array):
258 raise TypeError(
259 f"{self.array.dtype!r} should be converted to a numpy array in `xarray` internally."
260 )
261
262 def __array_function__(self, func, types, args, kwargs):
263 if func not in HANDLED_EXTENSION_ARRAY_FUNCTIONS:

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected