smif.cli package¶
Module contents¶
A command line interface to the system of systems framework
This command line interface implements a number of methods.
- setup creates a new project folder structure in a location
- run performs a simulation of an individual sector model, or the whole
- system of systems model
- validate performs a validation check of the configuration file
Folder structure¶
When configuring a system-of-systems model for the CLI, the folder structure
below should be used. In this example, there is one sector model, called
water_supply
:
/main_config.yaml
/timesteps.yaml
/water_supply.yaml
/data/all/inputs.yaml
/data/water_supply/
/data/water_supply/inputs.yaml
/data/water_supply/outputs.yaml
/data/water_supply/assets/assets1.yaml
/data/water_supply/planning/
/data/water_supply/planning/pre-specified.yaml
The data
folder contains one subfolder for each sector model.
The sector model implementations can be installed independently of the model run configuration. The main_config.yaml file specifies which sector models should run, while each set of sector model config
-
smif.cli.
confirm
(prompt=None, response=False)[source]¶ Prompts for a yes or no response from the user
Parameters: - prompt (str, default=None) –
- response (bool, default=False) –
Returns: True for yes and False for no.
Return type: Notes
response should be set to the default value assumed by the caller when user simply types ENTER.
Examples
>>> confirm(prompt='Create Directory?', response=True) Create Directory? [y]|n: True >>> confirm(prompt='Create Directory?', response=False) Create Directory? [n]|y: False >>> confirm(prompt='Create Directory?', response=False) Create Directory? [n]|y: y True
-
smif.cli.
parse_arguments
()[source]¶ Parse command line arguments
Returns: Return type: argparse.ArgumentParser
-
smif.cli.
path_to_abs
(relative_root, path)[source]¶ Return an absolute path, given a possibly-relative path and the relative root
-
smif.cli.
read_sector_model_data
(config_basepath, config)[source]¶ Read sector-specific data from the sector config folders
-
smif.cli.
setup_configuration
(args)[source]¶ Sets up the configuration files into the defined project folder