@@ -116,12 +116,11 @@ def test_thermo(self):
116116 self .compat_func_name = test_name
117117 yield test , group_name
118118
119- if group_name != 'polycyclic' :
120- test = lambda x : self .general_checkSiblingsForParents (group_name , group )
121- test_name = "Thermo groups {0}: sibling relationships are correct?" .format (group_name )
122- test .description = test_name
123- self .compat_func_name = test_name
124- yield test , group_name
119+ test = lambda x : self .general_checkSiblingsForParents (group_name , group )
120+ test_name = "Thermo groups {0}: sibling relationships are correct?" .format (group_name )
121+ test .description = test_name
122+ self .compat_func_name = test_name
123+ yield test , group_name
125124
126125 test = lambda x : self .general_checkCdAtomType (group_name , group )
127126 test_name = "Thermo groups {0}: Cd atomtype used correctly?" .format (group_name )
@@ -323,6 +322,9 @@ def kinetics_checkChildParentRelationships(self, family_name):
323322 def kinetics_checkSiblingsForParents (self , family_name ):
324323 """
325324 This test checks that siblings in a tree are not actually parent/child
325+
326+ See general_checkSiblingsForParents comments for more detailed description
327+ of the test.
326328 """
327329 from rmgpy .data .base import Database
328330 originalFamily = self .database .kinetics .families [family_name ]
@@ -335,12 +337,8 @@ def kinetics_checkSiblingsForParents(self, family_name):
335337 if node in originalFamily .forwardTemplate .products : continue
336338 for index , child1 in enumerate (node .children ):
337339 for child2 in node .children [index + 1 :]:
338- #Don't check a node against itself
339- if child1 is child2 : continue
340340 nose .tools .assert_false (family .matchNodeToChild (child1 , child2 ),
341341 "In family {0}, node {1} is a parent of {2}, but they are written as siblings." .format (family_name , child1 , child2 ))
342- nose .tools .assert_false (family .matchNodeToChild (child2 , child1 ),
343- "In family {0}, node {1} is a parent of {2}, but they are written as siblings." .format (family_name , child2 , child1 ))
344342
345343 def kinetics_checkAdjlistsNonidentical (self , database ):
346344 """
@@ -495,17 +493,27 @@ def general_checkChildParentRelationships(self, group_name, group):
495493
496494 def general_checkSiblingsForParents (self , group_name , group ):
497495 """
498- This test checks that siblings in a tree are not actually parent/child
496+ This test checks that siblings in a tree are not actually parent/child.
497+
498+ For example in a tree:
499+
500+ L1. A
501+ L2. B
502+ L2. C
503+
504+ This tests that C is not a child of B, which would make C inaccessible because
505+ we always match B first.
506+
507+ We do not check that B is not a child of C becausethat does not cause accessibility
508+ problems and may actually be necessary in some trees. For example, in the polycyclic
509+ thermo groups B might be a tricyclic and C a bicyclic parent. Currently there is no
510+ way to writes a bicyclic group that excludes an analogous tricyclic.
499511 """
500512 for nodeName , node in group .entries .iteritems ():
501513 for index , child1 in enumerate (node .children ):
502514 for child2 in node .children [index + 1 :]:
503- #Don't check a node against itself
504- if child1 is child2 : continue
505515 nose .tools .assert_false (group .matchNodeToChild (child1 , child2 ),
506516 "In {0} group, node {1} is a parent of {2}, but they are written as siblings." .format (group_name , child1 , child2 ))
507- nose .tools .assert_false (group .matchNodeToChild (child2 , child1 ),
508- "In {0} group, node {1} is a parent of {2}, but they are written as siblings." .format (group_name , child2 , child1 ))
509517
510518 def general_checkCdAtomType (self , group_name , group ):
511519 """
0 commit comments