sacred
sacred copied to clipboard
If len(config_scopes) >= 2, all "added" configs will not be shown in green when printing configs.
The problem is described in the issue title.
Here are some clues.
In sacred/config/utils.py:
def chain_evaluate_config_scopes(config_scopes, fixed=None, preset=None, fallback=None):
fixed = fixed or {}
fallback = fallback or {}
final_config = dict(preset or {})
config_summaries = []
for config in config_scopes:
cfg = config(fixed=fixed, preset=final_config, fallback=fallback)
config_summaries.append(cfg)
final_config.update(cfg)
if not config_scopes:
final_config.update(fixed)
return undogmatize(final_config), config_summaries
The second one in config_summaries will have no "added" configs as final_config has been updated in the first one.
In sacred.initialize.py:
def get_config_modifications(self):
self.config_mods = ConfigSummary(
added={key for key, value in iterate_flattened(self.config_updates)}
)
for cfg_summary in self.summaries:
self.config_mods.update_from(cfg_summary)
Then self.config_mods here will have no "added" configs as "self.added &= {join_paths(path, a) for a in added}" In sacred/config/config_summary.py.
Hi @HenryZhou19! Can you provide a minimal example to show what exactly happens?