PlasmaCalcs.tools.xarray_tools.xarray_accessors.xarray_register_dataarray_accessor_cls

PlasmaCalcs.tools.xarray_tools.xarray_accessors.xarray_register_dataarray_accessor_cls(name, *, warn_if_clsname_match=False)
return class decorator which registers cls as an accessor for xarray.DataArray,
as per xr.register_dataarray_accessor(name).
warn_if_clsname_match: bool, default False
whether to suppress AccessorRegistrationWarning,
when xr.DataArray.name already exists AND cls.__name__ == xr.DataArray.name.

This solves the issue that when doing pc=pc.reload(pc),
(or otherwise using importlib.reload to reload the code attaching the accessor,)
the code to attach the accessor would be run again, causing a warning.
But that warning is confusing;
it’s almost certainly just overwriting the name defined by that code originally.
Using warn_if_clsname_match=False will suppress the warning in that case.