Can I convert my full filepaths to partially templated paths? #334
Replies: 3 comments 3 replies
-
You maybe want to use function Another more exotic solution would be to wrap the "target" filesystem with a "DirFileSystem", so that you always specify the prefix path at runtime. |
Beta Was this translation helpful? Give feedback.
-
The more exotic solution sounds interesting, but I'm not sure how to make that work.
The specific use case:We created the reference file system on Windows where the climate data is mounted as:
But we would like to use the reference file system also on linux machines where the data is mounted as:
|
Beta Was this translation helpful? Give feedback.
-
That works too |
Beta Was this translation helpful? Give feedback.
-
I used
SingleHdf5toZarr
to generate references on a local filesystem for some remotely mounted filesystem NetCDF files, and then usedMultiZarrToZarr
to combine them. The resulting JSON ended up full of long paths, the prefix of which is all the same, for example:I know in other references I've created with kerchunk, the
templates
specify the entire file path, like:In my use case all the netcdf files are prefixed by:
W:data/CMIP6/HadGEM3-GC31-HH_10km/r1i1p1f1/highres-future
and it would be nice to be able to specify that as a template.Is it possible to use the
templates
capability to specify the common part of a path? Like:This would reduce the reference file size, but more importantly make it easy to switch the prefix, which is important in this use case since the data files appear differently to different users, and so they would need to switch the references accordingly!
Beta Was this translation helpful? Give feedback.
All reactions