reymond-group / mhfp

Molecular MHFP fingerprints for cheminformatics applications
MIT License
84 stars 18 forks source link

overflow error #6

Open hokru opened 2 months ago

hokru commented 2 months ago

Hi,

When trying to run the example under Usage on a Linux machine with python3.9 (conda) i get

Traceback (most recent call last):
  File "/home/holger/Chembl_tmap/mhfp_test.py", line 5, in <module>
    fp_a = mhfp_encoder.encode('CCOC1=C(C=C(C=C1)S(=O)(=O)N(C)C)C2=NC(=O)C3=C(N2)C(=NN3C)C(C)(C)C')
  File "/home/holger/mambaforge/envs/tmap/lib/python3.9/site-packages/mhfp/encoder.py", line 78, in encode
    return self.from_molecular_shingling(
  File "/home/holger/mambaforge/envs/tmap/lib/python3.9/site-packages/mhfp/encoder.py", line 130, in from_molecular_shingling
    np.remainder(
OverflowError: Python integer 2305843009213693951 out of bounds for uint32

I believe it's from numpy=2.0.0 as numpy=1.26.4 does not show this. A workaround seems to be to declare np.uint64 in the np.remainder function.

JacksonBurns commented 2 months ago

I can confirm that I am also getting this error.