From 1ffb28b3fc4661c60d5a0a314cd8a94fb7a4268e Mon Sep 17 00:00:00 2001 From: Fabian Date: Fri, 19 Jan 2024 12:23:29 +0100 Subject: [PATCH] helpers: parse: fix docstring and take original implementation --- scripts/_helpers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/_helpers.py b/scripts/_helpers.py index d84f025b..3173671d 100644 --- a/scripts/_helpers.py +++ b/scripts/_helpers.py @@ -362,7 +362,8 @@ def generate_periodic_profiles(dt_index, nodes, weekly_profile, localize=None): def parse(infix): """ - Recursively parse a list into a dictionary or a YAML object. + Recursively parse a chained wildcard expression into a dictionary or a YAML + object. Parameters ---------- @@ -377,7 +378,7 @@ def parse(infix): if len(infix) == 1: return yaml.safe_load(infix[0]) else: - return {infix[0]: parse(infix[1:])} + return {infix.pop(0): parse(infix)} def update_config_with_sector_opts(config, sector_opts):