From c3d61c3e22b3933f6894056b127bc1d4239b261e Mon Sep 17 00:00:00 2001 From: Alon Grinberg Dana Date: Sun, 14 May 2023 16:57:57 +0300 Subject: [PATCH] Tests: adjlist in Species dict --- arc/reaction_test.py | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/arc/reaction_test.py b/arc/reaction_test.py index 2d2d624220..4457cbf2d0 100644 --- a/arc/reaction_test.py +++ b/arc/reaction_test.py @@ -121,20 +121,22 @@ def setUpClass(cls): r_species=[ARCSpecies(label='NH2', smiles='[NH2]'), ARCSpecies(label='N2H3', smiles='N[NH]')], p_species=[ARCSpecies(label='NH3', smiles='N'), - ARCSpecies(label='H2NN(S)', adjlist="""multiplicity 1 - 1 N u0 p0 c+1 {2,D} {3,S} {4,S} - 2 N u0 p2 c-1 {1,D} - 3 H u0 p0 c0 {1,S} - 4 H u0 p0 c0 {1,S}""")]) + ARCSpecies(label='H2NN(S)', + adjlist="""multiplicity 1 +1 N u0 p0 c+1 {2,D} {3,S} {4,S} +2 N u0 p2 c-1 {1,D} +3 H u0 p0 c0 {1,S} +4 H u0 p0 c0 {1,S}""")]) cls.rxn7 = ARCReaction(reactants=['NH2', 'N2H3'], products=['NH3', 'H2NN(T)'], r_species=[ARCSpecies(label='NH2', smiles='[NH2]'), ARCSpecies(label='N2H3', smiles='N[NH]')], p_species=[ARCSpecies(label='NH3', smiles='N'), - ARCSpecies(label='H2NN(T)', adjlist="""multiplicity 3 - 1 N u0 p1 c0 {2,S} {3,S} {4,S} - 2 N u2 p1 c0 {1,S} - 3 H u0 p0 c0 {1,S} - 4 H u0 p0 c0 {1,S}""")]) + ARCSpecies(label='H2NN(T)', + adjlist="""multiplicity 3 +1 N u0 p1 c0 {2,S} {3,S} {4,S} +2 N u2 p1 c0 {1,S} +3 H u0 p0 c0 {1,S} +4 H u0 p0 c0 {1,S}""")]) cls.rxn8 = ARCReaction(r_species=[ARCSpecies(label='CH4', smiles='C', xyz=cls.ch4_xyz), ARCSpecies(label='OH', smiles='[OH]', xyz=cls.oh_xyz)], p_species=[ARCSpecies(label='CH3', smiles='[CH3]', xyz=cls.ch3_xyz), @@ -278,6 +280,11 @@ def test_as_dict(self): 'multiplicity': 1, 'number_of_rotors': 0}, {'arkane_file': None, + 'adjlist': """multiplicity 1 +1 N u0 p0 c+1 {2,D} {3,S} {4,S} +2 N u0 p2 c-1 {1,D} +3 H u0 p0 c0 {1,S} +4 H u0 p0 c0 {1,S}""", 'bond_corrections': {'H-N': 2, 'N=N': 1}, 'charge': 0, 'cheap_conformer': 'N -0.08201544 0.01567102 0.28740725\n' @@ -341,6 +348,13 @@ def test_as_dict(self): 'ts_xyz_guess': []} self.assertEqual(rxn_dict_6, expected_dict_6) + rxn_7_dict = self.rxn7.as_dict() + self.assertEqual(rxn_7_dict['p_species'][1]['adjlist'], """multiplicity 3 +1 N u0 p1 c0 {2,S} {3,S} {4,S} +2 N u2 p1 c0 {1,S} +3 H u0 p0 c0 {1,S} +4 H u0 p0 c0 {1,S}""") + def test_from_dict(self): """Test ARCReaction.from_dict()""" rxn_dict = self.rxn1.as_dict()