hkmoffat / cantera

Automatically exported from code.google.com/p/cantera
0 stars 0 forks source link

Extend user-friendliness in Phase.py selectSpecies and selectElements #91

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The correct way to use selectSpecies(f, species) is to give species as a list.
For example, to get the chemical Potential for the species 'O2' in a 
CounterFlame 'f' with phase object 'gas', you have to state
 gas.chemPotentials(['O2'])
However, people (like me) might forget to print the brackets, because other 
functions work like this:
 gas.chemPotentials('O2')
This way, you get a cryptic error message. This is basically because a string 
is passed to selectSpecies instead of a list.

I attached a patch which takes care of this problem and makes it possible to 
pass strings to selectSpecies as well, and does the same for selectElements. I 
hope you find it useful and include it in a later revision.

Original issue reported on code.google.com by thetruet...@googlemail.com on 21 Jun 2012 at 2:59

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed in r1617.

Original comment by yarmond on 22 Jun 2012 at 10:37