🍾 Xarray is now 10 years old! 🎉

xarray.Dataset.set_close

xarray.Dataset.set_close#

Dataset.set_close(close)[source]#

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.