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

Issues with Virtualizarr on Climsim feedstock #10

Open
SammyAgrawal opened this issue Sep 5, 2024 · 1 comment
Open

Issues with Virtualizarr on Climsim feedstock #10

SammyAgrawal opened this issue Sep 5, 2024 · 1 comment

Comments

@SammyAgrawal
Copy link

SammyAgrawal commented Sep 5, 2024

Getting some sort of strange error internally when virtualizarr uses fsspec. Works when I manually use ffsspec though; might be way in which their filesystem loads it.

sample_url = 'https://huggingface.co/datasets/LEAP/ClimSim_low-res-expanded/resolve/main/train/0001-02/E3SM-MMF.mlo.0001-02-02-06000.nc'
with fsspec.open(url, mode='rb').open() as file: 
    ds1 = xr.open_dataset(file, use_cftime=True, chunks={}) # works
    with open("file.nc", 'wb') as f:
        f.write(file.read()) # save local "file.nc" 
from virtualizarr import open_virtual_dataset
vds1= open_virtual_dataset("file.nc") # works
vds2 = open_virtual_dataset(sample_url) # fails

From parsing the error stack trace, the problem seems to be when fsspec.filesystem(protocol, **storage_options).open(filepath) is called internally. The eventual get request fails causing a FileNotFoundError for the url

@SammyAgrawal
Copy link
Author

SammyAgrawal commented Sep 5, 2024

import requests
resp = requests.get(sample_url)
with open('file2.nc', 'wb') as f:
    f.write(resp.content)
open_virtual_dataset("file2.nc")

This works, so the issue definitely isn't with the url as some inherently inaccessible thing. But the above FileNotFoundError comes from fsspec/implementations/http.py:435, in HTTPFileSystem._info(self, url, **kwargs)

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

1 participant