core.validation
Decorator engine for runtime validation and dynamic docstring generation.
Functions¶
| Name | Description |
|---|---|
| requires_attrs | Decorator to enforce that specific attributes exist in self._obj.attrs. |
requires_attrs¶
core.validation.requires_attrs(*keys)Decorator to enforce that specific attributes exist in self._obj.attrs.
If attributes are missing at runtime, it raises a clear ValueError with instructions on how to fix it using standard xarray methods. At import time, it dynamically appends the required attributes to the method’s docstring.
Parameters¶
| Name | Type | Description | Default |
|---|---|---|---|
| *keys | str | The attribute string keys required by the method (e.g., ATTRS.b0_field). | () |