Skip to content

Commit

Permalink
Fix failures due to undefined stereochemistry
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonBoothroyd committed Dec 1, 2024
1 parent ede08ca commit ab8e8fe
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions absolv/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def _approximate_box_size_by_density(
"""

molecules = {
smiles: openff.toolkit.Molecule.from_smiles(smiles)
smiles: openff.toolkit.Molecule.from_smiles(smiles, allow_undefined_stereo=True)
for smiles in {smiles for smiles, _ in components}
}

Expand Down Expand Up @@ -102,9 +102,13 @@ def _molecule_from_smiles(smiles: str) -> openff.toolkit.Molecule:
"""Create a molecule from a SMILES string."""

try:
molecule = openff.toolkit.Molecule.from_mapped_smiles(smiles)
molecule = openff.toolkit.Molecule.from_mapped_smiles(
smiles, allow_undefined_stereo=True
)
except (openff.toolkit.utils.exceptions.SmilesParsingError, ValueError):
molecule = openff.toolkit.Molecule.from_smiles(smiles)
molecule = openff.toolkit.Molecule.from_smiles(
smiles, allow_undefined_stereo=True
)

return molecule

Expand Down

0 comments on commit ab8e8fe

Please sign in to comment.