Skip to content

Commit

Permalink
Fixed issue with merging loaded configs (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgastegger authored Aug 19, 2022
1 parent 4b87d44 commit 0796a50
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/schnetpack/md/utils/md_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@ def merge_configs(
Returns:
DictConfig: basic config updated with entries from the overwrite config and all overrides re-applied.
"""

# merge overwrite config into basic config
merged_config = OmegaConf.merge(base_config, overwrite_config)
# basic merge is not operating properly, so the basic config needs to be updated on a field by field basis
merged_config = copy.deepcopy(base_config)

for k, v in overwrite_config.items():
# force add ensures new values (e.g. temperature in RPMD integrator are still inserted into config block)
OmegaConf.update(merged_config, k, v, merge=True, force_add=True)

# get overrides in list of lists format
overrides_modify, overrides_delete = self._parse_overrides(overrides)
Expand Down

0 comments on commit 0796a50

Please sign in to comment.