From da68af85e5fd92eb32d1099256e9ce76a0a9615e Mon Sep 17 00:00:00 2001 From: Brock Mendel Date: Mon, 2 Oct 2017 12:20:35 -0700 Subject: [PATCH 1/3] Explicitly define cmp_pandas_datetimestruct --- pandas/_libs/src/datetime/np_datetime.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pandas/_libs/src/datetime/np_datetime.h b/pandas/_libs/src/datetime/np_datetime.h index a20bff60126aa..6bea3f7419318 100644 --- a/pandas/_libs/src/datetime/np_datetime.h +++ b/pandas/_libs/src/datetime/np_datetime.h @@ -99,6 +99,14 @@ convert_datetimestruct_to_datetime(pandas_datetime_metadata *meta, npy_int64 get_datetimestruct_days(const pandas_datetimestruct *dts); + +/* + * Compares two pandas_datetimestruct objects chronologically + */ +int cmp_pandas_datetimestruct(pandas_datetimestruct *a, + pandas_datetimestruct *b); + + /* * Adjusts a datetimestruct based on a minutes offset. Assumes * the current values are valid. From 0b9fff321328af1b172659c0d361eb5b6227b2ba Mon Sep 17 00:00:00 2001 From: Brock Mendel Date: Mon, 2 Oct 2017 18:09:37 -0700 Subject: [PATCH 2/3] remove include keys to kludge CI --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 793aa089e708f..80be007ba2115 100755 --- a/setup.py +++ b/setup.py @@ -511,7 +511,7 @@ def pxd(name): 'pxdfiles': ['_libs/src/util', '_libs/hashtable'], 'depends': _pxi_dep['join']}, '_libs.reshape': {'pyxfile': '_libs/reshape', - 'depends': _pxi_dep['reshape'], 'include': []}, + 'depends': _pxi_dep['reshape']}, '_libs.interval': {'pyxfile': '_libs/interval', 'pxdfiles': ['_libs/hashtable'], 'depends': _pxi_dep['interval']}, @@ -527,7 +527,7 @@ def pxd(name): 'pandas/_libs/src/parser/io.c']}, '_libs.sparse': {'pyxfile': '_libs/sparse', 'depends': (['pandas/_libs/sparse.pyx'] + - _pxi_dep['sparse']), 'include': []}, + _pxi_dep['sparse'])}, '_libs.testing': {'pyxfile': '_libs/testing', 'depends': ['pandas/_libs/testing.pyx']}, '_libs.hashing': {'pyxfile': '_libs/hashing', From 991dbfe0bcc8c25fddbf0712df19669725c03972 Mon Sep 17 00:00:00 2001 From: Brock Mendel Date: Tue, 3 Oct 2017 08:32:22 -0700 Subject: [PATCH 3/3] Add const declaration per reviewer suggestion --- pandas/_libs/src/datetime/np_datetime.c | 4 ++-- pandas/_libs/src/datetime/np_datetime.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/_libs/src/datetime/np_datetime.c b/pandas/_libs/src/datetime/np_datetime.c index ffb901981f939..f8254ed9d8418 100644 --- a/pandas/_libs/src/datetime/np_datetime.c +++ b/pandas/_libs/src/datetime/np_datetime.c @@ -269,8 +269,8 @@ static void set_datetimestruct_days(npy_int64 days, /* * Compares two pandas_datetimestruct objects chronologically */ -int cmp_pandas_datetimestruct(pandas_datetimestruct *a, - pandas_datetimestruct *b) { +int cmp_pandas_datetimestruct(const pandas_datetimestruct *a, + const pandas_datetimestruct *b) { if (a->year > b->year) { return 1; } else if (a->year < b->year) { diff --git a/pandas/_libs/src/datetime/np_datetime.h b/pandas/_libs/src/datetime/np_datetime.h index 6bea3f7419318..af3d2e0f01c1b 100644 --- a/pandas/_libs/src/datetime/np_datetime.h +++ b/pandas/_libs/src/datetime/np_datetime.h @@ -103,8 +103,8 @@ get_datetimestruct_days(const pandas_datetimestruct *dts); /* * Compares two pandas_datetimestruct objects chronologically */ -int cmp_pandas_datetimestruct(pandas_datetimestruct *a, - pandas_datetimestruct *b); +int cmp_pandas_datetimestruct(const pandas_datetimestruct *a, + const pandas_datetimestruct *b); /*