-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Clean up Scan
's Cython implementation
#774
Clean up Scan
's Cython implementation
#774
Conversation
024b29e
to
6da114f
Compare
6bb452b
to
7841bbd
Compare
ae3e4dc
to
bb2ac94
Compare
Codecov Report
@@ Coverage Diff @@
## main #774 +/- ##
==========================================
- Coverage 78.40% 78.34% -0.06%
==========================================
Files 152 152
Lines 47782 47793 +11
Branches 10881 10884 +3
==========================================
- Hits 37462 37444 -18
- Misses 7773 7797 +24
- Partials 2547 2552 +5
|
…multiple_outs_taps
bb2ac94
to
fea7597
Compare
i'm late but I think there is a bit more juice we can squeeze out of |
That sounds good. |
This PR moves all of the non-native Python, non-NumPy objects out of
Scan
's Cython implementation so that it has fewer interactions with Python and can—potentially—be turned into a pure C function (i.e.cdef
) without too much effort.Currently, the only function argument that isn't a native or NumPy object is the thunk for the inner-function. When the thunk is a
CThunk
, we can obtain aCapsule
object that I believe Cythoncdef
functions can use directly; however, that has not been implemented in this PR.Aside from these simple refactorings, both the Python and Cython implementations have been changed so that they use
np.empty
to allocate memory. That should provide a small improvement over the current use ofnp.zeros
.