open it by stream
#6
by
shj66
- opened
this is my code:
import os
import xarray as xr
from huggingface_hub import HfFileSystem
# Set your Hugging Face token as an environment variable
os.environ["HF_TOKEN"] = "I_am_pretty_sure_the_token_is_valid"
# Use the HuggingFace filesystem, which handles authentication
fs = HfFileSystem(token=os.environ["HF_TOKEN"])
# To open the zarr file, use the HuggingFace filesystem with fsspec
with fs.open("datasets/openclimatefix/dwd-icon-global/data/2025/6/22/20250622_00.zarr.zip") as f:
ds = xr.open_zarr(f)
it raised:
File "/home/shengbin/gitlab/meteoetl/.venv/lib/python3.12/site-packages/zarr/storage/_common.py", line 316, in make_store_path
raise TypeError(msg)
TypeError: Unsupported type for store_like: 'HfFileSystemFile'
Thus, I want to know how can I open the zarr.zip without downloaded first? Thanks very much!