Skip to content

Commit

Permalink
fixed regression in smiles generation
Browse files Browse the repository at this point in the history
  • Loading branch information
stsouko committed Jan 30, 2021
1 parent fdb814f commit 1aa887b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions CGRtools/algorithms/stereo.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,8 +715,10 @@ def _chiral_allenes(self) -> Set[int]:
return self.__chiral_centers[2]

@property
def _chiral_morgan(self) -> Dict[int, int]:
return self.__chiral_centers[3]
def _chiral_morgan(self: Union['MoleculeContainer', 'MoleculeStereo']) -> Dict[int, int]:
if self._atoms_stereo or self._allenes_stereo or self._cis_trans_stereo:
return self.__chiral_centers[3]
return self.atoms_order

@cached_property
def _stereo_axises(self: 'MoleculeContainer') -> Tuple[Tuple[Tuple[int, ...], ...], Tuple[Tuple[int, ...], ...]]:
Expand Down Expand Up @@ -857,7 +859,7 @@ def __stereo_axises(self: 'MoleculeContainer'):
return axises

@cached_property
def __chiral_centers(self: 'MoleculeContainer'):
def __chiral_centers(self: Union['MoleculeContainer', 'MoleculeStereo']):
atoms_stereo = self._atoms_stereo
cis_trans_stereo = self._cis_trans_stereo
allenes_stereo = self._allenes_stereo
Expand Down

0 comments on commit 1aa887b

Please sign in to comment.