mirror of
https://github.com/wassname/catalyst.git
synced 2026-09-09 11:19:23 +08:00
Merge pull request #1712 from quantopian/adjustment-cython-checker-recs
MAINT: Apply linter recommendations to adjustments module.
This commit is contained in:
@@ -456,7 +456,7 @@ cdef class Float641DArrayOverwrite(ArrayAdjustment):
|
|||||||
self.values = values
|
self.values = values
|
||||||
|
|
||||||
cpdef mutate(self, float64_t[:, :] data):
|
cpdef mutate(self, float64_t[:, :] data):
|
||||||
cdef Py_ssize_t fill_range, row, col
|
cdef Py_ssize_t i, row, col
|
||||||
cdef float64_t[:] values = self.values
|
cdef float64_t[:] values = self.values
|
||||||
for col in range(self.first_col, self.last_col + 1):
|
for col in range(self.first_col, self.last_col + 1):
|
||||||
for i, row in enumerate(range(self.first_row, self.last_row + 1)):
|
for i, row in enumerate(range(self.first_row, self.last_row + 1)):
|
||||||
@@ -520,7 +520,7 @@ cdef class Datetime641DArrayOverwrite(ArrayAdjustment):
|
|||||||
self.values = asarray([datetime_to_int(value) for value in values])
|
self.values = asarray([datetime_to_int(value) for value in values])
|
||||||
|
|
||||||
cpdef mutate(self, int64_t[:, :] data):
|
cpdef mutate(self, int64_t[:, :] data):
|
||||||
cdef Py_ssize_t row, col
|
cdef Py_ssize_t i, row, col
|
||||||
cdef int64_t[:] values = self.values
|
cdef int64_t[:] values = self.values
|
||||||
for col in range(self.first_col, self.last_col + 1):
|
for col in range(self.first_col, self.last_col + 1):
|
||||||
for i, row in enumerate(range(self.first_row, self.last_row + 1)):
|
for i, row in enumerate(range(self.first_row, self.last_row + 1)):
|
||||||
@@ -787,8 +787,6 @@ cdef class ObjectOverwrite(_ObjectAdjustment):
|
|||||||
cpdef mutate(self, object data):
|
cpdef mutate(self, object data):
|
||||||
# data is an object here because this is intended to be used with a
|
# data is an object here because this is intended to be used with a
|
||||||
# `zipline.lib.LabelArray`.
|
# `zipline.lib.LabelArray`.
|
||||||
cdef Py_ssize_t row, col
|
|
||||||
cdef object value = self.value
|
|
||||||
|
|
||||||
# We don't do this in a loop because we only want to look up the label
|
# We don't do this in a loop because we only want to look up the label
|
||||||
# code in the array's categories once.
|
# code in the array's categories once.
|
||||||
|
|||||||
Reference in New Issue
Block a user