diff --git a/rmgpy/molecule/molecule.pxd b/rmgpy/molecule/molecule.pxd index 04aaefc3d2..0df48e717c 100644 --- a/rmgpy/molecule/molecule.pxd +++ b/rmgpy/molecule/molecule.pxd @@ -133,6 +133,10 @@ cdef class Molecule(Graph): cdef str _inchi cdef str _smiles + cpdef bint is_equal(self, Molecule other) + + cpdef bint is_same(self, other) + cpdef addAtom(self, Atom atom) cpdef addBond(self, Bond bond) diff --git a/rmgpy/molecule/molecule.py b/rmgpy/molecule/molecule.py index bd0a2881db..04c993409d 100644 --- a/rmgpy/molecule/molecule.py +++ b/rmgpy/molecule/molecule.py @@ -757,6 +757,15 @@ def is_equal(self,other): else: return self.isIsomorphic(other) + def is_same(self, other): + """ + Chemical identity comparison via InChI strings. + """ + if self.multiplicity == other.multiplicity and self.InChI == other.InChI: + return True + else: + return False + def __str__(self): """ Return a human-readable string representation of the object.