[Python] Add repr functions to Species/Reaction classes
This commit is contained in:
parent
2610af703f
commit
af3e34ccb0
2 changed files with 14 additions and 0 deletions
|
|
@ -224,6 +224,12 @@ cdef class Reaction:
|
|||
def __set__(self, allow):
|
||||
self.reaction.allow_negative_orders = allow
|
||||
|
||||
def __repr__(self):
|
||||
return '<{}: {}>'.format(self.__class__.__name__, self.equation)
|
||||
|
||||
def __str__(self):
|
||||
return self.equation
|
||||
|
||||
|
||||
cdef class Arrhenius:
|
||||
r"""
|
||||
|
|
@ -268,6 +274,11 @@ cdef class Arrhenius:
|
|||
def __get__(self):
|
||||
return self.rate.activationEnergy_R() * gas_constant
|
||||
|
||||
def __repr__(self):
|
||||
return 'Arrhenius(A={:g}, b={:g}, E={:g})'.format(
|
||||
self.pre_exponential_factor, self.temperature_exponent,
|
||||
self.activation_energy)
|
||||
|
||||
|
||||
cdef wrapArrhenius(CxxArrhenius* rate, Reaction reaction):
|
||||
r = Arrhenius(init=False)
|
||||
|
|
|
|||
|
|
@ -198,6 +198,9 @@ cdef class Species:
|
|||
def __set__(self, GasTransportData tran):
|
||||
self.species.transport = tran._data
|
||||
|
||||
def __repr__(self):
|
||||
return '<Species {}>'.format(self.name)
|
||||
|
||||
|
||||
cdef class ThermoPhase(_SolutionBase):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue