Skip to content

Commit

Permalink
Update src/chemenv/tools/cheminformatics.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MrtinoRG authored Feb 17, 2025
1 parent f8fd4c8 commit 456d484
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/chemenv/tools/cheminformatics.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def _get_number_atoms(smiles: str) -> int:
mol = Chem.MolFromSmiles(smiles)
if mol is None:
raise ValueError("Invalid SMILES string")
mol = Chem.AddHs(mol)
return mol.GetNumAtoms()
except Exception as e:
raise ValueError(f"Invalid SMILES string: {e}")
Expand Down

0 comments on commit 456d484

Please sign in to comment.