From 767d5f9a6ab20228ed2cca09979fb920ff675131 Mon Sep 17 00:00:00 2001 From: Enoch Dames Date: Tue, 18 Feb 2014 14:51:11 -0500 Subject: [PATCH 1/3] cantherm examples input files fixed input files had old LennardJones tranport attribute which now crashes cantherm. also fixed typo in cantherm/input.py --- examples/cantherm/networks/acetyl+O2/input.py | 6 +++--- examples/cantherm/networks/n-butanol/input.py | 4 ++-- rmgpy/cantherm/input.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/cantherm/networks/acetyl+O2/input.py b/examples/cantherm/networks/acetyl+O2/input.py index 86baf22eaa..1a06738e86 100644 --- a/examples/cantherm/networks/acetyl+O2/input.py +++ b/examples/cantherm/networks/acetyl+O2/input.py @@ -28,7 +28,7 @@ spinMultiplicity = 2, opticalIsomers = 1, molecularWeight = (75.04,"g/mol"), - collisionModel = LennardJones(sigma=(5.09,'angstrom'), epsilon=(473,'K')), + collisionModel = TransportData(sigma=(5.09,'angstrom'), epsilon=(473,'K')), energyTransferModel = SingleExponentialDown( alpha0 = (0.5718,'kcal/mol'), T0 = (300,'K'), @@ -51,7 +51,7 @@ spinMultiplicity = 2, opticalIsomers = 1, molecularWeight = (75.04,"g/mol"), - collisionModel = LennardJones(sigma=(5.09,'angstrom'), epsilon=(473,'K')), + collisionModel = TransportData(sigma=(5.09,'angstrom'), epsilon=(473,'K')), energyTransferModel = SingleExponentialDown( alpha0 = (0.5718,'kcal/mol'), T0 = (300,'K'), @@ -144,7 +144,7 @@ label = 'nitrogen', structure = SMILES('N#N'), molecularWeight = (28.04,"g/mol"), - collisionModel = LennardJones(sigma=(3.70,'angstrom'), epsilon=(94.9,'K')), + collisionModel = TransportData(sigma=(3.70,'angstrom'), epsilon=(94.9,'K')), ) ################################################################################ diff --git a/examples/cantherm/networks/n-butanol/input.py b/examples/cantherm/networks/n-butanol/input.py index b927b23a1d..ec48996eca 100644 --- a/examples/cantherm/networks/n-butanol/input.py +++ b/examples/cantherm/networks/n-butanol/input.py @@ -29,7 +29,7 @@ spinMultiplicity = 1, opticalIsomers = 1, molecularWeight = (74.07,"g/mol"), - collisionModel = LennardJones(sigma=(5.94,'angstrom'), epsilon=(559,'K')), + collisionModel = TransportData(sigma=(5.94,'angstrom'), epsilon=(559,'K')), energyTransferModel = SingleExponentialDown(alpha0=(447.5*0.011962,"kJ/mol"), T0=(300,"K"), n=0.85), ) @@ -65,7 +65,7 @@ label = "bath_gas", E0 = (0,'kJ/mol'), molecularWeight = (28.04,"g/mol"), - collisionModel = LennardJones(sigma=(3.41,"angstrom"), epsilon=(124,"K")), + collisionModel = TransportData(sigma=(3.41,"angstrom"), epsilon=(124,"K")), energyTransferModel = None, ) diff --git a/rmgpy/cantherm/input.py b/rmgpy/cantherm/input.py index 2c38bc53e2..3019e4aeea 100644 --- a/rmgpy/cantherm/input.py +++ b/rmgpy/cantherm/input.py @@ -113,7 +113,7 @@ def species(label, *args, **kwargs): if structure: spec.molecule = [structure] spec.conformer = Conformer(E0=E0, modes=modes, spinMultiplicity=spinMultiplicity, opticalIsomers=opticalIsomers) spec.molecularWeight = molecularWeight - spec.transportData = collisionModel + spec.TransportData = collisionModel spec.energyTransferModel = energyTransferModel spec.thermo = thermo From 522116b3ce95200dc42ca5d98d50815b1bffb5aa Mon Sep 17 00:00:00 2001 From: Enoch Dames Date: Wed, 19 Feb 2014 09:57:00 -0500 Subject: [PATCH 2/3] reversion of transportData attribute back to mixed-case format in cantherm input.py --- documentation/source/developers/introduction.rst | 10 ++++++++++ rmgpy/cantherm/input.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/documentation/source/developers/introduction.rst b/documentation/source/developers/introduction.rst index 9ab776035c..43cdd62626 100644 --- a/documentation/source/developers/introduction.rst +++ b/documentation/source/developers/introduction.rst @@ -4,6 +4,16 @@ Introduction The :mod:`rmgpy` package contains all of the functionality of RMG. +RMG-Py naming conventions in brief: + +* module names are in lowercase +* Class and Exception names start with capital letters (e.g., CamelCase) +* all instances of Classes are mixed-case and begin with lower-case letters (e.g., camelCase) + + + `Python style guide `_. In general, refer to this for guidance. + + Dependencies ============ diff --git a/rmgpy/cantherm/input.py b/rmgpy/cantherm/input.py index 3019e4aeea..2c38bc53e2 100644 --- a/rmgpy/cantherm/input.py +++ b/rmgpy/cantherm/input.py @@ -113,7 +113,7 @@ def species(label, *args, **kwargs): if structure: spec.molecule = [structure] spec.conformer = Conformer(E0=E0, modes=modes, spinMultiplicity=spinMultiplicity, opticalIsomers=opticalIsomers) spec.molecularWeight = molecularWeight - spec.TransportData = collisionModel + spec.transportData = collisionModel spec.energyTransferModel = energyTransferModel spec.thermo = thermo From 2fbcb44f9432e540efbf62f1be9dbba2e50fcba5 Mon Sep 17 00:00:00 2001 From: Enoch Dames Date: Wed, 5 Mar 2014 12:09:30 -0500 Subject: [PATCH 3/3] getCollisionFrequency unittest fix the previous test was using the wrong numeric value for the collison frequency at the specified conditions. The test will pass now. --- rmgpy/transportDataTest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rmgpy/transportDataTest.py b/rmgpy/transportDataTest.py index 095976cb0b..12981e4c2e 100644 --- a/rmgpy/transportDataTest.py +++ b/rmgpy/transportDataTest.py @@ -120,8 +120,8 @@ def test_getCollisionFrequency(self): M = P / constants.R / T mu = 1.0 omega = self.transport.getCollisionFrequency(T, M, mu) - self.assertAlmostEqual(omega / 3.13010e10, 1.0, 4) - + self.assertAlmostEqual(omega / 1.17737e10, 1.0, 4) + def test_pickle(self): """ Test that a TransportData object can be pickled and unpickled with no loss of information.