From 7ecd56a8503449d23798fe090ed8cb299cb14bf9 Mon Sep 17 00:00:00 2001 From: jbrockmendel Date: Thu, 2 Jan 2020 20:41:24 -0800 Subject: [PATCH 1/2] BLD: address build warnings --- pandas/_libs/algos_take_helper.pxi.in | 2 +- pandas/_libs/hashtable.pyx | 2 +- pandas/_libs/tslibs/conversion.pxd | 2 +- pandas/_libs/window/aggregations.pyx | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pandas/_libs/algos_take_helper.pxi.in b/pandas/_libs/algos_take_helper.pxi.in index 420e08a3d68d4..995fabbedcb5d 100644 --- a/pandas/_libs/algos_take_helper.pxi.in +++ b/pandas/_libs/algos_take_helper.pxi.in @@ -116,7 +116,7 @@ def take_2d_axis0_{{name}}_{{dest}}(ndarray[{{c_type_in}}, ndim=2] values, IF {{True if c_type_in == c_type_out != "object" else False}}: cdef: - {{c_type_out}} *v + const {{c_type_out}} *v {{c_type_out}} *o # GH#3130 diff --git a/pandas/_libs/hashtable.pyx b/pandas/_libs/hashtable.pyx index 6e68a687de94a..59ba1705d2dbb 100644 --- a/pandas/_libs/hashtable.pyx +++ b/pandas/_libs/hashtable.pyx @@ -1,7 +1,7 @@ cimport cython from cpython.ref cimport PyObject, Py_INCREF -from cpython.mem cimport PyMem_Malloc, PyMem_Realloc, PyMem_Free +from cpython.mem cimport PyMem_Malloc, PyMem_Free from libc.stdlib cimport malloc, free diff --git a/pandas/_libs/tslibs/conversion.pxd b/pandas/_libs/tslibs/conversion.pxd index 0b77948027ad7..36e6b14be182a 100644 --- a/pandas/_libs/tslibs/conversion.pxd +++ b/pandas/_libs/tslibs/conversion.pxd @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from cpython.datetime cimport datetime, tzinfo +from cpython.datetime cimport datetime from numpy cimport int64_t, int32_t diff --git a/pandas/_libs/window/aggregations.pyx b/pandas/_libs/window/aggregations.pyx index 0348843abc129..e1dca63cd719b 100644 --- a/pandas/_libs/window/aggregations.pyx +++ b/pandas/_libs/window/aggregations.pyx @@ -56,10 +56,11 @@ cdef: cdef inline int int_max(int a, int b): return a if a >= b else b cdef inline int int_min(int a, int b): return a if a <= b else b -cdef inline bint is_monotonic_start_end_bounds(ndarray[int64_t, ndim=1] start, - ndarray[int64_t, ndim=1] end): +cdef inline bint is_monotonic_start_end_bounds(int64_t[:] start, + int64_t[:] end): return is_monotonic(start, False)[0] and is_monotonic(end, False)[0] + # Cython implementations of rolling sum, mean, variance, skewness, # other statistical moment functions # From 92f17ab0ff24a58ff46c9c63d18d8485527981d0 Mon Sep 17 00:00:00 2001 From: jbrockmendel Date: Sat, 4 Jan 2020 15:02:28 -0800 Subject: [PATCH 2/2] revert --- pandas/_libs/window/aggregations.pyx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pandas/_libs/window/aggregations.pyx b/pandas/_libs/window/aggregations.pyx index e1dca63cd719b..0348843abc129 100644 --- a/pandas/_libs/window/aggregations.pyx +++ b/pandas/_libs/window/aggregations.pyx @@ -56,11 +56,10 @@ cdef: cdef inline int int_max(int a, int b): return a if a >= b else b cdef inline int int_min(int a, int b): return a if a <= b else b -cdef inline bint is_monotonic_start_end_bounds(int64_t[:] start, - int64_t[:] end): +cdef inline bint is_monotonic_start_end_bounds(ndarray[int64_t, ndim=1] start, + ndarray[int64_t, ndim=1] end): return is_monotonic(start, False)[0] and is_monotonic(end, False)[0] - # Cython implementations of rolling sum, mean, variance, skewness, # other statistical moment functions #