Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f55608e
Add unitTest for checking sibling relationship
nyee Jun 3, 2016
b378e10
Removed all groups with a CS atomType
nyee Jun 1, 2016
b46b957
Edit adjlist for every instance of (Cds-Cd) ligand in groups.py
nyee Jun 2, 2016
cada4c6
Move a few groups around in tree due to changes from last commit
nyee Jun 3, 2016
247568d
Fixes for siblings that should be child/parent in radical.py
nyee Jun 3, 2016
febb553
Add in groups with CS atomType
nyee Jun 12, 2016
db2fae7
Set references in training reaction to None instead of empty strings
nyee Jun 13, 2016
1e91b56
Fix parent/child siblings for Disprop family
nyee Jun 13, 2016
3f84e7c
Fix Intra_RH_Add family labels
nyee Jun 13, 2016
9b9242f
More explictly define groups for Intra_R_Add families
nyee Jun 13, 2016
471a8a0
Fix sibling parent/child for intra_substitutionCS_isomerization
nyee Jun 13, 2016
434f98f
Fix sibling parent/child relationships for H_Abstraction
nyee Jun 13, 2016
f3a5a53
Fix sibling parent/child relationships for Cyclic_Ether_Formation
nyee Jun 13, 2016
28df61d
Redefine one group in intra_H_migration to fix sibling parent/child bug
nyee Jun 13, 2016
1d47b07
Fix groups in R_Addition_Multiple_Bond
nyee Jun 14, 2016
fe05136
Fix sibling child/parent bug for R_Addition_MultipleBond
nyee Jun 14, 2016
129d1e5
Clarify some groups in statmech to avoid sibling bug
nyee Jun 14, 2016
a5d14ff
Moved four groups to fix sibling child/parent in statmech
nyee Jun 14, 2016
d20fd02
Move a groups to fix sibling bug in transport
nyee Jun 14, 2016
a48a1f4
Add sibling check for transport, kinetic families, solvation, statmec…
nyee Jun 15, 2016
253b662
Fix bug with sibling check
nyee Jun 15, 2016
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
20 changes: 20 additions & 0 deletions testing/databaseTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ def test_thermo(self):
test.description = test_name
self.compat_func_name = test_name
yield test, group_name

test = lambda x: self.general_checkSiblingsForParents(group_name, group)
test_name = "Thermo groups {0}: sibling relationships are correct?".format(group_name)
test.description = test_name
self.compat_func_name = test_name
yield test, group_name


def test_solvation(self):
for group_name, group in self.database.solvation.groups.iteritems():
Expand Down Expand Up @@ -349,5 +356,18 @@ def general_checkChildParentRelationships(self, group_name, group):
if isinstance(ancestorNode, Group):
nose.tools.assert_true(group.matchNodeToChild(ancestorNode, childNode),
"In {group} group, node {ancestor} is not a proper ancestor of its child {child}.".format(group=group_name, ancestor=ancestorNode, child=nodeName))

def general_checkSiblingsForParents(self, group_name, group):
"""
This test checks that siblings in a tree are not actually parent/child
"""
for nodeName, node in group.entries.iteritems():
for index, child1 in enumerate(node.children):
for child2 in node.children[index+1:]:
#Don't check a node against itself
if child1 is child2: continue
nose.tools.assert_false(group.matchNodeToChild(child1, child2),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will you need to check reversely as well nose.tools.assert_false(group.matchNodeToChild(child2, child1),...)?

"In {0} group, node {1} is written as a sibling of {2}, when it is actually a parent.".format(group_name, child1, child2))

if __name__ == '__main__':
nose.run(argv=[__file__, '-v', '--nologcapture'], defaultTest=__name__)