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()
When reading data
xarrayuses 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()