Skip to content

excepts

FailedCalculateConcentrations

Bases: Exception

When calculation of concentrations fails.

Source code in src/libeq/excepts.py
class FailedCalculateConcentrations(Exception):
    """When calculation of concentrations fails."""

    def __init__(self, msg, last_value, **diagn):
        super().__init__()
        self.msg = msg
        self.last_value = last_value
        self.diagnostic = diagn

    def __str__(self):
        return self.msg

msg instance-attribute

msg = msg

last_value instance-attribute

last_value = last_value

diagnostic instance-attribute

diagnostic = diagn

NotConvergenceException

Bases: Exception

When convergence is not reached.

It contains the last value of the iterations in case this information can be valuable.

Source code in src/libeq/excepts.py
class NotConvergenceException(Exception):
    """When convergence is not reached.

    It contains the last value of the iterations in case this information can
    be valuable.
    """

    def __init__(self, msg, last_value):
        super().__init__()
        self.msg = msg
        self.last_value = last_value

    def __str__(self):
        return self.msg

msg instance-attribute

msg = msg

last_value instance-attribute

last_value = last_value

TooManyIterations

Bases: NotConvergenceException

When maximum number of iterations is reached.

This exception is thrown when the maximum number of iterations has been reached without meeting the convergence criteria

Source code in src/libeq/excepts.py
class TooManyIterations(NotConvergenceException):
    """When maximum number of iterations is reached.

    This exception is thrown when the maximum number of iterations
    has been reached without meeting the convergence criteria
    """