aertslab / scenicplus

SCENIC+ is a python package to build gene regulatory networks (GRNs) using combined or separate single-cell gene expression (scRNA-seq) and single-cell chromatin accessibility (scATAC-seq) data.
Other
177 stars 28 forks source link

The version of dask may need to be updated to be compatible with python 3.11.9. #386

Open WhenMelancholy opened 4 months ago

WhenMelancholy commented 4 months ago

Describe the bug While using the snakemake pipeline to process the example data, I encountered the following error ( I only took the the last section since the call stack is very deep)

    from dask.dataframe import methods                                                                                                                                       [90/1631]
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/site-packages/dask/dataframe/methods.py", line 34, in <module>                                                           
    from dask.dataframe.utils import is_dataframe_like, is_index_like, is_series_like                                                                                                 
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/site-packages/dask/dataframe/utils.py", line 20, in <module>                                                             
    from dask.dataframe import (  # noqa: F401 register pandas extension types                                                                                                        
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/site-packages/dask/dataframe/_dtypes.py", line 9, in <module>                                                            
    from dask.dataframe.extensions import make_array_nonempty, make_scalar                                                                                                            
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/site-packages/dask/dataframe/extensions.py", line 8, in <module>
    from dask.dataframe.accessor import (
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/site-packages/dask/dataframe/accessor.py", line 126, in <module>
    class DatetimeAccessor(Accessor):
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/site-packages/dask/dataframe/accessor.py", line 81, in __init_subclass__
    _bind_property(cls, pd_cls, attr, min_version)
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/site-packages/dask/dataframe/accessor.py", line 35, in _bind_property
    setattr(cls, attr, property(derived_from(pd_cls, version=min_version)(func)))
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/site-packages/dask/utils.py", line 987, in wrapper
    method.__doc__ = _derived_from(
                     ^^^^^^^^^^^^^^
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/site-packages/dask/utils.py", line 940, in _derived_from
    method_args = get_named_args(method)
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/site-packages/dask/utils.py", line 701, in get_named_args
    s = inspect.signature(func)
        ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/inspect.py", line 3263, in signature
    return Signature.from_callable(obj, follow_wrapped=follow_wrapped,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/inspect.py", line 3011, in from_callable
    return _signature_from_callable(obj, sigcls=cls,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/inspect.py", line 2599, in _signature_from_callable
    call = _descriptor_get(call, obj)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/inspect.py", line 2432, in _descriptor_get
    return get(descriptor, obj, type(obj))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: descriptor '__call__' for 'type' objects doesn't apply to a 'property' object
"""

To Reproduce Processing sample data using the snakemake pipeline.

Error output See the Describe the bug section.

Expected behavior No ValueError should be throwed.

Screenshots N/A

Version (please complete the following information):

Additional context According to my investigation, this is due to an incompatibility between the dask and python versions. the version of dask used by scenicplus is incompatible with python 3.11.9 (issue here), but 3.11.9 is the latest python 3.11 release, which is used when creating conda environments as described in the README. So the dask version may need to be updated?

After updating the version of dask to 2024.05, this problem got solved.

Richardosgrapevine commented 4 months ago

Thanks a lot! Solved my issue. Note that if using mamba or conda to update dask, I think it will automatically update pandas version. While scenicplus requires pandas=1.5.0, better use pip install dask[array,complete,dataframe,diagnostics,distributed]==2024.5.0 to avoid other conflicts. Ignore the pip install error, the scenicplus could run properly.

JABioinf commented 1 month ago

Hi. In my case, got the same error and I tried the pip install inside a conda environment as suggested by @Richardosgrapevine , but it did proceed to update pandas to 2.2.2, which then created error in the scenicplus pipeline of course. I haven't figured out how to reverse it or make everything correct (due to pin-1 requiring python 3.11.* while pandas 1.5.0, doesn't).

Edit: got it to work using the following install if that can help someone, including java for mallet and jupyterlab, with dask version 2024.4.1: ` conda activate scenicplus

pip install .

conda install jupyter jupyterlab

conda install conda-forge::openjdk

pip install dask==2024.4.1 `