Skip to content

Commit

Permalink
Fix import for rdkit Chem module
Browse files Browse the repository at this point in the history
  • Loading branch information
tjkessler committed Feb 13, 2025
1 parent c1d0091 commit b0566de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion graphchem/preprocessing/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import numpy as np
import rdkit
from rdkit import Chem
import torch


Expand Down Expand Up @@ -221,7 +222,7 @@ def __init__(self, smiles: List[str]):
ValueError
If any provided SMILES string cannot be parsed by RDKit.
"""
mols = [rdkit.Chem.MolFromSmiles(smi) for smi in smiles]
mols = [Chem.MolFromSmiles(smi) for smi in smiles]
for idx, mol in enumerate(mols):
if mol is None:
raise ValueError(f"Unable to parse SMILES: {smiles[idx]}")
Expand Down

0 comments on commit b0566de

Please sign in to comment.