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

[BUG] New installs of PySCENIC will fail due to no longer supported np.object alias in current Numpy #477

Closed
pcm32 opened this issue May 23, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@pcm32
Copy link

pcm32 commented May 23, 2023

Describe the bug

Fresh installations over pip will fail because current version installed of numpy no longer supports:

.venv_pyscenic/lib/python3.11/site-packages/pyscenic/transform.py", line 42, in <module>
    ("Enrichment", COLUMN_NAME_ANNOTATION): np.object,
                                            ^^^^^^^^^
  File ".venv_pyscenic/lib/python3.11/site-packages/numpy/__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'object'.
`np.object` was a deprecated alias for the builtin `object`. To avoid this error in existing code, use `object` by itself. Doing this will not modify any behavior and is safe. 
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'object_'?

Mote that most errors are due to the input from the user, and therefore should be treated as questions in the Discussions. Please, only report them as bugs if you are quite certain that they are not behaving as expected.

This is not parameter depenedent, but a dependency issue.

Steps to reproduce the behavior

  1. Command run when the error occurred:
# in a fresh venv
pip install pyscenic
# run grn with some data from the cli
  1. Error encountered:
.venv_pyscenic/lib/python3.11/site-packages/pyscenic/transform.py:42: FutureWarning: In the future `np.object` will be defined as the corresponding NumPy scalar.
  ("Enrichment", COLUMN_NAME_ANNOTATION): np.object,
Traceback (most recent call last):
  File ".venv_pyscenic/bin/pyscenic", line 5, in <module>
    from pyscenic.cli.pyscenic import main
  File ".venv_pyscenic/lib/python3.11/site-packages/pyscenic/cli/pyscenic.py", line 26, in <module>
    from pyscenic.prune import _prepare_client, find_features, prune2df
  File ".venv_pyscenic/lib/python3.11/site-packages/pyscenic/prune.py", line 27, in <module>
    from .transform import (
  File ".venv_pyscenic/lib/python3.11/site-packages/pyscenic/transform.py", line 42, in <module>
    ("Enrichment", COLUMN_NAME_ANNOTATION): np.object,
                                            ^^^^^^^^^
  File ".venv_pyscenic/lib/python3.11/site-packages/numpy/__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'object'.
`np.object` was a deprecated alias for the builtin `object`. To avoid this error in existing code, use `object` by itself. Doing this will not modify any behavior and is safe. 
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'object_'?

Expected behavior

The command to run without complaining about the numpy issue.

Please complete the following information:

  • pySCENIC version: even -h throws the error, 0.12.1 I think
  • Installation method: pip
  • Run environment: bash and Jupyter
  • OS: macOS
  • Package versions: [obtain using pip freeze, conda list, or skip this if using Docker/Singularity]:
aiohttp==3.8.4
aiosignal==1.3.1
arboreto==0.1.6
async-timeout==4.0.2
attrs==23.1.0
bokeh==3.1.1
boltons==23.0.0
certifi==2023.5.7
charset-normalizer==3.1.0
click==8.1.3
cloudpickle==2.2.1
contourpy==1.0.7
ctxcore==0.2.0
cytoolz==0.12.1
dask==2023.5.0
dill==0.3.6
distributed==2023.5.0
frozendict==2.3.8
frozenlist==1.3.3
fsspec==2023.5.0
h5py==3.8.0
idna==3.4
importlib-metadata==6.6.0
interlap==0.2.7
Jinja2==3.1.2
joblib==1.2.0
llvmlite==0.40.0
locket==1.0.0
loompy==3.0.7
lz4==4.3.2
MarkupSafe==2.1.2
msgpack==1.0.5
multidict==6.0.4
multiprocessing-on-dill==3.5.0a4
networkx==3.1
numba==0.57.0
numexpr==2.8.4
numpy==1.24.3
numpy-groupies==0.9.22
packaging==23.1
pandas==2.0.1
partd==1.4.0
Pillow==9.5.0
psutil==5.9.5
pyarrow==12.0.0
pynndescent==0.5.10
pyscenic==0.12.1
python-dateutil==2.8.2
pytz==2023.3
PyYAML==6.0
requests==2.31.0
scikit-learn==1.2.2
scipy==1.10.1
six==1.16.0
sortedcontainers==2.4.0
tblib==1.7.0
threadpoolctl==3.1.0
toolz==0.12.0
tornado==6.3.2
tqdm==4.65.0
tzdata==2023.3
umap-learn==0.5.3
urllib3==2.0.2
xyzservices==2023.5.0
yarl==1.9.2
zict==3.0.0
zipp==3.15.0

Thanks!

@pcm32 pcm32 added the bug Something isn't working label May 23, 2023
@pcm32
Copy link
Author

pcm32 commented May 23, 2023

Pining to Numpy 1.23.5 seems to get rid of this, leaving me again in the dask issues, but that is a different story.

@wbrett87
Copy link

wbrett87 commented Jun 9, 2023

Had same issue, using numpy1.23.5 worked... Thanks!

@ghuls
Copy link
Member

ghuls commented Jun 13, 2023

Thanks for reporting this.

Solved in master:
eaf23eb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants