Skip to content

Commit

Permalink
Facilitate using 'eV/molecule' for energy units
Browse files Browse the repository at this point in the history
Also allow (then forbid) use of 'eV' (synonym with 'eV/molecule') for Energy
This was a merge of two commits, one that added a feature and one
that removed it, due to unforeseen consequences.
It ends up just adding a comment, which may be helpful
for people in future.
  • Loading branch information
rwest authored and mliu49 committed Apr 25, 2019
1 parent 467e99f commit 5fa87e7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rmgpy/quantity.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,8 +761,12 @@ def __call__(self, *args, **kwargs):

"We have to allow 'energies' to be created in units of Kelvins, because Chemkin does so"
Energy = Enthalpy = FreeEnergy = UnitType('J/mol',
commonUnits=['kJ/mol', 'cal/mol', 'kcal/mol'],
extraDimensionality={'K': constants.R },
commonUnits=['kJ/mol', 'cal/mol', 'kcal/mol', 'eV/molecule'],
extraDimensionality={'K': constants.R,
# the following hack also allows 'J' and 'kJ' etc. to be specified without /mol[ecule]
# so is not advisable (and fails unit tests)
# 'eV': constants.Na, # allow people to be lazy and neglect the "/molecule"
},
)


Expand Down

0 comments on commit 5fa87e7

Please sign in to comment.