Mentions légales du service

Skip to content

Fixes #94

E. Madison Bray requested to merge embray/issue-94 into master

(apparently the fix from !97 (merged) also helped with this)

The previous way this was done, it was not possible to get the filename of the config file a particular config key was loaded from if the value of the key is not itself a dict.

So for example, for a my_preprocessing_config.yml containing:

dataset:
    inherit: ../my_dataset/my_dataset_config.yml

where "scenario_params_path" comes from my_dataset_config.yml,

the resulting config (after resolving the inherit) is:

dataset:
    scenario_params_path: "scenario_params.csv"

If I load this config file, config['dataset'] itself came from my_preprocessing_config.yml, so it finds "scenario_params.csv" relative to the path of that file.

However, the contents of config['dataset'] were loaded from the inherited file. We have to make sure when we look up config['dataset']['scenario_params_path'] that we get the correct path to the file that key was loaded from.

Merge request reports