-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Group shape/dtype validation logic in image_resample. #25152
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
Conversation
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.
Looks good to me. Ideally, this would get some pytest.raises(ValueError, "match")
for the updated error strings that are missing coverage.
Sure, added tests. |
src/_image_wrapper.cpp
Outdated
¶ms.interpolation, &convert_bool, ¶ms.resample, | ||
¶ms.alpha, &convert_bool, ¶ms.norm, ¶ms.radius)) { | ||
return NULL; | ||
} | ||
|
||
if (params.interpolation < 0 || params.interpolation >= _n_interpolation) { | ||
PyErr_Format(PyExc_ValueError, "invalid interpolation value %d", | ||
PyErr_Format(PyExc_ValueError, "INvalid interpolation value %d", |
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.
PyErr_Format(PyExc_ValueError, "INvalid interpolation value %d", | |
PyErr_Format(PyExc_ValueError, "Invalid interpolation value %d", |
(or was this on purpose?)
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.
oops, fixed.
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.
Minor capitalization thingy, but otherwise looks good! Anyone can merge after fixing that.
Move it all to a single place rather than having some of it interspersed with the dtype dispatch later. Also reorder the dtype dispatch to be consistent in the 2D and 3D cases, and remove _array from many local variable names.
Move it all to a single place rather than having some of it interspersed with the dtype dispatch later.
Also reorder the dtype dispatch to be consistent in the 2D and 3D cases, and remove _array from many local variable names.
PR Summary
PR Checklist
Documentation and Tests
pytest
passes)Release Notes
.. versionadded::
directive in the docstring and documented indoc/users/next_whats_new/
.. versionchanged::
directive in the docstring and documented indoc/api/next_api_changes/
next_whats_new/README.rst
ornext_api_changes/README.rst