Skip to content

_exceptions

cybersyn._exceptions

Basic exception classes used to validate correct inputs in the economy.

ShapeError(shape, desired_shape)

Bases: ValueError

The shapes of different matrices of the economy don't match.

Source code in cybersyn/_exceptions.py
21
22
23
24
def __init__(self, shape: tuple[int, int], desired_shape: tuple[int, int]) -> None:
    message = f"Shape is {shape}, instead of {desired_shape}.\n\n"
    logging.error(message)
    super().__init__(message)

ShapesNotEqualError()

Bases: ValueError

The shapes of the matrices difer.

Source code in cybersyn/_exceptions.py
14
15
def __init__(self) -> None:
    super().__init__("The shapes of the matrices in the same list differ.\n\n")