Skip to content

Commit

Permalink
Merge pull request #2 from connie/solvation-fix
Browse files Browse the repository at this point in the history
Some more unit tests for solvation
  • Loading branch information
bslakman committed Mar 31, 2015
2 parents f6b725a + 1abcf74 commit 1303163
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
38 changes: 35 additions & 3 deletions rmgpy/data/solvationTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,41 @@ def testLonePairSoluteGeneration(self):
3 H u0 p0 c0 {1,S}
""")
species = Species(molecule=[molecule])
soluteData = self.database.getSoluteDataFromGroups(species)
soluteData = self.database.getSoluteDataFromGroups(species)
self.assertTrue(soluteData is not None)


@work_in_progress
def testSoluteDataGenerationAmmonia(self):
"Test we can obtain solute parameters via group additivity for ammonia"
molecule=Molecule().fromAdjacencyList(
"""
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 H u0 p0 c0 {1,S}
""")
species = Species(molecule=[molecule])
soluteData = self.database.getSoluteDataFromGroups(species)
self.assertTrue(soluteData is not None)

def testSoluteDataGenerationAmide(self):
"Test that we can obtain solute parameters via group additivity for an amide"
molecule=Molecule().fromAdjacencyList(
"""
1 N u0 p1 {2,S} {3,S} {4,S}
2 H u0 {1,S}
3 C u0 {1,S} {6,S} {7,S} {8,S}
4 C u0 {1,S} {5,D} {9,S}
5 O u0 p2 {4,D}
6 H u0 {3,S}
7 H u0 {3,S}
8 H u0 {3,S}
9 H u0 {4,S}
""")
species = Species(molecule=[molecule])
soluteData = self.database.getSoluteDataFromGroups(species)
self.assertTrue(soluteData is not None)

def testRadicalandLonePairGeneration(self):
"""
Test we can obtain solute parameters via group additivity for a molecule with both lone
Expand All @@ -117,7 +149,7 @@ def testRadicalandLonePairGeneration(self):
3 H u0 p0 c0 {2,S}
""")
species = Species(molecule=[molecule])
soluteData = self.database.getSoluteDataFromGroups(species)
soluteData = self.database.getSoluteDataFromGroups(species)
self.assertTrue(soluteData is not None)

def testCorrectionGeneration(self):
Expand Down
2 changes: 1 addition & 1 deletion rmgpy/data/thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ def getThermoDataFromLibraries(self, species, trainingSet=None):
if thermoData is not None:
assert len(thermoData) == 3, "thermoData should be a tuple at this point"
if rmgpy.rmg.main.solvent is not None and trainingSet is None:
thermoData[0].comment += 'Thermo library "corrected": ' + label
thermoData[0].comment += 'Thermo library corrected for liquid phase: ' + label
else:
thermoData[0].comment += 'Thermo library: ' + label
return thermoData
Expand Down

0 comments on commit 1303163

Please sign in to comment.