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

Fix dependencies and require numpy>=1.21 #30

Merged
merged 1 commit into from
Sep 6, 2023
Merged

Fix dependencies and require numpy>=1.21 #30

merged 1 commit into from
Sep 6, 2023

Conversation

miltondp
Copy link
Member

@miltondp miltondp commented Sep 1, 2023

This fixes issue #28 by explicitely requiring numpy>=1.21.0

Steps to reproduce issue #28

This installs ccc-coef version 0.1.6)

conda create -n ccc-fix-issue-28 python=3 numpy=1.20 numba=0.53 scipy=1.7
conda activate ccc-fix-issue-28
pip install ccc-coef

# try to import ccc function
python -c "from ccc.coef import ccc"

This should produce this error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/miltondp/software/miniconda3/envs/ccc-fix-issue-28/lib/python3.9/site-packages/ccc/coef/__init__.py", line 1, in <module>
    from ccc.coef.impl import *  # noqa: F403, F401
  File "/home/miltondp/software/miniconda3/envs/ccc-fix-issue-28/lib/python3.9/site-packages/ccc/coef/impl.py", line 9, in <module>
    from numpy.typing import NDArray
ImportError: cannot import name 'NDArray' from 'numpy.typing' (/home/miltondp/software/miniconda3/envs/ccc-fix-issue-28/lib/python3.9/site-packages/numpy/typing/__init__.py)

Steps to fix by installing numpy>=1.21

conda create -n ccc-fix-issue-28-2 python=3 numpy=1.21 numba=0.53 scipy=1.7
conda activate ccc-fix-issue-28-2
pip install ccc-coef

# try to import ccc function
python -c "from ccc.coef import ccc"

No error should appear.

Steps to test new version

# get latest code
git clone -b fix.issue.28 [email protected]:greenelab/ccc.git

# here I force to use an old version of nuompy
conda create -n ccc-fix-issue-28-3 python=3 numpy=1.20 numba=0.53 scipy=1.7
conda activate ccc-fix-issue-28-3
cd ccc/
pip install -e .

# try to import ccc function
python -c "from ccc.coef import ccc"

No error should appear.

@codecov-commenter
Copy link

Codecov Report

Patch coverage is 100.00% of modified lines.

Files Changed Coverage
libs/ccc/__init__.py 100.00%

📢 Thoughts on this report? Let us know!.

@miltondp miltondp marked this pull request as ready for review September 1, 2023 17:00
@miltondp miltondp linked an issue Sep 5, 2023 that may be closed by this pull request
@miltondp miltondp merged commit 050cae8 into main Sep 6, 2023
9 checks passed
@miltondp miltondp deleted the fix.issue.28 branch September 6, 2023 17:02
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

Successfully merging this pull request may close these issues.

CCC requires numpy >= 1.21
2 participants