Running a model¶
Run ZEN-garden¶
In a terminal or command prompt, change your directory to the
<data>folder (i.e. the directory that contains your model and theconfig.json)cd <data>
Activate the ZEN-garden environment (see instructions).
Execute the following lines to run ZEN-garden:
zen-garden --dataset="1_base_case"
This will run the ZEN-garden model
1_base_case, provide that it was downloaded as described in Builing a model. To run other datasets, replace"1_base_case"with the name of (or path to) the dataset that you wish to run. Once the model finishes, the output files will be stored in a new directoryoutputsin your current working directory.
Tip
ZEN-garden provides tools for easily reading and visualizing the outputs. For an introduction on how to analyze and visualize model outputs, see the tutorial on analyzing outputs.
Additional Remarks and Tips¶
ZEN-garden can also be run without providing any command line flags:
zen-garden
In this case, ZEN-garden will look for the name of the dataset in the
analysis/datasetentry ofconfig.json.If you have multiple
config.jsonfiles in your working directory, you can specify the file you want to use with theconfigargument:zen-garden --config="config.json" --dataset="1_base_case"
ZEN-garden can also be run from with a python script. You may find this to be more familiar than using the command line. The following python code can be used to run ZEN-garden, provided that it is run from within an environment in which ZEN-garden is installed:
from zen_garden import run import os os.chdir("<data>") run(dataset = "1_base_case")
In this code, replace
<data>with the path to your data folder (i.e. the directory that contains theconfig.json). Thedatasetargument of the functionruncan be used to specify the name of the dataset that should be run.Note that the
runfunction can take as an optional input arguments any flags which can also be specified in the command line. For instance, in order to specify a config file, you can use the code below. Seezen_garden.runner.run()for full documentation of therunfunction.from zen_garden import run import os os.chdir("<data>") run(dataset = "1_base_case", config="<my_config.json>")