-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
BUG: throw ValueError for mismatched w dimensions and test for error #18199
Conversation
341cb13
to
11ac339
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @scb-school! A couple of suggestions. Also, the lint failure looks related, please could you check (python dev.py lint
) and fix this.
e0ee325
to
7716ad8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry missed this the first time around but it is important to call _validate_weights(w)
before performing the check so we don't break compatibility if the user parses a list
e430c03
to
eb10b52
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @scb-school and congratulations on your first contribution to SciPy, keep them coming!
Reference issue
Closes #17725
What does this implement/fix?
Fixes misleading error message in hamming function when dimensions of optional argument w do not match u and v. Also implements new test in test_distance.py that checks for the error.
Additional information
N/A