-
Notifications
You must be signed in to change notification settings - Fork 359
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
ValueError: Got more bytes so far than requested #160
Comments
Yep, you are hitting the problem that fsspec would like to be able to random access the file by issuing Range requests, but the server doesn't respect this. Typical remedies would be
|
Brilliant! I can confirm that the below works with import fsspec
import xarray as xr
with fsspec.open(
urlpath="filecache://test.opendap.org/opendap/data/nc/coads_climatology2.nc",
target_protocol="http",
target_options={"block_size": 0}
) as f:
ds = xr.open_dataset(f, decode_times=False)
print(ds) <xarray.Dataset>
Dimensions: (COADSX: 180, COADSY: 90, TIME: 12)
Coordinates:
* COADSX (COADSX) float64 21.0 23.0 25.0 27.0 ... 373.0 375.0 377.0 379.0
* COADSY (COADSY) float64 -89.0 -87.0 -85.0 -83.0 ... 83.0 85.0 87.0 89.0
* TIME (TIME) float64 366.0 1.096e+03 1.827e+03 ... 7.671e+03 8.401e+03
Data variables:
SST (TIME, COADSY, COADSX) float32 ...
AIRT (TIME, COADSY, COADSX) float32 ...
SPEH (TIME, COADSY, COADSX) float32 ...
WSPD (TIME, COADSY, COADSX) float32 ...
UWND (TIME, COADSY, COADSX) float32 ...
VWND (TIME, COADSY, COADSX) float32 ...
SLP (TIME, COADSY, COADSX) float32 ...
Attributes:
history: FERRET V5.22 11-Jan-01 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There seems to be an issue with using
fsspec
to fetch large-ish files over http:Full error message:
The example test NetCDF file above is actually just 5.2MB in size. However, trying it on a smaller file of just 3.0MB works:
This was tested using the latest
fsspec
from master (commit e69b679) andxarray==0.14.0
. Carried forward from intake/intake-xarray#56.The text was updated successfully, but these errors were encountered: