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

New test case using bioio not working #146

Open
haesleinhuepf opened this issue Nov 21, 2024 · 0 comments
Open

New test case using bioio not working #146

haesleinhuepf opened this issue Nov 21, 2024 · 0 comments

Comments

@haesleinhuepf
Copy link
Owner

Hi Riccardo @rmassei,

when testing one of the test-cases in #142 the test using bioio wasn't working on my side. Do you think bioio is ready for production?

tiff_metadata_reading.ipynb.txt

Error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
[~\AppData\Local\Temp\ipykernel_31772\3461792158.py](http://localhost:8888/lab/tree/test_cases/~/AppData/Local/Temp/ipykernel_31772/3461792158.py) in ?()
----> 1 check(image_metadata_reading)

[~\AppData\Local\Temp\ipykernel_31772\1185145184.py](http://localhost:8888/lab/tree/test_cases/~/AppData/Local/Temp/ipykernel_31772/1185145184.py) in ?(candidate)
      1 def check(candidate):
----> 2     result_metadata = candidate(".[./example_data/blobs.tif](http://localhost:8888/lab/tree/test_cases/example_data/blobs.tif)")
      3     expected_metadata = {"shape": [254, 256]}
      4 
      5     assert result_metadata == expected_metadata

[~\AppData\Local\Temp\ipykernel_31772\1789573548.py](http://localhost:8888/lab/tree/test_cases/~/AppData/Local/Temp/ipykernel_31772/1789573548.py) in ?(image_filename)
      8 
      9     from bioio import BioImage
     10     import bioio_tifffile
     11     img = BioImage(image_filename, reader=bioio_tifffile.Reader)
---> 12     metadata = json.loads(img.metadata)
     13     return metadata

[~\miniforge3\envs\heb4\lib\site-packages\bioio\bio_image.py](http://localhost:8888/lab/tree/test_cases/~/miniforge3/envs/heb4/lib/site-packages/bioio/bio_image.py) in ?(self)
    922             Passthrough to the base image reader metadata property.
    923             For more information, see the specific image format reader you are using
    924             for details on its metadata property.
    925         """
--> 926         return self.reader.metadata

[~\miniforge3\envs\heb4\lib\site-packages\bioio_base\reader.py](http://localhost:8888/lab/tree/test_cases/~/miniforge3/envs/heb4/lib/site-packages/bioio_base/reader.py) in ?(self)
    773             `xarray_dask_data.attrs` which will contain a dictionary with keys:
    774             `unprocessed` and `processed` that you can then select.
    775         """
    776         if self._metadata is None:
--> 777             if constants.METADATA_PROCESSED in self.xarray_dask_data.attrs:
    778                 self._metadata = self.xarray_dask_data.attrs[
    779                     constants.METADATA_PROCESSED
    780                 ]

[~\miniforge3\envs\heb4\lib\site-packages\bioio_base\reader.py](http://localhost:8888/lab/tree/test_cases/~/miniforge3/envs/heb4/lib/site-packages/bioio_base/reader.py) in ?(self)
    425         xarray_dask_data: xr.DataArray
    426             The delayed image and metadata as an annotated data array.
    427         """
    428         if self._xarray_dask_data is None:
--> 429             self._xarray_dask_data = self._read_delayed()
    430 
    431         return self._xarray_dask_data

[~\miniforge3\envs\heb4\lib\site-packages\bioio_tifffile\reader.py](http://localhost:8888/lab/tree/test_cases/~/miniforge3/envs/heb4/lib/site-packages/bioio_tifffile/reader.py) in ?(self)
    459         exceptions.UnsupportedFileFormatError
    460             The file could not be read or is not supported.
    461         """
    462         with self._fs.open(self._path) as open_resource:
--> 463             with TiffFile(open_resource, is_mmstack=False) as tiff:
    464                 # Get dims from provided or guess
    465                 dims = self._get_dims_for_scene(tiff)
    466 

[~\miniforge3\envs\heb4\lib\site-packages\tifffile\tifffile.py](http://localhost:8888/lab/tree/test_cases/~/miniforge3/envs/heb4/lib/site-packages/tifffile/tifffile.py) in ?(self, file, mode, name, offset, size, omexml, _multifile, _useframes, _parent, **is_flags)
   3924             if key[:3] == 'is_' and key[3:] in TIFF.FILE_FLAGS:
   3925                 if value is not None:
   3926                     setattr(self, key, bool(value))
   3927             else:
-> 3928                 raise TypeError(f'unexpected keyword argument: {key}')
   3929 
   3930         if mode not in (None, 'r', 'r+', 'rb', 'r+b'):
   3931             raise ValueError(f'invalid mode {mode!r}')

TypeError: unexpected keyword argument: is_mmstack

Feel free to refine, e.g. by specifying a bioio version and send it as a new Pull-request.

Thanks!

Best,
Robert

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