Skip to content

Commit a97ef74

Browse files
alongdamarkpayne
authored andcommitted
Modify O2 special case in MoleculeDrawer
1 parent 0f02a7c commit a97ef74

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rmgpy/molecule/draw.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454

5555
from rmgpy.qm.molecule import Geometry
5656
from rdkit.Chem import AllChem
57+
from rmgpy.molecule.molecule import Molecule
5758

5859
from numpy.linalg import LinAlgError
5960

@@ -216,7 +217,7 @@ def draw(self, molecule, format, target=None):
216217
self.molecule.removeAtom(self.molecule.atoms[-1])
217218
self.symbols = ['H2']
218219
self.coordinates = numpy.array([[0,0]], numpy.float64)
219-
elif self.symbols == ['O', 'O']:
220+
elif molecule.isIsomorphic(Molecule(SMILES='[O][O]')):
220221
# Render as O2 instead of O-O
221222
self.molecule.removeAtom(self.molecule.atoms[-1])
222223
self.molecule.atoms[0].radicalElectrons = 0

0 commit comments

Comments
 (0)