Closed rabernat closed 2 years ago
You try to use the old way of caching in intake
.
Its recommended to use caching from fsspec
: https://filesystem-spec.readthedocs.io/en/latest/features.html#caching-files-locally, i.e. specifying storage_options
and append simplecache::
to the url. if you want the same name pass "cache_storage": folder
and "same_names": True
plugins:
source:
- module: intake_xarray
sources:
sample_grib_data:
description: Sample GRIB file
driver: netcdf
args:
urlpath: 'simplecache::https://github.com/ecmwf/climetlab/raw/main/docs/examples/test.grib'
xarray_kwargs:
engine: cfgrib
import intake
cat = intake.open_catalog("catalog.yaml")
cat.sample_grib_data.to_dask()
Thanks for the tip @aaronspring! I revised my catalog as follows and it worked:
plugins:
source:
- module: intake_xarray
sources:
sample_grib_data:
description: Sample GRIB file
driver: netcdf
args:
urlpath: 'simplecache::https://github.com/ecmwf/climetlab/raw/main/docs/examples/test.grib'
xarray_kwargs:
engine: cfgrib
Also seems related to https://github.com/fsspec/filesystem_spec/issues/794.
Can we close this issue?
Thanks for your reply Aaron. I was confused by the intake documentation, but I now see that the feature I was trying to use is deprecated.
I would consider adding a note to the intake-xarray docs explaining how to activate caching, perhaps linking to https://intake.readthedocs.io/en/latest/catalog.html#caching. (Overall I find the documentation to be lacking in terms of useful examples and code I can just copy and paste.)
Other than that suggestion, you may consider my issue resolved.
The original Intake caching should still work - but it's of course not high priority. I don't immediately see anything wrong in how it was defined.
I am trying to use intake-xarray to download a grib file and open it with xarray. Here is the catalog:
And here is the code:
traceback:
So the error is ultimately being raised in fsspec. But I thought I would start here, since I don't fully understand the call stack here.