Skip to content

Commit

Permalink
Tests: adjlist in Species dict
Browse files Browse the repository at this point in the history
  • Loading branch information
alongd committed May 28, 2023
1 parent 0de8145 commit c3d61c3
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions arc/reaction_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit c3d61c3

Please sign in to comment.