Skip to content

Preserve added config updates across dictionary scopes - #947

Open
ktz03 wants to merge 1 commit into
IDSIA:masterfrom
ktz03:fix/chained-config-added-0712
Open

ktz03 wants to merge 1 commit into
IDSIA:masterfrom
ktz03:fix/chained-config-added-0712

Conversation

@ktz03

@ktz03 ktz03 commented Oct 16, 2026

Copy link
Copy Markdown

Fixes #938, reported by @HenryZhou19.

With two dictionary config scopes, a newly supplied config update loses its added flag because the second scope fills its presets before determining which fixed keys were added. This also bypasses the unused-update check: a misspelled parameter that raises ConfigAddedError with one dictionary scope is silently accepted with two.

Move preset filling after the addition/modification summary is collected, matching the ordering already used by ConfigScope. Add regression tests for the public ConfigDict preset path and for Experiment.run with one, two, and three dictionary scopes, covering both consumed and unused new parameters.

Validation on Windows, Python 3.11.16, NumPy 2.4.6, and pytest 7.1.2:

  • The seven new cases produce 5 failures and 2 passes on the unchanged base; they all pass with the fix.
  • Config and experiment tests: 311 passed.
  • Full python -m pytest tests/ -q -rs with pandas 2.3.3: 726 passed, 12 existing skips.
  • pre-commit run --all-files: Black and Flake8 passed.

The current source requires pkg_resources, so the environment uses setuptools 80.10.2. With pandas 3.0.6, the full suite has the same unrelated TinyDB dataframe-serialization failure on both base and fixed trees; pandas 2.3.3 was used for the passing full run. No dependencies, skips, or CI settings are changed by this PR. Other Python/platform combinations and live observer services were not tested.

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

Successfully merging this pull request may close these issues.

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

1 participant