angelolab / ark-analysis

Integrated pipeline for multiplexed image analysis
https://ark-analysis.readthedocs.io/en/latest/
MIT License
71 stars 25 forks source link

Dependency conflicts between pyproject.toml and environment.yml #1026

Closed camisowers closed 1 year ago

camisowers commented 1 year ago

Please refer to our FAQ and look at our known issues before opening a bug report.

Describe the bug When trying to import visualize in spatial enrichment notebook (similarly for the kmeans ad LDA as well), it errors due to the depreciated np.float being used by calico.spatial_lda. PR #984 addressed this by changing the numpy depency in pyproject.toml to be capped at 1.23; however, in practice when users create an ark_env to run the notebooks, the conda installation of numpy using the environment.yml file supersedes this.

A larger issue is that any dependency specification made in pyproject.toml will be irrelevant when the same package is listed in the environment.yml file.

Expected behavior We should remove any packages from the conda install unless strictly necessary, and rely on the more detailed pyproject.toml installs. This will also help prevent future issues with package updates we aren't prepared to handle yet, to then update on our own terms.

Current environment.yml specifications:

dependencies:
  - python=3.11
  - pip
  - hdf5
  - jupyterlab
  - ipywidgets
  - tqdm
  - numpy
  - pandas
  - xarray
  - scipy
  - scikit-image
  - matplotlib
  - seaborn
  - pip:
    - alpineer>=0.1.8
    - pyFlowSOM>=0.1.5
    - .[lab_ext]

After consulting with @srivarra, we only need to keep python=3.11, pip, hdf5, ipywidgets, and the pip installs. New file will contain only

dependencies:
  - python=3.11
  - pip
  - hdf5
  - ipywidgets
  - pip:
    - alpineer>=0.1.8
    - pyFlowSOM>=0.1.5
    - .[lab_ext]

To Reproduce Create ark_env and try to import visualize in any notebok.

srivarra commented 1 year ago

We can remove ipywidgets too.

camisowers commented 1 year ago

We can remove ipywidgets too.

Oh okay, it's not currently in the pyproject.toml dependencies so I can add it there if we remove it from environment.yml.

srivarra commented 1 year ago

Jupyter depends on it, so we don't need to explicitly add it as a dependency.