Skip to content

Commit

Permalink
Merge pull request #441 from ReactionMechanismGenerator/from_yml_file…
Browse files Browse the repository at this point in the history
…_test

Testing that an ARCSpecies instance can be loaded from an Arkane YAML file
  • Loading branch information
alongd committed Jan 18, 2021
2 parents f2b4667 + 7414f60 commit f702b47
Show file tree
Hide file tree
Showing 2 changed files with 345 additions and 0 deletions.
38 changes: 38 additions & 0 deletions arc/species/speciesTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,44 @@ def setUpClass(cls):
cls.spc11 = ARCSpecies(label='CCCNO', smiles='CCCNO') # has chiral N
cls.spc12 = ARCSpecies(label='[CH](CC[CH]c1ccccc1)c1ccccc1', smiles='[CH](CC[CH]c1ccccc1)c1ccccc1')

def test_from_yml_file(self):
"""Test that an ARCSpecies object can succesfully loaded from an Arkane YAML file"""

n4h6_adj_list = """1 N u0 p1 c0 {2,S} {3,S} {4,S}
2 H u0 p0 c0 {1,S}
3 H u0 p0 c0 {1,S}
4 N u0 p1 c0 {1,S} {5,S} {6,S}
5 H u0 p0 c0 {4,S}
6 N u0 p1 c0 {4,S} {7,S} {8,S}
7 H u0 p0 c0 {6,S}
8 N u0 p1 c0 {6,S} {9,S} {10,S}
9 H u0 p0 c0 {8,S}
10 H u0 p0 c0 {8,S}
"""

n4h6_xyz = {'symbols': ('N', 'H', 'H', 'N', 'H', 'N', 'H', 'N', 'H', 'H'),
'isotopes': (14, 1, 1, 14, 1, 14, 1, 14, 1, 1),
'coords': ((1.359965, -0.537228, -0.184462),
(2.339584, -0.30093, -0.289911),
(1.2713739999999998, -1.27116, 0.51544),
(0.669838, 0.659561, 0.217548),
(0.61618, 0.715758, 1.2316809999999996),
(-0.669836, 0.659561, -0.217548),
(-0.616179, 0.715757, -1.231682),
(-1.3599669999999997, -0.537227, 0.184463),
(-2.339586, -0.300928, 0.289904),
(-1.2713739999999998, -1.271158, -0.51544))}

n4h6_yml_path = os.path.join(arc_path, 'arc', 'testing', 'yml_testing', 'N4H6.yml')
n4h6 = ARCSpecies(yml_path=n4h6_yml_path)
self.assertEqual(n4h6.mol.to_adjacency_list(), n4h6_adj_list)
self.assertEqual(n4h6.charge, 0)
self.assertEqual(n4h6.multiplicity, 1)
self.assertEqual(n4h6.external_symmetry, 2)
self.assertEqual(n4h6.mol.to_smiles(), 'NNNN')
self.assertEqual(n4h6.optical_isomers, 2)
self.assertEqual(n4h6.get_xyz(), n4h6_xyz)

def test_str(self):
"""Test the string representation of the object"""
str_representation = str(self.spc9)
Expand Down
307 changes: 307 additions & 0 deletions arc/testing/yml_testing/N4H6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,307 @@
RMG_version: 3.0.0
adjacency_list: |
1 N u0 p1 c0 {2,S} {3,S} {5,S}
2 N u0 p1 c0 {1,S} {4,S} {6,S}
3 N u0 p1 c0 {1,S} {7,S} {8,S}
4 N u0 p1 c0 {2,S} {9,S} {10,S}
5 H u0 p0 c0 {1,S}
6 H u0 p0 c0 {2,S}
7 H u0 p0 c0 {3,S}
8 H u0 p0 c0 {3,S}
9 H u0 p0 c0 {4,S}
10 H u0 p0 c0 {4,S}
charge: 0
chemkin_thermo_string: |
N4H6 H 6N 4 G 10.000 3000.000 525.56 1
1.62242296E+00 3.39008096E-02-2.07508959E-05 6.29899113E-09-7.45531289E-13 2
3.29107779E+04 1.63618795E+01 3.93984937E+00 3.64724684E-03 1.01601962E-04 3
-1.94576974E-07 1.16533242E-10 3.28414235E+04 8.33001692E+00 4
class: ArkaneSpecies
conformer:
E0:
class: ScalarQuantity
units: kJ/mol
value: 273.2465365710362
class: Conformer
coordinates:
class: ArrayQuantity
units: angstroms
value:
class: np_array
object:
- - 1.359965
- -0.537228
- -0.184462
- - 2.339584
- -0.30093
- -0.289911
- - 1.2713739999999998
- -1.27116
- 0.51544
- - 0.669838
- 0.659561
- 0.217548
- - 0.61618
- 0.715758
- 1.2316809999999998
- - -0.669836
- 0.659561
- -0.217548
- - -0.616179
- 0.715757
- -1.231682
- - -1.3599669999999997
- -0.537227
- 0.184463
- - -2.339586
- -0.300928
- 0.289904
- - -1.2713739999999998
- -1.271158
- -0.51544
mass:
class: ArrayQuantity
units: amu
value:
class: np_array
object:
- 14.00307400443
- 1.00782503224
- 1.00782503224
- 14.00307400443
- 1.00782503224
- 14.00307400443
- 1.00782503224
- 14.00307400443
- 1.00782503224
- 1.00782503224
modes:
- class: IdealGasTranslation
mass:
class: ScalarQuantity
units: amu
value: 62.05925
quantum: false
- class: NonlinearRotor
inertia:
class: ArrayQuantity
units: amu*angstrom^2
value:
class: np_array
object:
- 30.703836294589518
- 85.46089834764526
- 104.14066056887903
quantum: false
rotationalConstant:
class: ArrayQuantity
units: cm^-1
value:
class: np_array
object:
- 0.5490398297986973
- 0.19725546278221376
- 0.1618736520515807
symmetry: 2
- class: HarmonicOscillator
frequencies:
class: ArrayQuantity
units: cm^-1
value:
class: np_array
object:
- 222.47271903012998
- 289.55529081465994
- 328.96067287784996
- 443.35255463044996
- 598.2722299769499
- 766.9498478585599
- 802.5108024033899
- 837.93061537849
- 943.8741660286798
- 1014.0887364557899
- 1048.23155427619
- 1179.0966735244199
- 1254.62085538423
- 1258.1964418173898
- 1405.7431504022798
- 1512.7486233390098
- 1585.7322569436799
- 1600.9486623659998
- 3323.05728080451
- 3325.6717603580796
- 3337.10422750621
- 3359.841462287
- 3439.3915393976795
- 3439.66710151001
quantum: true
number:
class: ArrayQuantity
value:
class: np_array
object:
- 7.0
- 1.0
- 1.0
- 7.0
- 1.0
- 7.0
- 1.0
- 7.0
- 1.0
- 1.0
optical_isomers: 2
spin_multiplicity: 1
datetime: 2021-01-01 16:25
energy_transfer_model:
T0:
class: ScalarQuantity
units: K
value: 300.0
alpha0:
class: ScalarQuantity
units: kJ/mol
value: 3.5886
class: SingleExponentialDown
n: 0.85
formula: H6N4
frequency_scale_factor: 0.967
inchi: InChI=1S/H6N4/c1-3-4-2/h3-4H,1-2H2
inchi_key: ZERJNAGZUCPHNB-UHFFFAOYSA-N
is_ts: false
label: N4H6
level_of_theory:
class: CompositeLevelOfTheory
energy:
basis: ccpvtzf12
class: LevelOfTheory
method: ccsd(t)f12
freq:
basis: 6311+g(3df,2p)
class: LevelOfTheory
method: b3lyp
model_chemistry: CCSD(T)-F12/cc-pVTZ-f12//B3LYP/6-311+G(3df,2p)
molecular_weight:
class: ScalarQuantity
units: amu
value: 62.07460707919523
multiplicity: 1
smiles: NNNN
thermo:
Cp0:
class: ScalarQuantity
units: J/(mol*K)
value: 33.257888
CpInf:
class: ScalarQuantity
units: J/(mol*K)
value: 232.805216
E0:
class: ScalarQuantity
units: kJ/mol
value: 273.0377063316256
Tmax:
class: ScalarQuantity
units: K
value: 3000.0
Tmin:
class: ScalarQuantity
units: K
value: 10.0
class: NASA
polynomials:
polynomial1:
Tmax:
class: ScalarQuantity
units: K
value: 525.5637147421418
Tmin:
class: ScalarQuantity
units: K
value: 10.0
class: NASAPolynomial
coeffs:
class: np_array
object:
- 3.939849372714779
- 0.0036472468351583273
- 0.00010160196180781551
- -1.9457697449306026e-07
- 1.1653324157554236e-10
- 32841.42351403803
- 8.33001691788619
polynomial2:
Tmax:
class: ScalarQuantity
units: K
value: 3000.0
Tmin:
class: ScalarQuantity
units: K
value: 525.5637147421418
class: NASAPolynomial
coeffs:
class: np_array
object:
- 1.6224229603846028
- 0.03390080958338352
- -2.0750895867481103e-05
- 6.298991126027704e-09
- -7.455312885424877e-13
- 32910.77786037164
- 16.361879480966934
thermo_data:
Cpdata:
class: ArrayQuantity
units: cal/(mol*K)
value:
class: np_array
object:
- 19.610828693858373
- 24.21487949363181
- 28.06962772170374
- 31.311513478261418
- 36.52924942498961
- 40.39155496927745
- 46.24023759590699
- 49.449422112369255
- 51.2729486983912
H298:
class: ScalarQuantity
units: kcal/mol
value: 69.04519404898873
S298:
class: ScalarQuantity
units: cal/(mol*K)
value: 69.32819933445928
Tdata:
class: ArrayQuantity
units: K
value:
class: np_array
object:
- 300.0
- 400.0
- 500.0
- 600.0
- 800.0
- 1000.0
- 1500.0
- 2000.0
- 2400.0
class: ThermoData
use_bond_corrections: true
use_hindered_rotors: true
xyz: |-
10
N4H6
N 1.35996500 -0.53722800 -0.18446200
H 2.33958400 -0.30093000 -0.28991100
H 1.27137400 -1.27116000 0.51544000
N 0.66983800 0.65956100 0.21754800
H 0.61618000 0.71575800 1.23168100
N -0.66983600 0.65956100 -0.21754800
H -0.61617900 0.71575700 -1.23168200
N -1.35996700 -0.53722700 0.18446300
H -2.33958600 -0.30092800 0.28990400
H -1.27137400 -1.27115800 -0.51544000

0 comments on commit f702b47

Please sign in to comment.