Skip to content

Commit 8085824

Browse files
Add a close method to InferenceData (#2338)
* Add a close method to InferenceData * Call InferenceData.close when an InferenceData object gets gc'ed * add to docs and changelog, remove del method --------- Co-authored-by: Oriol Abril-Pla <[email protected]>
1 parent dbef460 commit 8085824

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- Add new example data `rugby_field` and update `rugby` example data ([2322](https://github.com/arviz-devs/arviz/pull/2322))
88
- Support for `pytree`s and robust to nested dictionaries. ([2291](https://github.com/arviz-devs/arviz/pull/2291))
9+
- Add `.close` method to `InferenceData` ([2338](https://github.com/arviz-devs/arviz/pull/2338))
910

1011

1112
### Maintenance and fixes

arviz/data/inference_data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1689,6 +1689,7 @@ def extend(self, other, join="left"):
16891689
compute = _extend_xr_method(xr.Dataset.compute)
16901690
persist = _extend_xr_method(xr.Dataset.persist)
16911691
quantile = _extend_xr_method(xr.Dataset.quantile)
1692+
close = _extend_xr_method(xr.Dataset.close)
16921693

16931694
# The following lines use methods on xr.Dataset that are dynamically defined and attached.
16941695
# As a result mypy cannot see them, so we have to suppress the resulting mypy errors.

doc/source/api/inference_data.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ IO / Conversion
3636
InferenceData.from_zarr
3737
InferenceData.to_zarr
3838
InferenceData.chunk
39+
InferenceData.close
3940
InferenceData.compute
4041
InferenceData.load
4142
InferenceData.persist

0 commit comments

Comments
 (0)