Skip to content

Commit a953e1e

Browse files
committed
When checking isomorphism of Molecules, also check the initial map
This fixes the recently added failing isomorphism check. If you pass in a mapping, it is checked for validity. Note that this is not done at the Graph level or VF2, only at the Molecule level. I.e. this bug probably still exists for Graph and maybe Group objects.
1 parent 433edbd commit a953e1e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rmgpy/molecule/molecule.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,6 +1450,11 @@ def is_isomorphic(self, other, initial_map=None, generate_initial_map=False, sav
14501450
# check multiplicity
14511451
if self.multiplicity != other.multiplicity:
14521452
return False
1453+
1454+
# if given an initial map, ensure that it's valid.
1455+
if initial_map:
1456+
if not self.is_mapping_valid(other, initial_map, equivalent=True):
1457+
return False
14531458

14541459
if generate_initial_map:
14551460
initial_map = dict()

0 commit comments

Comments
 (0)