Source code for mici.errors

"""Exception types."""

from __future__ import annotations


[docs]class Error(RuntimeError): """Base class for errors."""
[docs]class IntegratorError(Error): """Error raised when integrator step fails."""
[docs]class NonReversibleStepError(IntegratorError): """Error raised when integrator step fails reversibility check."""
[docs]class ConvergenceError(IntegratorError): """Error raised when solver fails to converge within allowed iterations."""
[docs]class LinAlgError(Error): """Error raised when a matrix operation raises a linear algebra error."""
[docs]class HamiltonianDivergenceError(IntegratorError): """Error raised when integration of Hamiltonian dynamics diverges."""
[docs]class AdaptationError(Error): """Error raised when adaptation of transition parameters fails."""
[docs]class ReadOnlyStateError(Error): """Error raised when writing to attributes of read-only chain state."""