Skip to content

Skip config loading for Configurables with no matching config - #969

Merged
Carreau merged 1 commit into
ipython:mainfrom
Carreau:dont-load-nothing
Aug 4, 2026
Merged

Skip config loading for Configurables with no matching config#969
Carreau merged 1 commit into
ipython:mainfrom
Carreau:dont-load-nothing

Conversation

@Carreau

@Carreau Carreau commented Aug 4, 2026

Copy link
Copy Markdown
Member

Configurable._load_config computed traits(config=True) and entered hold_trait_notifications() unconditionally, even for the many leaf Configurables in an Application graph whose config has no keys matching the instance. It now computes my_config first and returns early when it is empty, before doing any of that work.

Also removes a dead section_names = self.section_names() local that was computed (section_names() walks the MRO with issubclass checks, twice per instance) but never used — _find_my_config recomputes it internally. The section_names parameter is kept in the signature for backward compatibility.

Configurable._load_config computed traits(config=True) and entered
hold_trait_notifications() unconditionally, even for the many leaf
Configurables in an Application graph whose config has no keys matching the
instance. It now computes my_config first and returns early when it is empty,
before doing any of that work.

Also removes a dead `section_names = self.section_names()` local that was
computed (section_names() walks the MRO with issubclass checks, twice per
instance) but never used — _find_my_config recomputes it internally. The
section_names parameter is kept in the signature for backward compatibility.
@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.98%. Comparing base (626bbe5) to head (fdab14e).

Components Coverage Δ
traitlets 85.35% <100.00%> (ø)
tests 99.03% <ø> (ø)

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Carreau
Carreau merged commit 06216ff into ipython:main Aug 4, 2026
33 checks passed
@Carreau Carreau added this to the 5.17 milestone Aug 4, 2026
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.

1 participant