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

numpy 1.24 no attribute int #38

Closed
jowodo opened this issue Apr 7, 2023 · 2 comments
Closed

numpy 1.24 no attribute int #38

jowodo opened this issue Apr 7, 2023 · 2 comments

Comments

@jowodo
Copy link
Contributor

jowodo commented Apr 7, 2023

model-angelo version: 0.2.3

When executing the help command I get the following error. This only happens with numpy 1.24. When downgrading to numpy 1.19 another error appears. I could circumvent this error by appending a restriction of numpy to the requirements file:

echo -e "\nnumpy<1.24" >> requirements.txt

While this resolved the issue for me, I think this is rather a quick dirty fix than a sustainable solution of the problem.
Error:

$ model_angelo build --help
Traceback (most recent call last):
  File "/home/apps/conda/miniconda3/envs/modelangelo-0.2.3/bin/model_angelo", line 33, in <module>
    sys.exit(load_entry_point('model-angelo==0.2.3', 'console_scripts', 'model_angelo')())
  File "/home/apps/conda/miniconda3/envs/modelangelo-0.2.3/lib/python3.9/site-packages/model_angelo-0.2.3-py3.9.egg/model_angelo/__main__.py", line 23, in main
    import model_angelo.apps.build
  File "/home/apps/conda/miniconda3/envs/modelangelo-0.2.3/lib/python3.9/site-packages/model_angelo-0.2.3-py3.9.egg/model_angelo/apps/build.py", line 19, in <module>
    from model_angelo.c_alpha.inference import infer as c_alpha_infer
  File "/home/apps/conda/miniconda3/envs/modelangelo-0.2.3/lib/python3.9/site-packages/model_angelo-0.2.3-py3.9.egg/model_angelo/c_alpha/inference.py", line 14, in <module>
    from model_angelo.data.dataset_preprocess import decompress_data
  File "/home/apps/conda/miniconda3/envs/modelangelo-0.2.3/lib/python3.9/site-packages/model_angelo-0.2.3-py3.9.egg/model_angelo/data/dataset_preprocess.py", line 14, in <module>
    from model_angelo.utils.fasta_utils import read_fasta
  File "/home/apps/conda/miniconda3/envs/modelangelo-0.2.3/lib/python3.9/site-packages/model_angelo-0.2.3-py3.9.egg/model_angelo/utils/fasta_utils.py", line 10, in <module>
    from model_angelo.utils.residue_constants import index_to_restype_1
  File "/home/apps/conda/miniconda3/envs/modelangelo-0.2.3/lib/python3.9/site-packages/model_angelo-0.2.3-py3.9.egg/model_angelo/utils/residue_constants.py", line 1094, in <module>
    restype_atom37_to_rigid_group = np.zeros([21, 37], dtype=np.int)
  File "/home/apps/conda/miniconda3/envs/modelangelo-0.2.3/lib/python3.9/site-packages/numpy/__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'int'.
`np.int` was a deprecated alias for the builtin `int`. To avoid this error in existing code, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
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
@jamaliki
Copy link
Collaborator

jamaliki commented Apr 8, 2023

Hi,
Yes, you are correct. I fixed this now.
Best,
Kiarash.

@jowodo
Copy link
Contributor Author

jowodo commented Apr 12, 2023

Thanks for the quick fix. I tested it and it works now!

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

2 participants