macrostat.models.model_manager#
Model Manager
This module provides a manager for all models in the MacroStat library. It allows for easy access to all models, as well as the ability to get the classes for a specific model.
Functions
Get all available models in the models directory. |
|
|
Get a model from the models directory. |
|
Get a model from the models directory. |
Classes
|
Container for all model component classes of a specific version. |
- class macrostat.models.model_manager.ModelClasses(Behavior: Type[Behavior], Parameters: Type[Parameters], Scenarios: Type[Scenarios], Variables: Type[Variables], Model: Type[Model])[source]#
Bases:
NamedTupleContainer for all model component classes of a specific version.
- Parameters: Type[Parameters]#
Alias for field number 1
- macrostat.models.model_manager.get_available_models()[source]#
Get all available models in the models directory.
Parse the models directory and return a list of all available models, which are in subdirectories of the models directory and are named after the model. They are valid when they contain a __init__.py, parameters.py, variables.py, scenarios.py, behavior.py file.
- Returns:
A list of all available models.
- Return type:
- macrostat.models.model_manager.get_model(modelname: str)[source]#
Get a model from the models directory.
- Parameters:
modelname (str) – The name of the model to get.
- Returns:
Named tuple containing all model component classes
- Return type:
- Raises:
ValueError – If model name is invalid or model is not available
ImportError – If there are problems importing the model components
- macrostat.models.model_manager.get_model_classes(modelname: str)[source]#
Get a model from the models directory.
- Parameters:
modelname (str) – The name of the model to get.
- Returns:
Named tuple containing all model component classes
- Return type:
- Raises:
ValueError – If model name is invalid or model is not available
ImportError – If there are problems importing the model components