Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the references to _file_obj outside low level code paths, change to _close #4809

Merged
merged 18 commits into from
Jan 18, 2021
Merged

Remove the references to _file_obj outside low level code paths, change to _close #4809

merged 18 commits into from
Jan 18, 2021

Conversation

alexamici
Copy link
Collaborator

@alexamici alexamici commented Jan 14, 2021

You can now pass a close argument to xr.Dataset that closes the backend resources. This is only useful to backend developers, we need to add the documentation as per #4803 but it may need to be hidden and not documented to end-users.

The PR is draft pending some cleanups and the documentation.

@alexamici alexamici changed the title WIP: Remove the references to _file_obj outside low level code paths, change to _close Remove the references to _file_obj outside low level code paths, change to _close Jan 14, 2021
@alexamici alexamici marked this pull request as ready for review January 14, 2021 15:58
@alexamici alexamici requested review from shoyer, max-sixty and aurghs and removed request for max-sixty January 14, 2021 15:58
@shoyer
Copy link
Member

shoyer commented Jan 14, 2021

Per discussion, let's create a set_close method instead of adding this into the Dataset/DataArray constructor.

@shoyer shoyer closed this Jan 14, 2021
@shoyer shoyer reopened this Jan 14, 2021
xarray/core/common.py Show resolved Hide resolved
xarray/core/dataarray.py Outdated Show resolved Hide resolved
@keewis keewis mentioned this pull request Jan 14, 2021
5 tasks
xarray/backends/api.py Outdated Show resolved Hide resolved
@alexamici
Copy link
Collaborator Author

I'll merge it after the last cleanup as I need this to start working on the API v1 to v2 PR. Thanks @shoyer !

xarray/core/common.py Outdated Show resolved Hide resolved
xarray/core/common.py Outdated Show resolved Hide resolved
xarray/core/common.py Outdated Show resolved Hide resolved
@alexamici
Copy link
Collaborator Author

woops, I see you didn't finish, yet :)

alexamici and others added 2 commits January 15, 2021 20:04
Co-authored-by: Stephan Hoyer <shoyer@google.com>
xarray/core/common.py Outdated Show resolved Hide resolved
@alexamici alexamici merged commit 2a43385 into pydata:master Jan 18, 2021
dcherian added a commit to TomNicholas/xarray that referenced this pull request Jan 29, 2021
* upstream/master:
  Bugfix in list_engine (pydata#4811)
  Add drop_isel (pydata#4819)
  Fix RST.
  Remove the references to `_file_obj` outside low level code paths, change to `_close` (pydata#4809)
dcherian added a commit to dcherian/xarray that referenced this pull request Jan 29, 2021
* upstream/master:
  speed up the repr for big MultiIndex objects (pydata#4846)
  dim -> coord in DataArray.integrate (pydata#3993)
  WIP: backend interface, now it uses subclassing  (pydata#4836)
  weighted: small improvements (pydata#4818)
  Update related-projects.rst (pydata#4844)
  iris update doc url (pydata#4845)
  Faster unstacking (pydata#4746)
  Allow swap_dims to take kwargs (pydata#4841)
  Move skip ci instructions to contributing guide (pydata#4829)
  fix issues in drop_sel and drop_isel (pydata#4828)
  Bugfix in list_engine (pydata#4811)
  Add drop_isel (pydata#4819)
  Fix RST.
  Remove the references to `_file_obj` outside low level code paths, change to `_close` (pydata#4809)
dcherian added a commit to dcherian/xarray that referenced this pull request Feb 3, 2021
* master: (458 commits)
  Add units if "unit" is in the attrs. (pydata#4850)
  speed up the repr for big MultiIndex objects (pydata#4846)
  dim -> coord in DataArray.integrate (pydata#3993)
  WIP: backend interface, now it uses subclassing  (pydata#4836)
  weighted: small improvements (pydata#4818)
  Update related-projects.rst (pydata#4844)
  iris update doc url (pydata#4845)
  Faster unstacking (pydata#4746)
  Allow swap_dims to take kwargs (pydata#4841)
  Move skip ci instructions to contributing guide (pydata#4829)
  fix issues in drop_sel and drop_isel (pydata#4828)
  Bugfix in list_engine (pydata#4811)
  Add drop_isel (pydata#4819)
  Fix RST.
  Remove the references to `_file_obj` outside low level code paths, change to `_close` (pydata#4809)
  fix decode for scale/ offset list (pydata#4802)
  Expand user dir paths (~) in open_mfdataset and to_zarr. (pydata#4795)
  add a version info step to the upstream-dev CI (pydata#4815)
  fix the ci trigger action (pydata#4805)
  scatter plot by order of the first appearance of hue (pydata#4723)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants