Skip to content

CLN: remove build warnings in join_asof indexers #15188

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

Merged
merged 1 commit into from
Jan 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pandas/src/algos_common_helper.pxi.in
Original file line number Diff line number Diff line change
Expand Up @@ -374,22 +374,22 @@ def is_monotonic_{{name}}(ndarray[{{c_type}}] arr, bint timelike):
n = len(arr)

if n == 1:
if arr[0] != arr[0] or (timelike and arr[0] == iNaT):
if arr[0] != arr[0] or (timelike and <int64_t>arr[0] == iNaT):
# single value is NaN
return False, False, True
else:
return True, True, True
elif n < 2:
return True, True, True

if timelike and arr[0] == iNaT:
if timelike and <int64_t>arr[0] == iNaT:
return False, False, True

{{nogil_str}}
{{tab}}prev = arr[0]
{{tab}}for i in range(1, n):
{{tab}} cur = arr[i]
{{tab}} if timelike and cur == iNaT:
{{tab}} if timelike and <int64_t>cur == iNaT:
{{tab}} is_monotonic_inc = 0
{{tab}} is_monotonic_dec = 0
{{tab}} break
Expand Down
4 changes: 2 additions & 2 deletions pandas/src/algos_groupby_helper.pxi.in
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ def group_cummin_{{name}}(ndarray[{{dest_type2}}, ndim=2] out,
"""
cdef:
Py_ssize_t i, j, N, K, size
{{dest_type2}} val, min_val
{{dest_type2}} val, min_val = 0
int64_t lab

N, K = (<object> values).shape
Expand Down Expand Up @@ -615,7 +615,7 @@ def group_cummax_{{name}}(ndarray[{{dest_type2}}, ndim=2] out,
"""
cdef:
Py_ssize_t i, j, N, K, size
{{dest_type2}} val, max_val
{{dest_type2}} val, max_val = 0
int64_t lab

N, K = (<object> values).shape
Expand Down
17 changes: 8 additions & 9 deletions pandas/src/joins_func_helper.pxi.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def asof_join_backward_{{on_dtype}}_by_{{by_dtype}}(
Py_ssize_t left_pos, right_pos, left_size, right_size, found_right_pos
ndarray[int64_t] left_indexer, right_indexer
bint has_tolerance = 0
{{on_dtype}} tolerance_
{{on_dtype}} diff
{{on_dtype}} tolerance_ = 0
{{on_dtype}} diff = 0
{{table_type}} hash_table
{{by_dtype}} by_value

Expand Down Expand Up @@ -106,8 +106,8 @@ def asof_join_forward_{{on_dtype}}_by_{{by_dtype}}(
Py_ssize_t left_pos, right_pos, left_size, right_size, found_right_pos
ndarray[int64_t] left_indexer, right_indexer
bint has_tolerance = 0
{{on_dtype}} tolerance_
{{on_dtype}} diff
{{on_dtype}} tolerance_ = 0
{{on_dtype}} diff = 0
{{table_type}} hash_table
{{by_dtype}} by_value

Expand Down Expand Up @@ -236,8 +236,8 @@ def asof_join_backward_{{on_dtype}}(
Py_ssize_t left_pos, right_pos, left_size, right_size
ndarray[int64_t] left_indexer, right_indexer
bint has_tolerance = 0
{{on_dtype}} tolerance_
{{on_dtype}} diff
{{on_dtype}} tolerance_ = 0
{{on_dtype}} diff = 0

# if we are using tolerance, set our objects
if tolerance is not None:
Expand Down Expand Up @@ -290,8 +290,8 @@ def asof_join_forward_{{on_dtype}}(
Py_ssize_t left_pos, right_pos, left_size, right_size
ndarray[int64_t] left_indexer, right_indexer
bint has_tolerance = 0
{{on_dtype}} tolerance_
{{on_dtype}} diff
{{on_dtype}} tolerance_ = 0
{{on_dtype}} diff = 0

# if we are using tolerance, set our objects
if tolerance is not None:
Expand Down Expand Up @@ -371,4 +371,3 @@ def asof_join_nearest_{{on_dtype}}(
return left_indexer, right_indexer

{{endfor}}