You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 24, 2024. It is now read-only.
In xarray it's possible to automatically close a dataset after opening by opening it using a context manager. From the documentation:
Datasets have a Dataset.close() method to close the associated netCDF file. However, it’s often cleaner to use a with statement:
# this automatically closes the dataset after useIn [5]: withxr.open_dataset("saved_on_disk.nc") asds:
...: print(ds.keys())
...:
We currently don't have a DataTree.close() method, or any context manager behaviour for open_datatree. To add them presumably we would need to iterate over all file handles (i.e. groups) and close them one by one.