issues: 801672790
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
801672790 | MDU6SXNzdWU4MDE2NzI3OTA= | 4862 | Obtaining fresh data from the disk when reopening a NetCDF file a second time | 488992 | closed | 0 | 2 | 2021-02-04T22:09:09Z | 2023-03-30T20:01:06Z | 2023-03-30T20:01:06Z | CONTRIBUTOR | I have a program where I open a ```python import shutil import xarray as xr a = xr.open_dataset("bla.nc") Simulate external process modifying bla.nc while this script is runningshutil.copy("bla_mod.nc", "bla.nc") a.close() # this is the only thing that WOULD make it work!b = xr.open_dataset("bla.nc") Here I would expect b to be different than a, but it is not``` I understand that the file SHOULD be At first I thought that I could use the After some experiments to better understand the code, I came to the conclusion that the only way my particular use case could be supported (that is, without using an explicit Given that I cannot really see how, in the particular case where the user calls https://github.com/pydata/xarray/compare/master...cjauvin:netcdf-caching-bug Because I admit that this looks weird at first sight (why close an object immediately after having created it?), I imagine that a better option would probably be to add a boolean option to the I think this subtle change would result in a more coherent experience with the exact use case that I present, but admittedly, I didn't study the overall code deeply enough to be certain that it couldn't result in unwanted side effects for some other backends. |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4862/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |