You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reading one large netCDF file using xarray results in errors due to wrong arguments to read:
ArgumentError: Python argument types in
OnedataFileHandle.read(OnedataFileHandle, numpy.int64, int)
did not match C++ signature:
read(OnedataFileHandle {lvalue}, long, unsigned long)
The self.pos value was updated before by a call to seek() with a numpy.int64.
Code to reproduce:
import numpy as np
from fs.onedatafs import OnedataFS
onedata_provider_host = "plg-cyfronet-01.datahub.egi.eu"
onedata_access_token = "MDA.."
# Create connection to Oneprovider
odfs = OnedataFS(onedata_provider_host, onedata_access_token)
h = np.int64(100)
f = odfs.open('/EGI Foundation/Untitled Folder/tas_1991_2016_NLD.csv', 'rb')
f.seek(h)
f.read(10)
The original code was doing this:
import xarray as xr
f = odfs.open('/EGI Foundation/Untitled Folder/data2/ERA5_rainfall_and_temperature.nc', 'rb')
ds = xr.open_dataset(f)
The text was updated successfully, but these errors were encountered:
@enolfc This looks like a problem of the C++ binding which is picky about types passed to the methods - I will fix this by adding the cast inside the seek and read, but can you check for now that it works if you change the code to:
Reading one large netCDF file using xarray results in errors due to wrong arguments to read:
The self.pos value was updated before by a call to seek() with a numpy.int64.
Code to reproduce:
The original code was doing this:
The text was updated successfully, but these errors were encountered: