-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
REF: Separate window bounds calculation from aggregation functions #29428
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
Changes from 1 commit
7cb42b0
dfe6f39
c608b44
45c89c7
c288137
1d90df6
20d4490
782209f
592db08
6b1935e
c7df962
9cc2b03
fd51fec
ef09f13
1195461
71e08da
41f0775
5205174
a764caf
4c1915a
a9809ea
045a285
3c97e82
3844a3a
019c58e
b334926
8401061
4f628dd
1a5265d
e20682a
57c9621
23cc995
4be1bc4
2a13e9f
5f8751a
72703bd
43af04f
f1e7c7a
80df109
8294705
2cf048c
09ae258
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,13 @@ | |
|
||
import numpy as np | ||
from numpy cimport ndarray, int64_t | ||
cnp.import_array() | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there anything in this module that we can/should test independently of the rest of the imlpementation? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In a 2nd follow up PR, I am planning on allowing users to create their own "window indexers" to be passed into |
||
# ---------------------------------------------------------------------- | ||
# The indexer objects for rolling | ||
# These define start/end indexers to compute offsets | ||
|
||
|
||
jreback marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cpdef class MockFixedWindowIndexer: | ||
class MockFixedWindowIndexer: | ||
""" | ||
|
||
We are just checking parameters of the indexer, | ||
|
@@ -36,7 +35,7 @@ cpdef class MockFixedWindowIndexer: | |
return self.start, self.end | ||
|
||
|
||
cpdef class FixedWindowIndexer: | ||
class FixedWindowIndexer: | ||
""" | ||
create a fixed length window indexer object | ||
that has start & end, that point to offsets in | ||
|
@@ -70,7 +69,7 @@ cpdef class FixedWindowIndexer: | |
def get_window_bounds(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you type There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Python typing? These are defined in cython files still. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm interesting, though I think still can type. Anyhow for a try in a followup. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. on non-cdef/cpdef functions you can, no problem. i dont think it optimizes anything though There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. its optimizing readability :-> |
||
return self.start, self.end | ||
|
||
cpdef class VariableWindowIndexer: | ||
class VariableWindowIndexer: | ||
""" | ||
create a variable length window indexer object | ||
that has start & end, that point to offsets in | ||
|
@@ -115,7 +114,7 @@ cpdef class VariableWindowIndexer: | |
|
||
cdef: | ||
ndarray[int64_t] start, end | ||
int64_t start_bound, end_bound, N | ||
int64_t start_bound, end_bound | ||
Py_ssize_t i, j | ||
|
||
start = np.empty(N, dtype='int64') | ||
|
Uh oh!
There was an error while loading. Please reload this page.