-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
Error on C Warnings #32163
Error on C Warnings #32163
Changes from all commits
27f4cc1
965f7ec
4612820
86494d3
01cb64a
6d3d543
5c1fc8a
b197abb
3cfb20c
83095d8
b23a4ff
873230e
5fc220c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -378,25 +378,23 @@ def get_blkno_indexers(int64_t[:] blknos, bint group=True): | |
|
||
object blkno | ||
object group_dict = defaultdict(list) | ||
int64_t[:] res_view | ||
|
||
n = blknos.shape[0] | ||
|
||
if n == 0: | ||
return | ||
|
||
result = list() | ||
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. I think there are some "bugs" in Cython with generator functions that were yielding build warnings. I opened an issue on the tracker for it here: But for now figure OK to just convert to a list instead of a generator func anyway |
||
start = 0 | ||
cur_blkno = blknos[start] | ||
|
||
if group is False: | ||
if n == 0: | ||
pass | ||
elif group is False: | ||
for i in range(1, n): | ||
if blknos[i] != cur_blkno: | ||
yield cur_blkno, slice(start, i) | ||
result.append((cur_blkno, slice(start, i))) | ||
|
||
start = i | ||
cur_blkno = blknos[i] | ||
|
||
yield cur_blkno, slice(start, n) | ||
result.append((cur_blkno, slice(start, n))) | ||
else: | ||
for i in range(1, n): | ||
if blknos[i] != cur_blkno: | ||
|
@@ -409,19 +407,20 @@ def get_blkno_indexers(int64_t[:] blknos, bint group=True): | |
|
||
for blkno, slices in group_dict.items(): | ||
if len(slices) == 1: | ||
yield blkno, slice(slices[0][0], slices[0][1]) | ||
result.append((blkno, slice(slices[0][0], slices[0][1]))) | ||
else: | ||
tot_len = sum(stop - start for start, stop in slices) | ||
result = np.empty(tot_len, dtype=np.int64) | ||
res_view = result | ||
arr = np.empty(tot_len, dtype=np.int64) | ||
|
||
i = 0 | ||
for start, stop in slices: | ||
for diff in range(start, stop): | ||
res_view[i] = diff | ||
arr[i] = diff | ||
i += 1 | ||
|
||
yield blkno, result | ||
result.append((blkno, arr)) | ||
|
||
return result | ||
|
||
|
||
def get_blkno_placements(blknos, group: bool = True): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,7 @@ npy_datetime NpyDateTimeToEpoch(npy_datetime dt, NPY_DATETIMEUNIT base) { | |
} | ||
|
||
/* Convert PyDatetime To ISO C-string. mutates len */ | ||
char *PyDateTimeToIso(PyDateTime_Date *obj, NPY_DATETIMEUNIT base, | ||
char *PyDateTimeToIso(PyObject *obj, NPY_DATETIMEUNIT base, | ||
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. Apparently python/cpython#10238 (comment) So PyObject seems the right way to go here and gets rid of warnings |
||
size_t *len) { | ||
npy_datetimestruct dts; | ||
int ret; | ||
|
@@ -98,7 +98,7 @@ char *PyDateTimeToIso(PyDateTime_Date *obj, NPY_DATETIMEUNIT base, | |
return result; | ||
} | ||
|
||
npy_datetime PyDateTimeToEpoch(PyDateTime_Date *dt, NPY_DATETIMEUNIT base) { | ||
npy_datetime PyDateTimeToEpoch(PyObject *dt, NPY_DATETIMEUNIT base) { | ||
npy_datetimestruct dts; | ||
int ret; | ||
|
||
|
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.
im not sure this is accurate, might be a string dtype? IIRC this class isnt used