Skip to content

model

Module containing routines to set up the data structure and models

Model

Bases: ABC

Set up Model base class

Source code in process/core/model.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
class Model(abc.ABC):
    """Set up Model base class"""

    data: DataStructure

    @abc.abstractmethod
    def run(self) -> None:
        """Run the model.

        The run method is responsible for 'running' the model, ensuring it updates
        the data structure with variables that subsequent models will require.
        """

    @abc.abstractmethod
    def output(self) -> None:
        """Output model data.

        This method will always be called after run method and should output the model
        data to the output files.
        """

data instance-attribute

run() abstractmethod

Run the model.

The run method is responsible for 'running' the model, ensuring it updates the data structure with variables that subsequent models will require.

Source code in process/core/model.py
17
18
19
20
21
22
23
@abc.abstractmethod
def run(self) -> None:
    """Run the model.

    The run method is responsible for 'running' the model, ensuring it updates
    the data structure with variables that subsequent models will require.
    """

output() abstractmethod

Output model data.

This method will always be called after run method and should output the model data to the output files.

Source code in process/core/model.py
25
26
27
28
29
30
31
@abc.abstractmethod
def output(self) -> None:
    """Output model data.

    This method will always be called after run method and should output the model
    data to the output files.
    """