Skip to content

Atom ordering by xyz is buggy #209

@alongd

Description

@alongd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions