Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If len(config_scopes) >= 2, all "added" configs will not be shown in green when printing configs. #938

Open
HenryZhou19 opened this issue Dec 6, 2024 · 0 comments

Comments

@HenryZhou19
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant