Only check for duplicate final keys when building scenarios
Previous behavior would check if a top-level key was modified more than
once. New behavior checks if a full key path (all nested keys) is modified,
which allows for more flexible settings management.
@@ -7,6 +7,7 @@ import pudl
import requests
import sqlalchemy as sa
+from flatten_dict import flatten
import yaml
from ruamel.yaml import YAML
from pathlib import Path
@@ -367,7 +368,7 @@ def build_scenario_settings(settings: dict, scenario_definitions: pd.DataFrame)
]
# print(new_parameter)
try:
- settings_keys = list(new_parameter.keys())
+ settings_keys = list(flatten(new_parameter).keys())
except AttributeError:
settings_keys = {}
