mordred-descriptor / mordred

a molecular descriptor calculator
http://mordred-descriptor.github.io/documentation/master/
BSD 3-Clause "New" or "Revised" License
355 stars 95 forks source link

descriptor calculation error module 'numpy' has no attribute 'float' #107

Open abckit opened 1 year ago

abckit commented 1 year ago

Description: I tried to run an example from the mordred documentation page but got into error showing "module 'numpy' has no attribute 'float'."

code: from rdkit import Chem from mordred import Calculator, descriptors

calc = Calculator(descriptors, ignore_3D=True) len(calc.descriptors) len(Calculator(descriptors, ignore_3D=True, version="1.0.0")) mol = Chem.MolFromSmiles('c1ccccc1') abc=calc(mol) print(abc[0].error)

output: module 'numpy' has no attribute 'float'. np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here. 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

my environment: python --version Python 3.11.3

numpy 1.24.3

I am not sure if i have mistake somewhere and i am new to mordred. Would appreciate any comments or suggestions.

Rgds Kit

ajaymur91 commented 1 year ago

Numpy < 1.20 should work I think. Installing using conda will probably pickup the correct numpy dependency.

lvotapka commented 5 months ago

Using the community version of Mordred fixed this issue for me mordred-community and can be installed from PyPI: pip install mordredcommunity