Skip to content

treat list[Component] in get_current_config()#2851

Merged
maxnoe merged 6 commits into
mainfrom
fix_tool_current_config
Oct 9, 2025
Merged

treat list[Component] in get_current_config()#2851
maxnoe merged 6 commits into
mainfrom
fix_tool_current_config

Conversation

@kosack
Copy link
Copy Markdown
Member

@kosack kosack commented Oct 7, 2025

Fixes #2850

  • also supports tools containing tools, which is something that is being used by camera teams

@kosack kosack marked this pull request as ready for review October 7, 2025 12:36
@kosack
Copy link
Copy Markdown
Member Author

kosack commented Oct 7, 2025

This might imply also that Tool should inherit from Component, which would clean up some code... But here is just a minimal change, since that might be more complex until we have a better config system (currently Tool inherits from traitlets.config.Application)

@kosack kosack force-pushed the fix_tool_current_config branch from 5c3adcd to 0544b12 Compare October 7, 2025 12:43
@kosack kosack requested a review from maxnoe October 7, 2025 12:45
Comment thread src/ctapipe/core/component.py Outdated
Comment thread src/ctapipe/core/tool.py Outdated
Checking all Iterables causes this to also check strings and even
EventSources, which is not the correct behavior.
Comment thread src/ctapipe/core/component.py Outdated
@kosack kosack force-pushed the fix_tool_current_config branch from a30fbfc to e2364fb Compare October 8, 2025 13:38
@kosack kosack changed the title treat Iterable[Component] in get_current_config() treat list[Component] in get_current_config() Oct 8, 2025
@ctao-sonarqube
Copy link
Copy Markdown

ctao-sonarqube Bot commented Oct 8, 2025

Please retry analysis of this Pull-Request directly on SonarQube

@maxnoe
Copy link
Copy Markdown
Member

maxnoe commented Oct 8, 2025

Sonarqube complains about code duplication. There is a big block exactly copy/pasted in the tests now.

Not sure why the message above fails.

@maxnoe maxnoe added this to the v0.27.0 milestone Oct 9, 2025
@maxnoe maxnoe merged commit a00a66b into main Oct 9, 2025
12 of 13 checks passed
@maxnoe maxnoe deleted the fix_tool_current_config branch October 9, 2025 14:32
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.

Tool.get_current_config() misses Components that are in lists

2 participants