forked from elhuhdron/pylibczi
-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Relatively recent changes to fsspec have caused an incompatibility here. We would like to be able to run code like this:
from aicspylibczi import CziFile
from fsspec.core import url_to_fs
img='path/to/file.czi'
fs, path = url_to_fs(img)
with fs.open(path) as open_resource:
c = CziFile(open_resource)
The CziFile constructor leads to running this code:
_aicspylibczi.Reader(open_resource)
but the pybind11 code that converts the constructor argument from a BufferedReader to a libCZI IStream does not work with fsspec.implementations.local.LocalFileOpener (which is a subclass of io.IOBase).
There is a workaround, which is to pass open_resource.f to the CziFile constructor
Relevant code:
CziFile.py line 57 and 63
pb_caster_BytesIO.h line 20 and 33
Metadata
Metadata
Assignees
Labels
No labels