Skip to content

[Callbacks] Rename propagate_callbacks into propagate_callback_context#33420

Merged
ogrisel merged 1 commit intoscikit-learn:callbacksfrom
jeremiedbb:rename-propagate-callback-ctx
Mar 2, 2026
Merged

[Callbacks] Rename propagate_callbacks into propagate_callback_context#33420
ogrisel merged 1 commit intoscikit-learn:callbacksfrom
jeremiedbb:rename-propagate-callback-ctx

Conversation

@jeremiedbb
Copy link
Copy Markdown
Member

to be more explicit about what this method does because it propagates the context and the callbacks.

Extracted from #33340 because we decided to not couple propagate_callback_context and clone.

ping @lesteve @StefanieSenger

@jeremiedbb jeremiedbb added No Changelog Needed Quick Review For PRs that are quick to review Callbacks labels Feb 27, 2026
Comment on lines +388 to +394
# We store the parent context in the sub-estimator to be able to merge the task
# trees of the sub-estimator and the meta-estimator. We want to link the task
# trees even if there is no callback to propagate, as the sub-estimators might
# have non auto-propagated callbacks, which would need to have access to the
# whole tree.
sub_estimator._parent_callback_ctx = self

Copy link
Copy Markdown
Member Author

@jeremiedbb jeremiedbb Feb 27, 2026

Choose a reason for hiding this comment

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

this move is just a nitpick to have the definition of callbacks_to_propagate next to where it's used

@ogrisel ogrisel merged commit b4481b2 into scikit-learn:callbacks Mar 2, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Callbacks No Changelog Needed Quick Review For PRs that are quick to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants