Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 55 additions & 3 deletions EvaluateKinetics.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,58 @@ def LeaveOneOut(FullDatabase, trialDir):
print 'These families had errors:', familiesWithErrors
return

def checkFamilies(FullDatabase):
familyStatus={}
for family in FullDatabase.kinetics.families:
print family
familyStatus[family]=FullDatabase.kinetics.families[family].checkWellFormed()

with open(r'DatabaseWellFormedSummary.txt', 'wb') as outputFile:
for family, problems in familyStatus.iteritems():
problemsExist=[]
for problem in problems:
problemsExist.append(not problem==[] and not problem=={})
if True in problemsExist:
outputFile.write(family + '\n')
if problemsExist[0]:
outputFile.write('\n' + 'These groups exist in rules.py but not groups.py:' + '\n')
for group in problems[0]:
outputFile.write(group + '\n')
if problemsExist[1]:
outputFile.write('\n' + 'These groups do not match the definition in the rule' + '\n')
for rule, groups in problems[1].iteritems():
for group in groups:
if group==groups[-1]:
if len(groups)>1:
outputFile.write('and ')
outputFile.write(group + ' ')
else:
outputFile.write(group +', ' )
outputFile.write('in ' + rule + '\n')
if problemsExist[2]:
outputFile.write('\n' + 'These groups are not in the tree:' + '\n')
for group in problems[2]:
outputFile.write(group + '\n')
if problemsExist[3]:
outputFile.write('\n' + 'These groups are not unique' + '\n')
for key, groups in problems[3].iteritems():
outputFile.write(key + ' matches ')
for group in groups:
if group==groups[-1]:
if len(groups)>1:
outputFile.write('and ')
outputFile.write(group + '\n')
else:
outputFile.write(group +', ' )
if problemsExist[4]:
outputFile.write('\n' + 'These groups are not actually subgroups of their parent' + '\n')
for group, parent in problems[4].iteritems():
outputFile.write('Child: ' + group + ', Parent: ' + parent + '\n')
if problemsExist[5]:
outputFile.write('\n' + 'These groups are probably products, but you should check them anyway' + '\n')
for group in problems[5]:
outputFile.write(group + '\n')
outputFile.write('\n\n')
if __name__ == '__main__':


Expand All @@ -434,9 +486,9 @@ def LeaveOneOut(FullDatabase, trialDir):
path='C:\RMG-database\input'
# FullDatabase.load(thermoLibraries=)
FullDatabase.load(path)
checkFamilies(FullDatabase)
# trialDir=r'C:\Users\User1\Dropbox\Research\RMG\kinetics\LeaveOneOut\test'
trialDir=r'C:\RMG-database\input_test'
FullDatabase.save(trialDir)
# trialDir=r'C:\RMG-database\input_test'
# family=FullDatabase.kinetics.families['Disproportionation']
# entryKey='Y_1centerbirad;O_Cdrad'
#
Expand All @@ -447,6 +499,6 @@ def LeaveOneOut(FullDatabase, trialDir):

# NISTExact(FullDatabase, trialDir)
# countNodesAll(NISTDatabase, trialDir)
consistencyTest(FullDatabase)
# consistencyTest(FullDatabase)
# LeaveOneOut(FullDatabase, trialDir)

100 changes: 28 additions & 72 deletions input/kinetics/families/Disproportionation/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
entry(
index = 1,
label = "Y_rad_birad_trirad_quadrad",
group = "OR{Y_1centerquadrad, Y_1centertrirad, Y_2centerbirad, Y_1centerbirad, Y_rad}",
group = "OR{Y_1centerquadrad, Y_1centertrirad, Y_2centerbirad, Y_1centerbirad, Y_rad, H_rad}",
kinetics = None,
reference = None,
referenceType = "",
Expand All @@ -41,8 +41,8 @@
label = "XH_Rrad",
group =
"""
1 *2 R!H 0 {2,S} {3,S}
2 *3 R!H 1 {1,S}
1 *2 R!H 0 {2,{S,D}} {3,S}
2 *3 R!H 1 {1,{S,D}}
3 *4 H 0 {1,S}
""",
kinetics = None,
Expand Down Expand Up @@ -125,8 +125,7 @@
label = "Y_rad",
group =
"""
1 *1 R 1 {2,S}
2 R 0 {1,S}
1 *1 R 1
""",
kinetics = None,
reference = None,
Expand Down Expand Up @@ -166,8 +165,8 @@
label = "Ct_rad/Ct",
group =
"""
1 *1 C 1 {2,T}
2 C 0 {1,T}
1 *1 Ct 1 {2,T}
2 Ct 0 {1,T}
""",
kinetics = None,
reference = None,
Expand Down Expand Up @@ -1097,7 +1096,7 @@
1 *1 C 1 {2,S} {3,S} {4,S}
2 H 0 {1,S}
3 {Cd,Ct,Cb,CO} 0 {1,S}
4 {Cs,O,S} 0 {1,S}
4 {Cs,O,S,N} 0 {1,S}
""",
kinetics = None,
reference = None,
Expand Down Expand Up @@ -1440,7 +1439,7 @@
group =
"""
1 *2 Cd 0 {2,S} {3,S}
2 *3 {Cs,Cd,CO,O,S} 1 {1,S}
2 *3 {Cs,Cd,CO,O,S,N} 1 {1,S}
3 *4 H 0 {1,S}
""",
kinetics = None,
Expand Down Expand Up @@ -1550,7 +1549,7 @@
group =
"""
1 *2 CO 0 {2,S} {3,S}
2 *3 {Cs,Cd,CO,O,S} 1 {1,S}
2 *3 {Cs,Cd,CO,O,S,N} 1 {1,S}
3 *4 H 0 {1,S}
""",
kinetics = None,
Expand Down Expand Up @@ -1660,7 +1659,7 @@
group =
"""
1 *2 O 0 {2,S} {3,S}
2 *3 {Cs,Cd,CO,O,S} 1 {1,S}
2 *3 {Cs,Cd,CO,O,S,N} 1 {1,S}
3 *4 H 0 {1,S}
""",
kinetics = None,
Expand Down Expand Up @@ -1858,7 +1857,7 @@
group =
"""
1 *2 C 0 {2,S} {3,S} {4,S} {5,S}
2 *3 {Cs,Cd,CO,O,S} 1 {1,S}
2 *3 {Cs,Cd,CO,O,S,N} 1 {1,S}
3 *4 H 0 {1,S}
4 H 0 {1,S}
5 H 0 {1,S}
Expand Down Expand Up @@ -2002,7 +2001,7 @@
group =
"""
1 *2 C 0 {2,S} {3,S} {4,S} {5,S}
2 *3 {Cs,Cd,CO,O,S} 1 {1,S}
2 *3 {Cs,Cd,CO,O,S,N} 1 {1,S}
3 *4 H 0 {1,S}
4 H 0 {1,S}
5 R!H 0 {1,S}
Expand All @@ -2026,7 +2025,7 @@
group =
"""
1 *2 C 0 {2,S} {3,S} {4,S} {5,S}
2 *3 {Cs,Cd,CO,O,S} 1 {1,S}
2 *3 {Cs,Cd,CO,O,S,N} 1 {1,S}
3 *4 H 0 {1,S}
4 H 0 {1,S}
5 {Cs,O,S} 0 {1,S}
Expand Down Expand Up @@ -2146,7 +2145,7 @@
group =
"""
1 *2 C 0 {2,S} {3,S} {4,S} {5,S}
2 *3 {Cs,Cd,CO,O,S} 1 {1,S}
2 *3 {Cs,Cd,CO,O,S,N} 1 {1,S}
3 *4 H 0 {1,S}
4 H 0 {1,S}
5 {Cd,Ct,Cb,CO} 0 {1,S}
Expand Down Expand Up @@ -2266,7 +2265,7 @@
group =
"""
1 *2 C 0 {2,S} {3,S} {4,S} {5,S}
2 *3 {Cs,Cd,CO,O,S} 1 {1,S}
2 *3 {Cs,Cd,CO,O,S,N} 1 {1,S}
3 *4 H 0 {1,S}
4 R!H 0 {1,S}
5 R!H 0 {1,S}
Expand All @@ -2290,7 +2289,7 @@
group =
"""
1 *2 C 0 {2,S} {3,S} {4,S} {5,S}
2 *3 {Cs,Cd,CO,O,S} 1 {1,S}
2 *3 {Cs,Cd,CO,O,S,N} 1 {1,S}
3 *4 H 0 {1,S}
4 {Cs,O,S} 0 {1,S}
5 {Cs,O,S} 0 {1,S}
Expand Down Expand Up @@ -2410,7 +2409,7 @@
group =
"""
1 *2 C 0 {2,S} {3,S} {4,S} {5,S}
2 *3 {Cs,Cd,CO,O,S} 1 {1,S}
2 *3 {Cs,Cd,CO,O,S,N} 1 {1,S}
3 *4 H 0 {1,S}
4 {Cs,O,S} 0 {1,S}
5 {Cd,Ct,Cb,CO} 0 {1,S}
Expand Down Expand Up @@ -2530,7 +2529,7 @@
group =
"""
1 *2 C 0 {2,S} {3,S} {4,S} {5,S}
2 *3 {Cs,Cd,CO,O,S} 1 {1,S}
2 *3 {Cs,Cd,CO,O,S,N} 1 {1,S}
3 *4 H 0 {1,S}
4 {Cd,Ct,Cb,CO} 0 {1,S}
5 {Cd,Ct,Cb,CO} 0 {1,S}
Expand Down Expand Up @@ -2661,26 +2660,6 @@
],
)

entry(
index = 201,
label = "N3_atom_quartet",
group =
"""
1 *1 N3s 3
""",
kinetics = None,
reference = None,
referenceType = "",
shortDesc = u"""""",
longDesc =
u"""

""",
history = [
("Mon Nov 4 10:25:25 2013","Beat Buesser <[email protected]>","action","""Beat Buesser <[email protected]> created this value."""),
],
)

entry(
index = 202,
label = "CH_quartet",
Expand Down Expand Up @@ -3639,7 +3618,7 @@
group =
"""
1 *2 N 0 {2,S} {3,S}
2 *3 R 1 {1,S}
2 *3 R!H 1 {1,S}
3 *4 H 0 {1,S}
""",
kinetics = None,
Expand All @@ -3661,7 +3640,7 @@
group =
"""
1 *2 N3s 0 {2,S} {3,S}
2 *3 R 1 {1,S}
2 *3 R!H 1 {1,S}
3 *4 H 0 {1,S}
""",
kinetics = None,
Expand All @@ -3683,7 +3662,7 @@
group =
"""
1 *2 N3s 0 {2,S} {3,S} {4,S}
2 *3 R 1 {1,S}
2 *3 R!H 1 {1,S}
3 *4 H 0 {1,S}
4 H 0 {1,S}
""",
Expand Down Expand Up @@ -3821,7 +3800,7 @@
group =
"""
1 *2 N3s 0 {2,S} {3,S} {4,S}
2 *3 N 1 {1,S}
2 *3 R!H 1 {1,S}
3 *4 H 0 {1,S}
4 {Cs,N3s,Os} 0 {1,S}
""",
Expand All @@ -3844,7 +3823,7 @@
group =
"""
1 *2 N3s 0 {2,S} {3,S} {4,S}
2 *3 N 1 {1,S}
2 *3 R!H 1 {1,S}
3 *4 H 0 {1,S}
4 {Cd,Ct,Cb,CO} 0 {1,S}
""",
Expand All @@ -3867,7 +3846,7 @@
group =
"""
1 *2 {N5s,N5d} 0 {2,S} {3,S}
2 *3 R 1 {1,S}
2 *3 R!H 1 {1,S}
3 *4 H 0 {1,S}
""",
kinetics = None,
Expand Down Expand Up @@ -4276,7 +4255,7 @@
label = "N5d/H_d_Rrad",
group =
"""
1 *2 N3d 0 {2,D} {3,S}
1 *2 N5d 0 {2,D} {3,S}
2 *3 R!H 1 {1,D}
3 *4 H 0 {1,S}
""",
Expand All @@ -4292,29 +4271,7 @@
("Mon Nov 4 10:25:25 2013","Beat Buesser <[email protected]>","action","""Beat Buesser <[email protected]> created this value."""),
],
)

entry(
index = 275,
label = "N5dd/H_d_Rrad",
group =
"""
1 *2 N3d 0 {2,D} {3,S}
2 *3 R!H 1 {1,D}
3 *4 H 0 {1,S}
""",
kinetics = None,
reference = None,
referenceType = "",
shortDesc = u"""""",
longDesc =
u"""

""",
history = [
("Mon Nov 4 10:25:25 2013","Beat Buesser <[email protected]>","action","""Beat Buesser <[email protected]> created this value."""),
],
)


entry(
index = 276,
label = "XH_Rbirad",
Expand Down Expand Up @@ -4874,9 +4831,9 @@
L4: C_sec_rad
L5: C_rad/H/NonDeC
L5: C_rad/H/NonDeO
L5: C_rad/H/NonDeN
L6: C_rad/H/CsO
L6: C_rad/H/O2
L5: C_rad/H/NonDeN
L5: C_rad/H/NonDeS
L6: C_rad/H/CsS
L6: C_rad/H/S2
Expand Down Expand Up @@ -5007,8 +4964,7 @@
L5: N3d/H_d_Rrad
L6: N3d/H_d_Crad
L6: N3d/H_d_Nrad
L5: N5d/H_d_Rrad
L5: N5dd/H_d_Rrad
L5: N5d/H_d_Rrad
L2: XH_Rbirad
L3: XH_s_Rbirad
L4: CH_s_Rbirad
Expand Down
Loading