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

Skip to content

ENH Better error message for check_scalar - #22218

Merged
glemaitre merged 13 commits into
scikit-learn:mainfrom
thomasjpfan:check_scalar_type_name
Feb 11, 2022
Merged

ENH Better error message for check_scalar#22218
glemaitre merged 13 commits into
scikit-learn:mainfrom
thomasjpfan:check_scalar_type_name

Conversation

@thomasjpfan

Copy link
Copy Markdown
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
Copy Markdown
Member

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

@thomasjpfan

Copy link
Copy Markdown
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
Copy Markdown
Member

I think yes.

@thomasjpfan

Copy link
Copy Markdown
Member Author

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

@glemaitre glemaitre left a comment

Copy link
Copy Markdown
Member

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.

@lorentzenchr lorentzenchr left a comment

Copy link
Copy Markdown
Member

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
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