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

xarray cacheing NetCDF files #277

Open
bendudson opened this issue Feb 6, 2023 · 1 comment
Open

xarray cacheing NetCDF files #277

bendudson opened this issue Feb 6, 2023 · 1 comment

Comments

@bendudson
Copy link
Contributor

When reading data xarray uses a cache. This can cause problems because xarray doesn't check if the file has changed on disk. The result is either reading out-of-date data, or errors about array sizes not matching.

There is some discussion here: pydata/xarray#4240

From that discussion: Closing datasets with the ds.close() method may work. Clear the file cache with: xarray.backends.file_manager.FILE_CACHE.clear()

@mikekryjak
Copy link
Collaborator

Thanks @bendudson, it's good to know this has been seen elsewehere!

I have tried this in Jupyter. The command executes, but then when I try to read in a case I get a kernel crash with very little verbosity. Will need to dig a bit deeper.

I get the below message:
The Kernel crashed while executing code in the the current cell or a previous cell. Please review the code in the cell(s) to identify a possible cause of the failure. Click here for more info. View Jupyter log for further details.

Jupyter log:

error 10:30:07.495: Disposing session as kernel process died ExitCode: undefined, Reason: /ssd_scratch/anaconda3/lib/python3.9/site-packages/traitlets/traitlets.py:2544: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.
  warn(
/ssd_scratch/anaconda3/lib/python3.9/site-packages/traitlets/traitlets.py:2495: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '2146a369-82ca-44ef-97ac-b08b8f5339c3' instead of 'b"2146a369-82ca-44ef-97ac-b08b8f5339c3"'.
  warn(

info 10:30:07.496: Dispose Kernel process 1195168.
error 10:30:07.498: Raw kernel process exited code: undefined

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

No branches or pull requests

2 participants