home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 38502970

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
38502970 MDExOlB1bGxSZXF1ZXN0MTg3NTk1NTA= 188 Dataset context manager and close() method 1217238 closed 0   650893 1 2014-07-23T07:03:49Z 2014-07-29T19:47:46Z 2014-07-29T19:44:30Z MEMBER   0 pydata/xarray/pulls/188

With this PR, it is possible to close the data store from which a dataset was loaded via ds.close() or automatically when a dataset is used with a context manager:

python with xray.open_dataset('data.nc') as ds: ...

The ability to cleanly close files opened from disk is pretty essential -- we probably should have had this a while ago. It should not be necessary to use the low-level/unstable datastore API to get this functionality.

Implementation question: With this current implementation, calling ds.close() on (and using a context manager with) a dataset not linked to any file objects is a no-op. Should we raise an exception instead? Something like IOError('no file object to close')?

CC @ToddSmall

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/188/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 pull

Links from other tables

  • 3 rows from issues_id in issues_labels
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 0.7ms · About: xarray-datasette