Skip to content

[Callbacks] ENH Remove the need for **kwargs in callback hooks#33572

Merged
jeremiedbb merged 6 commits intoscikit-learn:callbacksfrom
FrancoisPgm:signature_check
Mar 18, 2026
Merged

[Callbacks] ENH Remove the need for **kwargs in callback hooks#33572
jeremiedbb merged 6 commits intoscikit-learn:callbacksfrom
FrancoisPgm:signature_check

Conversation

@FrancoisPgm
Copy link
Copy Markdown
Contributor

Reference Issues/PRs

Towards #27676

What does this implement/fix? Explain your changes.

When calling the callback hooks, the callback context now inspects each hook's signature to provide only the necessary args (if available). It also evaluated any args provided as a callable when requested, to enable lazy-loading of any arg.

AI usage disclosure

I used AI assistance for:

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Any other comments?

ping @jeremiedbb @StefanieSenger @ogrisel @lesteve

@jeremiedbb
Copy link
Copy Markdown
Member

Extracted from #33407

Copy link
Copy Markdown
Member

@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jeremiedbb jeremiedbb merged commit fdd9197 into scikit-learn:callbacks Mar 18, 2026
25 checks passed
@FrancoisPgm FrancoisPgm deleted the signature_check branch March 30, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants