Skip to content

Commit 5b644b8

Browse files
committed
Tests: Adaptations to reaction tests
and minor modifications
1 parent 6acd290 commit 5b644b8

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

arc/reaction_test.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def setUpClass(cls):
3535
"""
3636
cls.maxDiff = None
3737
cls.rmgdb = rmgdb.make_rmg_database_object()
38-
cls.rmgdb.kinetics.families = None
38+
# cls.rmgdb.kinetics.families = None
3939
rmgdb.load_families_only(cls.rmgdb, "all")
4040

4141
cls.h2_xyz = {'coords': ((0, 0, 0.3736550), (0, 0, -0.3736550)), 'isotopes': (1, 1), 'symbols': ('H', 'H')}
@@ -673,7 +673,6 @@ def test_get_number_of_atoms_in_reaction_zone(self):
673673

674674
def test_get_atom_map(self):
675675
"""Test getting an atom map for a reaction"""
676-
677676
# 1. trivial unimolecular: H2O <=> H2O
678677
h2o_xyz_1 = {'symbols': ('O', 'H', 'H'), 'isotopes': (16, 1, 1),
679678
'coords': ((-0.0003283189391273643, 0.39781490416473486, 0.0),
@@ -1215,11 +1214,13 @@ def test_get_atom_map(self):
12151214
p_1 = ARCSpecies(label='C2H5ONO', smiles='CCON=O', xyz=c7h5o_xyz)
12161215
rxn = ARCReaction(reactants=['C2H5NO2'], products=['C2H5ONO'],
12171216
r_species=[r_1], p_species=[p_1])
1218-
self.assertEqual(rxn.atom_map, [4, 3, 2, 1, 0, 8, 9, 6, 5, 7])
1217+
self.assertIn(rxn.atom_map[0], [2, 4])
1218+
self.assertEqual(rxn.atom_map[1], 3)
1219+
self.assertIn(rxn.atom_map[2], [2, 4])
1220+
self.assertEqual(rxn.atom_map[3:], [1, 0, 8, 9, 6, 5, 7])
12191221
self.assertTrue(check_atom_map(rxn))
12201222

12211223
# 1,2-Birad_to_alkene: SO2(T) => SO2(S)
1222-
# This test fails due to a problem in xyz perception of SO2(T).
12231224
so2_t_xyz = {'coords': ((0.02724478716956233, 0.6093829407458188, 0.0),
12241225
(-1.3946381818031768, -0.24294788636871906, 0.0),
12251226
(1.3673933946336125, -0.36643505437710233, 0.0)),
@@ -1234,6 +1235,7 @@ def test_get_atom_map(self):
12341235
rxn = ARCReaction(reactants=['SO2(T)'], products=['SO2(S)'], r_species=[r_1], p_species=[p_1])
12351236
self.assertEqual(rxn.atom_map[0], 1)
12361237
self.assertTrue(check_atom_map(rxn))
1238+
12371239
# F[C]F + [CH3] <=> F[C](F)C
12381240
r1_xyz = {'symbols': ('F', 'C', 'F'),
12391241
'isotopes': (19, 12, 19),
@@ -1393,6 +1395,7 @@ def test_get_atom_map(self):
13931395
self.assertTrue(check_atom_map(rxn_rev))
13941396

13951397
# Diels_alder_addition: C5H8 + C6H10 <=> C11H18
1398+
# This test takes ~20 min, we should see how to make the code more efficient
13961399
c5h8_xyz = {'coords': ((2.388426506127341, -0.6020682478448856, -0.8986239521455471),
13971400
(1.396815470095451, 0.2559764141247285, -0.632876393172657),
13981401
(0.15313289103802616, -0.14573699483201027, -0.021031021618524288),
@@ -1592,7 +1595,7 @@ def test_get_atom_map(self):
15921595
self.assertIn(tuple(atom_map[3:5]+[atom_map[-1]]), permutations([3, 4, 5]))
15931596
self.assertEqual(atom_map[5], 6)
15941597

1595-
# Same species in products
1598+
# Same species in products
15961599
rxn = ARCReaction(r_species=[ARCSpecies(label="r", smiles = 'C=C[CH]CC[CH]C=C')],
15971600
p_species=[ARCSpecies(label="p1", smiles= 'C=CC=C'),
15981601
ARCSpecies(label="p2", smiles= 'C=CC=C')])

0 commit comments

Comments
 (0)