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

Skip to content

Added error checks for invalid combination of include_boundaries and min_value/max_value #22074

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

Closed
wants to merge 2 commits into from

Conversation

adityarg
Copy link
Contributor

@adityarg adityarg commented Dec 25, 2021

Reference Issues/PRs

Fixes #21948

What does this implement/fix? Explain your changes.

Added error checks to filter out invalid combination of include_boundaries and min_value/max_value.

@cmarmo
Copy link
Contributor

cmarmo commented Jan 9, 2022

Thanks for your pull request @adityarg.
Before any review, there are some lint errors that need to be fixed.

sklearn/utils/validation.py:1421:37: E231 missing whitespace after ','
   if include_boundaries in ("left","both") and min_val==None:
                                   ^
sklearn/utils/validation.py:1421:57: E711 comparison to None should be 'if cond is None:'
   if include_boundaries in ("left","both") and min_val==None:
                                                       ^
sklearn/utils/validation.py:1421:57: E225 missing whitespace around operator
   if include_boundaries in ("left","both") and min_val==None:
                                                       ^
sklearn/utils/validation.py:1423:13: F541 f-string is missing placeholders
           f"Invalid combination of `include_boundaries` and `min_val`"
           ^
sklearn/utils/validation.py:1425:38: E231 missing whitespace after ','
   if include_boundaries in ("right","both") and max_val==None:
                                    ^
sklearn/utils/validation.py:1425:58: E711 comparison to None should be 'if cond is None:'
   if include_boundaries in ("right","both") and max_val==None:
                                                        ^
sklearn/utils/validation.py:1425:58: E225 missing whitespace around operator
   if include_boundaries in ("right","both") and max_val==None:
                                                        ^
sklearn/utils/validation.py:1427:13: F541 f-string is missing placeholders
           f"Invalid combination of `include_boundaries` and `min_val`"
           ^

@cmarmo
Copy link
Contributor

cmarmo commented Jan 9, 2022

Sorry @adityarg , I just saw that another pull request was open before this one. It is already under review. Please, feel free to pick another issue.

@jeremiedbb
Copy link
Member

Thanks @adityarg but as said, it has been fixed by another PR (#22027).

@jeremiedbb jeremiedbb closed this Mar 13, 2022
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.

Include an informative error message in check_scalar for inconsistent inputs
3 participants