8000 ENH Better error message for check_scalar by thomasjpfan · Pull Request #22218 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

ENH Better error message for check_scalar #22218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Feb 11, 2022

Conversation

thomasjpfan
Copy link
Member

Reference Issues/PRs

Follow up to #20724

What does this implement/fix? Explain your changes.

Adjusts the error message to only include the class name and not the <class _> part of the str representation

CC @glemaitre

@glemaitre
Copy link
Member

It might be better understood to say integer and floating instead of number.Integral and number.Real.

@thomasjpfan
Copy link
Member Author

It might be better understood to say integer and floating instead of number.Integral and number.Real.

Is the only reason we use numbers.Integral + numbers.Real is to support np.int64 and friends?

@glemaitre
Copy link
Member

I think yes.

@thomasjpfan
Copy link
Member Author

I updated this PR to use int and float instead of numbers.Integral and numbers.Real.

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.

LGTM. Since this is something that we discussed with @ogrisel, I just wanted to be sure that this is in line with what he was proposing.

Copy link
Member
8000
@lorentzenchr lorentzenchr left a comment

Choose a reason for hiding this comment

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

I like it.

@glemaitre glemaitre merged commit 4ff0767 into scikit-learn:main Feb 11, 2022
thomasjpfan added a commit to thomasjpfan/scikit-learn that referenced this pull request Mar 1, 2022
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
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.

4 participants
0