xarray_accessors.utils.
del_nested_attr
Remove a nested attribute from the given object.
del_nested_attr(x, ['y', 'z']) is equivalent to del x.y.z.
del_nested_attr(x, ['y', 'z'])
del x.y.z
obj – Object to be evaluated.
names – Sequence of attribute names.
AttributeError – Raised if the nested attribute does not exist.
ValueError – Raised if names is an invalid object (e.g., a string, an empty list or tuple).
names
get_nested_attr
Get a nested attribute from the given object.
get_nested_attr(x, ['y', 'z']) is equivalent to x.y.z.
get_nested_attr(x, ['y', 'z'])
x.y.z
default – Default value. It is returned if the nested attribute does not exist.
Nested attribute of an object.
AttributeError – Raised if the nested attribute does not exist and default is not specified.
default
has_nested_attr
Return whether an object has a nested attribute.
True if the object has the nested attribute. False otherwise.
True
False
set_nested_attr
Set a nested attribute on the given object to the given value.
set_nested_attr(x, ['y', 'z'], v) is equivalent to x.y.z = v.
set_nested_attr(x, ['y', 'z'], v)
x.y.z = v
values – Value to be set as the nested attribute.