Skip to content

Commit

Permalink
fixes issue #301
Browse files Browse the repository at this point in the history
make importing non-tetrahedral stereo optional

this will mean that SMC that contain non-tetrahedral stereochemistry cannot be reloaded in an old rdkit version

this is seen as unlikely and less annoying than imposing a pin on the rdkit version
  • Loading branch information
richardjgowers committed Jun 2, 2023
1 parent b9f76f3 commit b6eeafb
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions gufe/components/smallmoleculecomponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,16 @@
1: Chem.rdchem.ChiralType.CHI_TETRAHEDRAL_CW,
2: Chem.rdchem.ChiralType.CHI_TETRAHEDRAL_CCW,
3: Chem.rdchem.ChiralType.CHI_OTHER,
4: Chem.rdchem.ChiralType.CHI_TETRAHEDRAL,
5: Chem.rdchem.ChiralType.CHI_ALLENE,
6: Chem.rdchem.ChiralType.CHI_SQUAREPLANAR,
7: Chem.rdchem.ChiralType.CHI_TRIGONALBIPYRAMIDAL,
8: Chem.rdchem.ChiralType.CHI_OCTAHEDRAL}
}
# support for non-tetrahedral stereo requires rdkit 2022.09.1+
if hasattr(Chem.rdchem.ChiralType, 'CHI_TETRAHEDRAL'):
_INT_TO_ATOMCHIRAL.update({
4: Chem.rdchem.ChiralType.CHI_TETRAHEDRAL,
5: Chem.rdchem.ChiralType.CHI_ALLENE,
6: Chem.rdchem.ChiralType.CHI_SQUAREPLANAR,
7: Chem.rdchem.ChiralType.CHI_TRIGONALBIPYRAMIDAL,
8: Chem.rdchem.ChiralType.CHI_OCTAHEDRAL,
})
_ATOMCHIRAL_TO_INT = {v: k for k, v in _INT_TO_ATOMCHIRAL.items()}


Expand Down

0 comments on commit b6eeafb

Please sign in to comment.