set_close

UnitsAwareDataArray.set_close(close: Callable[[], None] | None) None

Register the function that releases any resources linked to this object.

This method controls how xarray cleans up resources associated with this object when the .close() method is called. It is mostly intended for backend developers and it is rarely needed by regular end-users.

Parameters:

close (callable) – The function that when called like close() releases any resources linked to this object.