-
Notifications
You must be signed in to change notification settings - Fork 1.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
Fix #8903. NumbaDeprecationWarning
s raised from @{gu,}vectorize
.
#8909
Conversation
…ze`. This adds localised suppressions for `NumbaDeprecationWarning`s that would have been raised from the code path for `@{gu,}vectorize` due to Numba's internal use of `@jit()` with the `nopython` kwarg not present. This is considered acceptable due to the following: Deprecation warnings from Numba's internal use of its own API should not be visible to users. Unfortunately there's no trivial programmatic way to work around the internal use of `@jit`-with-no-kwargs in this case as numerous code paths go through the same operations and user code may well be relying on "object mode" fall-back. What this patch does it makes it so that users will not see `NumbaDeprecationWarning`s for this internal use. However, if a user defines a `@{gu,}vectorize` function that ends up using the fall-back to the object mode pipeline during compilation, Numba will continue to raise numerous loud warnings about this happening which should provide a hint as to the problem and how to fix it. Numerous tests have been added to check combinations of kwargs/use of default kwargs being passed through to `@{gu,}vectorize`. These tests make sure that there are no additional `NumbaDeprecationWarning`s raised to do with Numba's internal use of `@jit()` in `@{gu,}vectorize` where the `nopython` kwarg is not supplied. Closes numba#8903
Note that 0d1969a fixes |
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.
Changes look good and I have manually verified that the warning is suppressed expectedly in various situations.
Fix numba#8903. `NumbaDeprecationWarning`s raised from `@{gu,}vectorize`.
This adds localised suppressions for
NumbaDeprecationWarning
s that would have been raised from the code path for@{gu,}vectorize
due to Numba's internal use of@jit()
with thenopython
kwarg not present.This is considered acceptable due to the following: Deprecation warnings from Numba's internal use of its own API should not be visible to users. Unfortunately there's no trivial programmatic way to work around the internal use of
@jit
-with-no-kwargs in this case as numerous code paths go through the same operations and user code may well be relying on "object mode" fall-back. What this patch does it makes it so that users will not seeNumbaDeprecationWarning
s for this internal use. However, if a user defines a@{gu,}vectorize
function that ends up using the fall-back to the object mode pipeline during compilation, Numba will continue to raise numerous loud warnings about this happening which should provide a hint as to the problem and how to fix it.Numerous tests have been added to check combinations of kwargs/use of default kwargs being passed through to
@{gu,}vectorize
. These tests make sure that there are no additionalNumbaDeprecationWarning
s raised to do with Numba's internal use of@jit()
in@{gu,}vectorize
where thenopython
kwarg is not supplied.Closes #8903