-
Notifications
You must be signed in to change notification settings - Fork 137
Remove uses of numba_basic.global_numba_func
#1535
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
Remove uses of numba_basic.global_numba_func
#1535
Conversation
numba_basic.global_numba_func
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (93.10%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #1535 +/- ##
==========================================
- Coverage 81.86% 81.86% -0.01%
==========================================
Files 230 230
Lines 52508 52508
Branches 9339 9339
==========================================
- Hits 42987 42984 -3
- Misses 7089 7092 +3
Partials 2432 2432
🚀 New features to boost your workflow:
|
tests/link/numba/test_elemwise.py
Outdated
outputs = output_fn(*inputs) | ||
|
||
cm = contextlib.suppress() if exc is None else pytest.raises(exc) | ||
cm = contextlib.suppress() |
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.
just remove cm altogether
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.
And please put these test changes in a separate commit, or open a separate PR since they are not related to the refactor, and shouldn't be mixed in the git history
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, since you decided to cleanup unrelated test, there's an extra cleanup you can do
b34f817
to
dcd2576
Compare
Moved the changes to |
tests/link/numba/test_basic.py
Outdated
def py_global_numba_func(func): | ||
if hasattr(func, "py_func"): | ||
return func.py_func | ||
return func |
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.
These changes seem unrelated
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.
Rolled back these changes.
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.
small note, otherwise looks good
@@ -25,6 +25,7 @@ | |||
from pytensor.graph.fg import FunctionGraph | |||
from pytensor.graph.type import Type | |||
from pytensor.ifelse import IfElse | |||
from pytensor.link.numba.dispatch import basic as numba_basic |
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.
basic is the file where we are?
@numba_funcify.register(MakeSlice) | ||
def numba_funcify_MakeSlice(op, **kwargs): | ||
return global_numba_func(makeslice) | ||
@numba_basic.numba_njit |
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.
numba_njit is defined in this module
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.
Yep, cutting and pasting from the other file one without reading 😓
|
||
|
||
@numba_funcify.register(Shape) | ||
def numba_funcify_Shape(op, **kwargs): | ||
return global_numba_func(shape) | ||
@numba_basic.numba_njit |
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.
same here
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.
Removed, same above
Thanks @PabloRoque |
Description
Remove all instances if
numba_basic.global_numba_func
in the codebase as indicated in #1442Related Issue
numba_basic.global_numba_func(erfc)
#1442Checklist
Type of change
📚 Documentation preview 📚: https://pytensor--1535.org.readthedocs.build/en/1535/