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
This is probably a problem with s3fs, but for now it's worth noting here. In practice, we cannot read contigous data from a file opened on an s3fs. Here's some toy code to show the problem:
Traceback (most recent call last):
File "/Users/bnl28/Repositories/pyfive/bnl/mytest_s3_etc.py", line 32, in <module>
d2 = s3(fn,v)
File "/Users/bnl28/Repositories/pyfive/bnl/mytest_s3_etc.py", line 25, in s3
dd = d[:]
File "/Users/bnl28/Repositories/pyfive/pyfive/high_level.py", line 279, in __getitem__
data = self._dataobjects.get_data(args)
File "/Users/bnl28/Repositories/pyfive/pyfive/dataobjects.py", line 630, in get_data
return self._get_contiguous_data(self.property_offset)[args]
File "/Users/bnl28/Repositories/pyfive/pyfive/dataobjects.py", line 671, in _get_contiguous_data
return np.memmap(self.fh, dtype=self.dtype, mode='c',
File "/Users/bnl28/mambaforge/envs/fesom/lib/python3.10/site-packages/numpy/core/memmap.py", line 267, in __new__
mm = mmap.mmap(fid.fileno(), bytes, access=acc, offset=start)
io.UnsupportedOperation: fileno
This appears to arise from a failure of the object returned by s3fs.F3FileSystem.open to fully respect the requirement to be "file like" - but to be fair, they don't claim feature completeness.
The text was updated successfully, but these errors were encountered:
(To be fair, that error message is from my branch with the chunking read pull request, here's the same thing on master:
Traceback (most recent call last):
File "/Users/bnl28/Repositories/pyfive/bnl/mytest_s3_etc.py", line 32, in <module>
d2 = s3(fn,v)
File "/Users/bnl28/Repositories/pyfive/bnl/mytest_s3_etc.py", line 25, in s3
dd = d[:]
File "/Users/bnl28/Repositories/pyfive/pyfive/high_level.py", line 279, in __getitem__
data = self._dataobjects.get_data()[args]
File "/Users/bnl28/Repositories/pyfive/pyfive/dataobjects.py", line 420, in get_data
return self._get_contiguous_data(property_offset)
File "/Users/bnl28/Repositories/pyfive/pyfive/dataobjects.py", line 454, in _get_contiguous_data
return np.memmap(self.fh, dtype=self.dtype, mode='c',
File "/Users/bnl28/mambaforge/envs/fesom/lib/python3.10/site-packages/numpy/core/memmap.py", line 267, in __new__
mm = mmap.mmap(fid.fileno(), bytes, access=acc, offset=start)
io.UnsupportedOperation: fileno
I have a solution in a branch on my fork, I'll not generate a pull request here til we've worked through the issue6 pull request, as it builds on that.
This is probably a problem with s3fs, but for now it's worth noting here. In practice, we cannot read contigous data from a file opened on an s3fs. Here's some toy code to show the problem:
which gives:
This appears to arise from a failure of the object returned by
s3fs.F3FileSystem.open
to fully respect the requirement to be "file like" - but to be fair, they don't claim feature completeness.The text was updated successfully, but these errors were encountered: