Skip to content

Commit

Permalink
fix(fileio.py::set_cfg_paths_to_absolute): don't touch file paths wit…
Browse files Browse the repository at this point in the history
…hin the 'lgr': 'cfg' sub-block (when LGR inset configuration is supplied in the same file; this is mostly done in a test context).
  • Loading branch information
aleaf committed Jan 6, 2025
1 parent 818c192 commit 6224038
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion mfsetup/fileio.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,16 @@ def set_cfg_paths_to_absolute(cfg, config_file_location):
if isinstance(pckg, dict):
for input_block in look_for_files_in:
if input_block in pckg.keys():
file_keys = _parse_file_path_keys_from_source_data(pckg[input_block])
# handle LGR sub-blocks separately
# if LGR configuration is specified within the yaml file
# (or as a dictionary), we don't want to touch it at this point
# (just convert filepaths to configuration files for sub-models)
if input_block == 'lgr':
for model_name, config in pckg[input_block].items():
if 'filename' in config:
file_keys = _parse_file_path_keys_from_source_data(config)
else:
file_keys = _parse_file_path_keys_from_source_data(pckg[input_block])
for key in file_keys:
file_path_keys_relative_to_config. \
append('.'.join([pckgname, input_block, key]))
Expand Down

0 comments on commit 6224038

Please sign in to comment.