2025-07-23 16:26:30 -04:00
|
|
|
#include <pybind11/pybind11.h>
|
|
|
|
|
|
|
|
|
|
#include "bindings.h"
|
|
|
|
|
|
|
|
|
|
namespace py = pybind11;
|
|
|
|
|
|
|
|
|
|
#include "gridfire/exceptions/exceptions.h"
|
|
|
|
|
|
2025-08-14 13:33:46 -04:00
|
|
|
void register_exception_bindings(const py::module &m) {
|
2025-11-25 14:08:58 -05:00
|
|
|
py::register_exception<gridfire::exceptions::GridFireError>(m, "GridFireError");
|
|
|
|
|
|
|
|
|
|
py::register_exception<gridfire::exceptions::DebugException>(m, "DebugException", m.attr("GridFireError"));
|
|
|
|
|
|
|
|
|
|
py::register_exception<gridfire::exceptions::EngineError>(m, "EngineError", m.attr("GridFireError"));
|
|
|
|
|
|
|
|
|
|
py::register_exception<gridfire::exceptions::FailedToPartitionEngineError>(m, "FailedToPartitionEngineError", m.attr("EngineError"));
|
|
|
|
|
py::register_exception<gridfire::exceptions::NetworkResizedError>(m, "NetworkResizedError", m.attr("EngineError"));
|
|
|
|
|
py::register_exception<gridfire::exceptions::UnableToSetNetworkReactionsError>(m, "UnableToSetNetworkReactionsError", m.attr("EngineError"));
|
|
|
|
|
py::register_exception<gridfire::exceptions::BadCollectionError>(m, "BadCollectionError", m.attr("EngineError"));
|
|
|
|
|
py::register_exception<gridfire::exceptions::InvalidQSESolutionError>(m, "InvalidQSESolutionError", m.attr("EngineError"));
|
|
|
|
|
py::register_exception<gridfire::exceptions::BadRHSEngineError>(m, "BadRHSEngineError", m.attr("EngineError"));
|
|
|
|
|
|
|
|
|
|
py::register_exception<gridfire::exceptions::JacobianError>(m, "JacobianError", m.attr("EngineError"));
|
2025-10-30 15:05:08 -04:00
|
|
|
|
2025-11-03 15:10:03 -05:00
|
|
|
py::register_exception<gridfire::exceptions::StaleJacobianError>(m, "StaleJacobianError", m.attr("JacobianError"));
|
|
|
|
|
py::register_exception<gridfire::exceptions::UninitializedJacobianError>(m, "UninitializedJacobianError", m.attr("JacobianError"));
|
|
|
|
|
py::register_exception<gridfire::exceptions::UnknownJacobianError>(m, "UnknownJacobianError", m.attr("JacobianError"));
|
2025-10-30 15:05:08 -04:00
|
|
|
|
2025-11-25 14:08:58 -05:00
|
|
|
py::register_exception<gridfire::exceptions::UtilityError>(m, "UtilityError", m.attr("GridFireError"));
|
2025-10-30 15:05:08 -04:00
|
|
|
py::register_exception<gridfire::exceptions::HashingError>(m, "HashingError", m.attr("UtilityError"));
|
2025-11-25 14:08:58 -05:00
|
|
|
|
|
|
|
|
py::register_exception<gridfire::exceptions::PolicyError>(m, "PolicyError", m.attr("GridFireError"));
|
|
|
|
|
py::register_exception<gridfire::exceptions::MissingBaseReactionError>(m, "MissingBaseReactionError", m.attr("PolicyError"));
|
|
|
|
|
py::register_exception<gridfire::exceptions::MissingSeedSpeciesError>(m, "MissingSeedSpeciesError", m.attr("PolicyError"));
|
|
|
|
|
py::register_exception<gridfire::exceptions::MissingKeyReactionError>(m, "MissingKeyReactionError", m.attr("PolicyError"));
|
|
|
|
|
|
|
|
|
|
py::register_exception<gridfire::exceptions::ReactionError>(m, "ReactionError", m.attr("GridFireError"));
|
|
|
|
|
py::register_exception<gridfire::exceptions::ReactionParsingError>(m, "ReactionParsingError", m.attr("ReactionError"));
|
|
|
|
|
|
|
|
|
|
py::register_exception<gridfire::exceptions::SolverError>(m, "SolverError", m.attr("GridFireError"));
|
|
|
|
|
py::register_exception<gridfire::exceptions::SingularJacobianError>(m, "SingularJacobianError", m.attr("SolverError"));
|
|
|
|
|
py::register_exception<gridfire::exceptions::IllConditionedJacobianError>(m, "IllConditionedJacobianError", m.attr("SolverError"));
|
|
|
|
|
py::register_exception<gridfire::exceptions::SUNDIALSError>(m, "SUNDIALSError", m.attr("SolverError"));
|
|
|
|
|
py::register_exception<gridfire::exceptions::CVODESolverFailureError>(m, "CVODESolverFailureError", m.attr("SUNDIALSError"));
|
|
|
|
|
py::register_exception<gridfire::exceptions::KINSolSolverFailureError>(m, "KINSolSolverFailureError", m.attr("SUNDIALSError"));
|
|
|
|
|
|
2025-07-23 16:26:30 -04:00
|
|
|
}
|