Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lucyleeow
Copy link
Member

Reference Issues/PRs

#30508

Separated out from #30508

What does this implement/fix? Explain your changes.

As discussed in https://github.com/scikit-learn/scikit-learn/pull/30508/files#r2154473997:

Previously, if you passed any curve_kwargs, it would over-ride all default kwargs.

Now, if an individual curve_kwargs that changes the same parameter as a default kwarg is passed, only that parameter will be over-ridden. All other default kwargs will still be used. E.g., if the user set color to red in curve_kwargs, only the defualt color parameter will be over-ridden. The other parameters (e.g., "alpha": 0.5, "linestyle": "--") will still be used.

I think it is more likely that if a user e.g., sets the curve color to be red, they still want the other default kwargs (i.e., they only want to change the color).

Any other comments?

cc @jeremiedbb @glemaitre

@github-actions
Copy link

github-actions bot commented Oct 1, 2025

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 0bfc983. Link to the linter CI: here

@lucyleeow
Copy link
Member Author

@jeremiedbb I've amended such that default_multi_curve_kwargs are passed in when used in the Display class, amended some tests and added tests due to this change.

Thank you! 🙏

@glemaitre
Copy link
Member

Let me have a look at this one.

@glemaitre glemaitre self-requested a review October 3, 2025 08:00
Comment on lines 228 to 236
# This should never happen, as we would not pass the same keys to both
# default kwargs
common_keys = set(default_curve_kwargs).intersection(default_multi_curve_kwargs)
if len(common_keys) > 0:
raise ValueError(
"`default_curve_kwargs` and `default_multi_curve_kwargs` both contain "
f"the keys {common_keys}. The same kwargs cannot be passed to both "
"defaults."
)
Copy link
Member

@jeremiedbb jeremiedbb Oct 7, 2025

Choose a reason for hiding this comment

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

I don't think that passing the same keys should be a problem. I can imagine a case where you have a slightly different default for multi curves. To me the default_multi_curve_kwargs would just override the default_kurve_kwargs. What do you think ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes I agree. I was being too defensive and didn't think that this is an internal function and will not be used by users. I've amended the functionality.

@lucyleeow
Copy link
Member Author

Looks like there is an upstream service disruption to circle CI (https://status.circleci.com/), which is why the jobs are failing, so I think we can ignore for the reviews.

cc @jeremiedbb

Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

It look good on my side. Thanks @lucyleeow

@lucyleeow lucyleeow added the Waiting for Second Reviewer First reviewer is done, need a second one! label Oct 25, 2025
@lucyleeow
Copy link
Member Author

Gentle ping @jeremiedbb , thank you

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

Thanks @lucyleeow, LGTM as well.

@ogrisel ogrisel merged commit 5835ccc into scikit-learn:main Nov 17, 2025
38 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Visualization and displays Nov 17, 2025
@lucyleeow lucyleeow deleted the keep_multi_default_display branch November 18, 2025 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:metrics module:utils Waiting for Second Reviewer First reviewer is done, need a second one!

Projects

Development

Successfully merging this pull request may close these issues.

4 participants