bittremieux / falcon

Large-scale tandem mass spectrum clustering using fast nearest neighbor searching.
BSD 3-Clause "New" or "Revised" License
24 stars 7 forks source link

np.object has been deprecated #23

Open bittremieux opened 1 year ago

bittremieux commented 1 year ago

NumPy 1.24.4 results in the following error:

2023-07-12 15:21:00,375 WARNING [py.warnings/MainProcess] warnings._showwarnmsg : /home/wout/.conda/envs/falcon/lib/python3.11/site-packages/falcon/cluster/cluster.py:509: FutureWarning: In the future `np.object` will be defined as the corresponding NumPy scalar.
neighborhoods_arr = np.empty(len(neighborhoods), dtype=np.object)

Traceback (most recent call last):
File "/home/wout/.conda/envs/falcon/bin/falcon", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/wout/.conda/envs/falcon/lib/python3.11/site-packages/falcon/falcon.py", line 181, in main
clusters = cluster.generate_clusters(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/wout/.conda/envs/falcon/lib/python3.11/site-packages/falcon/cluster/cluster.py", line 509, in generate_clusters
neighborhoods_arr = np.empty(len(neighborhoods), dtype=np.object)
^^^^^^^^^
File "/home/wout/.conda/envs/falcon/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_'?

This can be fixed by changing np.object to object here