8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
check_scalar
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
Currently docstrings description for scalar ranges uses the interval syntax:
scikit-learn/sklearn/linear_model/_glm/glm.py
Line 462 in 42cc05c
While the error message uses a different notation:
from sklearn.utils.validation import check_scalar check_scalar(-1.0, "alpha", target_type=float, min_val=0.0) # ValueError: alpha == -1.0, must be >= 0.0.
Should we update this notation to be consistent with the docstring? i.e:
# ValueError: alpha == -1.0, must be in the range [0.0, inf)
(I am assuming that inf is always an open boundary)
inf
CC @glemaitre
The text was updated successfully, but these errors were encountered:
I'm a fan of this. The consistency is very nice.
Sorry, something went wrong.
I would be fine with this change.
I opened #22722 that proposes a common design for parameter validation, to go beyond check_scalar.
No branches or pull requests
Currently docstrings description for scalar ranges uses the interval syntax:
scikit-learn/sklearn/linear_model/_glm/glm.py
Line 462 in 42cc05c
While the error message uses a different notation:
Should we update this notation to be consistent with the docstring? i.e:
# ValueError: alpha == -1.0, must be in the range [0.0, inf)
(I am assuming that
inf
is always an open boundary)CC @glemaitre
The text was updated successfully, but these errors were encountered: