zen_garden.runner

This function runs ZEN garden,it is executed in the __main__.py script. Compilation of the optimization problem.

Functions

run([config, dataset, job_index, folder_output])

Run ZEN-garden.

zen_garden.runner.run(config='./config.json', dataset=None, job_index=None, folder_output=None)

Run ZEN-garden.

This function is the primary programmatic entry point for running ZEN-garden. When called, it reads the configuration, loads the model input data, constructs and solves the optimization problem, and saves the results.

Parameters:
  • config (str) – Path to the configuration file (e.g. config.json). If the file is located in the current working directory, the filename alone may be specified. Defaults to "./config.json".

  • dataset (str) – Path to the folder containing the input dataset (e.g. "./1_base_case"). If located in the current working directory, the folder name alone may be used. Defaults to the dataset value specified in the configuration file.

  • folder_output (str) – Path to the folder where outputs will be saved. Defaults to "./outputs".

  • job_index (list[int] | None) – Indices of jobs (scenarios) to run. For example, job_index=[1] runs only the first scenario. Defaults to None (run all jobs).

Returns:

The fully set up and solved optimization problem.

Return type:

OptimizationSetup

Examples

>>> from zen_garden import run, download_example_dataset
>>> download_example_dataset("1_base_case")
>>> run("1_base_case")