[Cython] Added access to the "id" property of ThermoPhase objects
This commit is contained in:
parent
9631f44d29
commit
62dfdcfb01
3 changed files with 19 additions and 0 deletions
|
|
@ -47,6 +47,8 @@ cdef extern from "cantera/thermo/ThermoPhase.h" namespace "Cantera":
|
|||
string report(cbool) except +
|
||||
string name()
|
||||
void setName(string)
|
||||
string id()
|
||||
void setID(string)
|
||||
double minTemp() except +
|
||||
double maxTemp() except +
|
||||
double refPressure() except +
|
||||
|
|
|
|||
|
|
@ -64,6 +64,13 @@ class TestThermoPhase(utilities.CanteraTest):
|
|||
self.assertEqual(self.phase.name, 'something')
|
||||
self.assertTrue('something' in self.phase.report())
|
||||
|
||||
def test_ID(self):
|
||||
self.assertEqual(self.phase.ID, 'ohmech')
|
||||
|
||||
self.phase.ID = 'something'
|
||||
self.assertEqual(self.phase.ID, 'something')
|
||||
self.assertEqual(self.phase.name, 'ohmech')
|
||||
|
||||
def test_badLength(self):
|
||||
X = np.zeros(5)
|
||||
def set_X():
|
||||
|
|
|
|||
|
|
@ -43,6 +43,16 @@ cdef class ThermoPhase(_SolutionBase):
|
|||
def __set__(self, name):
|
||||
self.thermo.setName(stringify(name))
|
||||
|
||||
property ID:
|
||||
"""
|
||||
The ID of the phase. The default is taken from the CTI/XML input file.
|
||||
"""
|
||||
def __get__(self):
|
||||
return pystr(self.thermo.id())
|
||||
def __set__(self, id_):
|
||||
self.thermo.setID(stringify(id_))
|
||||
|
||||
|
||||
property basis:
|
||||
"""
|
||||
Determines whether intensive thermodynamic properties are treated on a
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue