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

Bloated dependencies and installation #90

Closed
constantinpape opened this issue Jun 14, 2021 · 17 comments
Closed

Bloated dependencies and installation #90

constantinpape opened this issue Jun 14, 2021 · 17 comments

Comments

@constantinpape
Copy link
Contributor

I think that the dependencies are a bit bloated in this package.
In particular:

  • opencv dependency: this should be avoided if there is also scikit-image in the dependencies; for me this makes the package unusable in many deployments because opencv clashes with other dependencies. Afaik opencv is only used for nearest neighbor downsampling, which can also be done with scikit-image.
  • vispy dependency: why? there is no visualisation involved here. Probably this is a leftover from the napari cookiecutter.
  • napari: same as vispy

Also, in the installation the package installs a napari plugin, which should be removed in favor of napari-ome-zarr.

@sbesson
Copy link
Member

sbesson commented Jun 14, 2021

@constantinpape note there is an ongoing work on #86 as a follow-up of the extraction of the napari layer into its separate repository. I would assume at least the napari dependency can be removed straight away.

@joshmoore
Copy link
Member

Yup, merged. Sorry, I thought I had done that last week.

@constantinpape : if you have a scikit-image implementation that can also downsample labels, then we can look into dropping.

What's the clash in the dependencies? Would pinning versions help?

@constantinpape
Copy link
Contributor Author

@constantinpape : if you have a scikit-image implementation that can also downsample labels, then we can look into dropping.

What's the clash in the dependencies? Would pinning versions help?

vigra and several of my own dependencies.
I don't think pinning helps much, opencv is just a massive dependency that I try to avoid at all costs because it does not play nice with other c++/python packages. (And I think it's not necessary for most use cases because the same functionality is there in scikit-image.)

@joshmoore
Copy link
Member

I went through half-a-dozen different attempts to downsample the labels until settling on opencv. You're likely much more proficient in what's available/possible though.

@constantinpape
Copy link
Contributor Author

I went through half-a-dozen different attempts to downsample the labels until settling on opencv. You're likely much more proficient in what's available/possible though.

Ok, I can just include a scikit-image version in #89 and we can iterate on this in that PR.

@lassoan
Copy link

lassoan commented Jul 16, 2021

Thanks for providing this nice package! We plan adopt ome-zarr in 3D Slicer and writing an import plugin in Python using ome-zarr-py would be ideal.

However, we cannot deal with OpenCV and vispy as dependencies. They are huge and for us they are redundant (we use ITK and VTK instead). Wheels are not available in all the environments that we need to support and we cannot take on the development and support efforts needed for building wheels for such large and complex packages.

It is great to see from the discussions and pull requests that the OpenCV requirement is going away. It would be awesome if you could find a way to make vispy optional, too. Thank you.

@constantinpape
Copy link
Contributor Author

It would be awesome if you could find a way to make vispy optional, too. Thank you.

We have discussed this somewhere already: the vispy dependency is also not necessary; right now it is only used to create a colormap for the downstream napari plugin and it is possible to do this as a plain python type and then convert to vispy in the downstream application.

I am working on #89 this week and will follow up on the vispy dependency once that's done.

@joshmoore
Copy link
Member

vispy removal is hopefully covered with #91 and ome/napari-ome-zarr#10, though comments welcome.

@lassoan
Copy link

lassoan commented Aug 10, 2021

Awesome, thank you!

@constantinpape
Copy link
Contributor Author

constantinpape commented Aug 11, 2021

Once vispy is removed we should also simplfy the test env and remove all the PyQT5 / PySide2 logic.
Edit: I just saw that #91 is doing exactly that :).

@joshmoore
Copy link
Member

Edit: I just saw that #91 is doing exactly that :).

👍 😉

@BioinfoTongLI
Copy link

Hello there!
I still see vispy being installed with pip install ome-zarr

root@74caf98b9df5:/# pip install ome-zarr
Collecting ome-zarr
  Downloading ome_zarr-0.0.20-py3-none-any.whl (24 kB)
Collecting fsspec>=0.9.0
  Downloading fsspec-2021.7.0-py3-none-any.whl (118 kB)
     |################################| 118 kB 35.4 MB/s
Collecting opencv-contrib-python-headless
  Downloading opencv_contrib_python_headless-4.5.3.56-cp36-cp36m-manylinux2014_x86_64.whl (42.3 MB)
     |################################| 42.3 MB 139 kB/s
Collecting vispy
  Downloading vispy-0.7.3.tar.gz (13.4 MB)
     |################################| 13.4 MB 85.0 MB/s
     ```
Is this expected?

@joshmoore
Copy link
Member

Hi @BioinfoTongLI. The PR is merged but not yet released. Few more ducks to get in a row.

@joshmoore
Copy link
Member

Latest release should be vispy-free.

@sbesson
Copy link
Member

sbesson commented Sep 20, 2021

With ome-zarr 0.1.0, all three dependencies mentioned in this issue have been removed. Anything else to do here or should we close this issue @constantinpape ?

@constantinpape
Copy link
Contributor Author

Yes, I think the dependencies look good now, so we can close this.

@lassoan
Copy link

lassoan commented Sep 21, 2021

Thanks a lot guys. This makes this package much easier to use in our projects.

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

5 participants