Skip to content

error running README example #10

@XZhang-ML

Description

@XZhang-ML

Hey, I would like to try the drfp feature but after pip installed it:

pip install drfp

and run the example from README:

from drfp import DrfpEncoder

rxn_smiles = [
    "CO.O[C@@H]1CCNC1.[C-]#[N+]CC(=O)OC>>[C-]#[N+]CC(=O)N1CC[C@@H](O)C1",
    "CCOC(=O)C(CC)c1cccnc1.Cl.O>>CCC(C(=O)O)c1cccnc1",
]

fps = DrfpEncoder.encode(rxn_smiles)

I ran into the numpy error shown below:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/xxx/Library/Caches/pypoetry/virtualenvs/py3.10/lib/python3.10/site-packages/drfp/fingerprint.py", line 342, in encode
    hashed_diff, smiles_diff = DrfpEncoder.internal_encode(
  File "/Users/xxx/Library/Caches/pypoetry/virtualenvs/py3.10/lib/python3.10/site-packages/drfp/fingerprint.py", line 243, in internal_encode
    return DrfpEncoder.hash(list(s)), list(s)
  File "/Users/xxx/Library/Caches/pypoetry/virtualenvs/py3.10/lib/python3.10/site-packages/drfp/fingerprint.py", line 261, in hash
    return np.array(hash_values, dtype=np.int32)
OverflowError: Python integer 2325499645 out of bounds for int32

Here is my pkg versions:

>>> import numpy
>>> numpy.__version__
'2.2.3'
>>> import rdkit
>>> rdkit.__version__
'2024.09.5'
>>> import drfp
>>> drfp.__version__
'0.3.6'

Would really appreciate your help here!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions