@@ -323,6 +323,9 @@ def kinetics_checkChildParentRelationships(self, family_name):
323323 def kinetics_checkSiblingsForParents (self , family_name ):
324324 """
325325 This test checks that siblings in a tree are not actually parent/child
326+
327+ See general_checkSiblingsForParents comments for more detailed description
328+ of the test.
326329 """
327330 from rmgpy .data .base import Database
328331 originalFamily = self .database .kinetics .families [family_name ]
@@ -335,12 +338,8 @@ def kinetics_checkSiblingsForParents(self, family_name):
335338 if node in originalFamily .forwardTemplate .products : continue
336339 for index , child1 in enumerate (node .children ):
337340 for child2 in node .children [index + 1 :]:
338- #Don't check a node against itself
339- if child1 is child2 : continue
340341 nose .tools .assert_false (family .matchNodeToChild (child1 , child2 ),
341342 "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 ))
344343
345344 def kinetics_checkAdjlistsNonidentical (self , database ):
346345 """
@@ -495,17 +494,27 @@ def general_checkChildParentRelationships(self, group_name, group):
495494
496495 def general_checkSiblingsForParents (self , group_name , group ):
497496 """
498- This test checks that siblings in a tree are not actually parent/child
497+ This test checks that siblings in a tree are not actually parent/child.
498+
499+ For example in a tree:
500+
501+ L1. A
502+ L2. B
503+ L2. C
504+
505+ This tests that C is not a child of B, which would make C inaccessible because
506+ we always match B first.
507+
508+ We do not check that B is not a child of C becausethat does not cause accessibility
509+ problems and may actually be necessary in some trees. For example, in the polycyclic
510+ thermo groups B might be a tricyclic and C a bicyclic parent. Currently there is no
511+ way to writes a bicyclic group that excludes an analogous tricyclic.
499512 """
500513 for nodeName , node in group .entries .iteritems ():
501514 for index , child1 in enumerate (node .children ):
502515 for child2 in node .children [index + 1 :]:
503- #Don't check a node against itself
504- if child1 is child2 : continue
505516 nose .tools .assert_false (group .matchNodeToChild (child1 , child2 ),
506517 "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 ))
509518
510519 def general_checkCdAtomType (self , group_name , group ):
511520 """
0 commit comments