-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
needs triageIssue that has not been reviewed by xarray team memberIssue that has not been reviewed by xarray team membertopic-DataTreeRelated to the implementation of a DataTree classRelated to the implementation of a DataTree class
Description
What is your issue?
Originally posted by @TomNicholas in xarray-contrib/datatree#93
Attempted implementation in this PR.
In xarray it's possible to automatically close a dataset after opening by opening it using a context manager. From the documentation:
# this automatically closes the dataset after use
In [5]: with xr.open_dataset("saved_on_disk.nc") as ds:
...: 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.
Related to xarray-contrib/datatree#90 @jhamman @thewtex
thewtex
Metadata
Metadata
Assignees
Labels
needs triageIssue that has not been reviewed by xarray team memberIssue that has not been reviewed by xarray team membertopic-DataTreeRelated to the implementation of a DataTree classRelated to the implementation of a DataTree class