You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from epistasis.models import EpistasisLinearRegression
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[84], line 2
1 from gpmap import GenotypePhenotypeMap
----> 2 from epistasis.models import EpistasisLinearRegression
File [~/miniconda3/envs/epistasis/lib/python3.10/site-packages/epistasis/models/__init__.py:6](http://localhost:8888/home/marco/miniconda3/envs/epistasis/lib/python3.10/site-packages/epistasis/models/__init__.py#line=5)
1 """
2 A library of models to decompose high-order epistasis in genotype-phenotype
3 maps.
4 """
5 # Import linear models
----> 6 from .linear import (EpistasisLinearRegression,
7 EpistasisLasso,
8 EpistasisRidge,
9 EpistasisElasticNet)
11 # Import nonlinear models
12 from .nonlinear import (EpistasisNonlinearRegression,
13 EpistasisPowerTransform,
14 EpistasisSpline)
File [~/miniconda3/envs/epistasis/lib/python3.10/site-packages/epistasis/models/linear/__init__.py:1](http://localhost:8888/home/marco/miniconda3/envs/epistasis/lib/python3.10/site-packages/epistasis/models/linear/__init__.py#line=0)
----> 1 from .ordinary import EpistasisLinearRegression
2 from .lasso import EpistasisLasso
3 from .ridge import EpistasisRidge
File [~/miniconda3/envs/epistasis/lib/python3.10/site-packages/epistasis/models/linear/ordinary.py:4](http://localhost:8888/home/marco/miniconda3/envs/epistasis/lib/python3.10/site-packages/epistasis/models/linear/ordinary.py#line=3)
1 import numpy as np
2 from sklearn.linear_model import LinearRegression
----> 4 from ..base import BaseModel, use_sklearn
5 from ..utils import arghandler
7 # Suppress an annoying error from scikit-learn
File [~/miniconda3/envs/epistasis/lib/python3.10/site-packages/epistasis/models/base.py:14](http://localhost:8888/home/marco/miniconda3/envs/epistasis/lib/python3.10/site-packages/epistasis/models/base.py#line=13)
12 # Local imports
13 from epistasis.mapping import EpistasisMap, encoding_to_sites
---> 14 from epistasis.matrix import get_model_matrix
15 from epistasis.utils import (extract_mutations_from_genotypes,
16 genotypes_to_X)
17 from .utils import XMatrixException
File [~/miniconda3/envs/epistasis/lib/python3.10/site-packages/epistasis/matrix.py:6](http://localhost:8888/home/marco/miniconda3/envs/epistasis/lib/python3.10/site-packages/epistasis/matrix.py#line=5)
4 # Try importing model matrix builder from cython extension for speed up.
5 try:
----> 6 from .matrix_cython import build_model_matrix
8 except ImportError:
10 import warnings as _warnings
File matrix_cython.pyx:3, in init epistasis.matrix_cython()
File [~/.local/lib/python3.10/site-packages/numpy/__init__.py:324](http://localhost:8888/home/marco/.local/lib/python3.10/site-packages/numpy/__init__.py#line=323), in __getattr__(attr)
319 warnings.warn(
320 f"In the future `np.{attr}` will be defined as the "
321 "corresponding NumPy scalar.", FutureWarning, stacklevel=2)
323 if attr in __former_attrs__:
--> 324 raise AttributeError(__former_attrs__[attr])
326 if attr == 'testing':
327 import numpy.testing as testing
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
I would assume that the cython module needs to be modified to pick a specific int type. I tried the command in a conda environment with numpy version < 1.20 and it worked fine.
The text was updated successfully, but these errors were encountered:
The following import causes an
AttributeError
:I would assume that the cython module needs to be modified to pick a specific
int
type. I tried the command in a conda environment with numpy version < 1.20 and it worked fine.The text was updated successfully, but these errors were encountered: