Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

core.validation

core.validation

Decorator engine for runtime validation and dynamic docstring generation.

Functions

NameDescription
requires_attrsDecorator 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

NameTypeDescriptionDefault
*keysstrThe attribute string keys required by the method (e.g., ATTRS.b0_field).()