ReactionMechanismGenerator / ARC

ARC - Automatic Rate Calculator
https://reactionmechanismgenerator.github.io/ARC/index.html
MIT License
43 stars 21 forks source link

Atom ordering by xyz is buggy #209

Closed alongd closed 4 years ago

alongd commented 4 years ago

The following code does not yield a molecule with the same atom order as the xyz:

xyz5 = str_to_xyz(""" C                  1.50048866   -0.50848248   -0.64006761
F                  0.27568368    0.01156702   -0.41224910
Cl                 3.09727149   -1.18647281   -0.93707550
O                  1.93561914    0.74741610   -1.16759033
O                  2.33727805    1.90670710   -1.65453438
H                  3.25580294    1.83954553   -1.92546105""")

spc5 = ARCSpecies(label='chiralOOH', smiles='OO[C](F)Cl', xyz=xyz5)
for atom, symbol in zip(spc5.mol.atoms, xyz5['symbols']):
    self.assertEqual(atom.symbol, symbol)

The problem is in converter.molecules_from_xyz(), and specifically in converter.order_atoms() where the if mol_is_iso_copy.is_isomorphic(ref_mol_is_iso_copy, save_order=True, strict=False): check gives False: One mol has the radical, the other doesn't.

alongd commented 4 years ago

solved by https://github.com/ReactionMechanismGenerator/RMG-Py/pull/1741