Configuring YETI¶
The configuration arguments for a YETI run are stored in a YAML file. The configuration file (sometimes referred to as “config file” or “config.yaml”) contains all the configurations for a model run.
What goes in the configuration file depends on the Strategy used for the run. You can find example configuration
files for most strategies in the folder example/example_configs/
.
We encourage you to adapt the example configuration files to your needs instead of writing your own configuration files from
scratch.
A YETI config file contains the following:
Mode¶
You need to specify a mode. The mode expresses which data format you would like to use for the run. Add one of the following lines to your configuration file:
mode: berlin_format
if you are looking to use berlin_format
data or
mode: yeti_format
if you want to use yeti_format
data.
Pollutants¶
The list of pollutants you want to calculate emissions for. Add this line to your configuration file:
pollutants: [PollutantType.{pollutant1}, PollutantType.{pollutant2}, ...]
For example:
pollutants: [PollutantType.NOx]
Note that different Strategies support different pollutants. Find out what pollutants a Strategy supports on the Strategy’s documentation page.
Strategy and functions¶
Specify a Strategy in the configuration file:
strategy: path.to.a.Strategy
Along with the Strategy you need to specify functions to work with the data required for the Strategy. Possible functions are:
load_berlin_format_data_function
: The path to a function that converts data inberlin_format
to data inyeti_format
and saves the constructedyeti_format
data to disc. This argument is only necessary for themode
berlin_format
.load_yeti_format_data_function
: The path to a function that loads data inyeti_format
from disc into memory.validation_function
: Optional. The path to a function that validates the given data. Validation includes: Check that all necessary files are present, Check the column names, check that categorical columns use the right categories, check mappings between files, and check that percentage columns contain values between 0 and 1. Which validation function you want to use depends on themode
. Select avalidation_function
that fits the data format you are working with. If you don’t specify avalidation_function
in the configuration file, validation is skipped.
Take a look at the docs page for the strategy you want to use to see which functions you should specify in
the configuration file or consult the example configs in example/example_configs/
.
Example:
strategy: code.copert_cold_strategy.CopertColdStrategy.CopertColdStrategy
load_berlin_format_data_function: code.copert_cold_strategy.load_berlin_format_data.load_copert_cold_berlin_format_data
load_yeti_format_data_function: code.copert_cold_strategy.load_yeti_format_data.load_copert_cold_yeti_format_data
validation_function: code.copert_hot_strategy.validate.file_paths_are_valid
Filenames¶
This section of the configuration file contains paths to the files you intend to use for the model run.
What files are required depends on the Strategy used for the run and on the mode
. Find out more on
the Strategy’s documentation page.
Output folder(s)¶
You need to specify an output_folder
. The Model output will be saved in this folder.
You may also specify an output_folder_for_yeti_format_data
. If the mode
is berlin_format
, the yeti_format
files generated by YETI will be saved in the output_folder_for_yeti_format_data
. If no
output_folder_for_yeti_format_data
is given, the yeti_format
files will be saved in the output_folder
.
If you are using mode
yeti_format
, this argument is ignored.
Example:
output_folder: emission_output/
output_folder_for_yeti_format_data: yeti_format_data_new/
Optional config arguments¶
links_to_use
You may specify a list of LinkID
s that should be used for this run. All links with IDs that are not in the
given list will be ignored. Example:
links_to_use: [42_123, 64_586] # 42_123 and 64_586 are two link IDs from the link data
use_n_traffic_data_rows
An integer that specifies how many rows of the traffic data should be used for the run. This config option is
particularly useful for quick test runs. Example:
use_n_traffic_data_rows: 100
Strategy-specific config arguments¶
Each Strategy comes with a set of required and optional configuration arguments. For example the CopertColdStrategy
requires that a temperature
is specified in the config.
You can find out which configuration arguments are needed or possible for each Strategy on the Strategy’s documentation page.