Skip to content

Commit

Permalink
Tests: Triplet S2 and O2 perception in species mol_from_xyz()
Browse files Browse the repository at this point in the history
  • Loading branch information
alongd committed Dec 7, 2024
1 parent e25b80e commit 92bbc31
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions arc/species/species_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1686,6 +1686,24 @@ def test_mol_from_xyz(self):
so2.mol_from_xyz(xyz=so2_t_xyz, get_cheap=False)
self.assertEqual([atom.element.symbol for atom in so2.mol.atoms], ['S', 'O', 'O'])

# S2
s2_xyz = """S 0.0000000 0.0000000 0.9547220
S 0.0000000 0.0000000 -0.9547220"""
s2 = ARCSpecies(label='S2', smiles='[S][S]')
self.assertEqual(s2.multiplicity, 3)
self.assertEqual(s2.charge, 0)
s2.mol_from_xyz(xyz=str_to_xyz(s2_xyz), get_cheap=False)
self.assertEqual([atom.element.symbol for atom in s2.mol.atoms], ['S', 'S'])
self.assertEqual(s2.mol.to_smiles(), '[S][S]')
self.assertEqual(s2.mol.multiplicity, 3)

# O2
o2_xyz = {'symbols': ('O', 'O'), 'isotopes': (16, 16), 'coords': ((0.0, 0.0, 0.6029), (0.0, 0.0, -0.6029))}
o2 = ARCSpecies(label='O2aa', xyz=o2_xyz, multiplicity=3)
self.assertEqual(o2.multiplicity, 3)
self.assertEqual(o2.mol.multiplicity, 3)
self.assertEqual(o2.mol.to_smiles(), '[O][O]')

def test_consistent_atom_order(self):
"""Test that the atom order is preserved whether starting from SMILES or from xyz"""
xyz9 = """O -1.17310019 -0.30822930 0.16269772
Expand Down

0 comments on commit 92bbc31

Please sign in to comment.