mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
[Python] Handle potential exceptions propagating from callbacks
Resolves side-issue noted in #1680
This commit is contained in:
parent
1a6f711795
commit
4d6a3659be
@ -43,11 +43,11 @@ cdef extern from "cantera/base/Solution.h" namespace "Cantera":
|
||||
void setSource(string)
|
||||
CxxAnyMap& header() except +translate_exception
|
||||
shared_ptr[CxxThermoPhase] thermo()
|
||||
void setThermo(shared_ptr[CxxThermoPhase])
|
||||
void setThermo(shared_ptr[CxxThermoPhase]) except +translate_exception
|
||||
shared_ptr[CxxKinetics] kinetics()
|
||||
void setKinetics(shared_ptr[CxxKinetics])
|
||||
void setKinetics(shared_ptr[CxxKinetics]) except +translate_exception
|
||||
shared_ptr[CxxTransport] transport()
|
||||
void setTransport(shared_ptr[CxxTransport])
|
||||
void setTransport(shared_ptr[CxxTransport]) except +translate_exception
|
||||
void setTransportModel(const string&) except +translate_exception
|
||||
CxxAnyMap parameters(cbool) except +translate_exception
|
||||
size_t nAdjacent()
|
||||
|
@ -142,6 +142,13 @@ class TestOnedim(utilities.CanteraTest):
|
||||
gas.transport_model = 'multicomponent'
|
||||
assert flame.transport_model == 'multicomponent'
|
||||
|
||||
with pytest.raises(ct.CanteraError, match="Invalid Transport model"):
|
||||
flame.transport_model = 'none'
|
||||
|
||||
gas.transport_model = 'unity-Lewis-number'
|
||||
with pytest.raises(ct.CanteraError, match="Invalid Transport model"):
|
||||
gas.transport_model = 'none'
|
||||
|
||||
|
||||
class TestFreeFlame(utilities.CanteraTest):
|
||||
tol_ss = [1.0e-5, 1.0e-14] # [rtol atol] for steady-state problem
|
||||
|
Loading…
Reference in New Issue
Block a user