michaelkyu / MobMess

GNU General Public License v3.0
17 stars 2 forks source link

np.int has been deprecated #5

Open natacha-couto opened 6 months ago

natacha-couto commented 6 months ago

Hi, I've been trying to run mobmess on a set of plasmids. I've followed your installation manual, but I've come across the following error:

Traceback (most recent call last): File "/well/aanensen/users/fzv779/conda/skylake/envs/mobmess/bin/mobmess", line 8, in sys.exit(run()) File "/well/aanensen/users/fzv779/conda/skylake/envs/mobmess/lib/python3.10/site-packages/mobmess/mobmess_script.py", line 239, in run args.func(args) File "/well/aanensen/users/fzv779/conda/skylake/envs/mobmess/lib/python3.10/site-packages/mobmess/mobmess_script.py", line 90, in infer_systems ani_utils.derep_sources(similarities, similarity_threshold, min_alignment_fraction, File "/well/aanensen/users/fzv779/conda/skylake/envs/mobmess/lib/python3.10/site-packages/mobmess/ani_utils.py", line 301, in derep_sources clusters_degrees = pd.Series(utils.as_flat(utils.sp_mask(sp.astype(np.int), blocks=clusters).T.dot(np.ones(sp.shape[0], dtype=np.int))), rownames) File "/well/aanensen/users/fzv779/conda/skylake/envs/mobmess/lib/python3.10/site-packages/numpy/init.py", line 319, 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. Did you mean: 'inf'?

JiabaoYuuuuu commented 4 months ago

Hi Natacha, I also encountered the same problem. How did you solve it? Replace all "np.int" with "int"?

JiabaoYuuuuu commented 4 months ago

Hi natacha, After I replaced" np.int" with "int" "np.bool_" with "bool", mobmess is running successfully

LauraMews commented 4 months ago

Hey, I have the same issue, but when I replace "np.int" with "int" I get the error: .conda/envs/mobmess/lib/python3.10/site-packages/mobmess/ani_utils.py", line 814, in **{k : int32 for k in ['query_start', 'query_end', 'ref_start', 'ref_end', 'errors', 'mismatches', 'nonalpha', 'query_len', 'ref_len']}})
NameError: name 'int32' is not defined Did you also encounter that or just changed the whole thing for int32 and int64 to something else?