From 8e6924365da0ba057b7291af71e0144b1238196d Mon Sep 17 00:00:00 2001 From: Brock Date: Fri, 22 Oct 2021 12:48:21 -0700 Subject: [PATCH] CLN: remove unused fields.pyx code/asvs --- asv_bench/benchmarks/tslibs/fields.py | 2 +- pandas/_libs/tslibs/fields.pyx | 55 --------------------------- 2 files changed, 1 insertion(+), 56 deletions(-) diff --git a/asv_bench/benchmarks/tslibs/fields.py b/asv_bench/benchmarks/tslibs/fields.py index 0607a799ec707..23ae73811204c 100644 --- a/asv_bench/benchmarks/tslibs/fields.py +++ b/asv_bench/benchmarks/tslibs/fields.py @@ -12,7 +12,7 @@ class TimeGetTimedeltaField: params = [ _sizes, - ["days", "h", "s", "seconds", "ms", "microseconds", "us", "ns", "nanoseconds"], + ["days", "seconds", "microseconds", "nanoseconds"], ] param_names = ["size", "field"] diff --git a/pandas/_libs/tslibs/fields.pyx b/pandas/_libs/tslibs/fields.pyx index 4d55967c1e135..2c4b420656259 100644 --- a/pandas/_libs/tslibs/fields.pyx +++ b/pandas/_libs/tslibs/fields.pyx @@ -487,28 +487,6 @@ def get_timedelta_field(const int64_t[:] tdindex, str field): out[i] = tds.days return out - elif field == 'h': - with nogil: - for i in range(count): - if tdindex[i] == NPY_NAT: - out[i] = -1 - continue - - td64_to_tdstruct(tdindex[i], &tds) - out[i] = tds.hrs - return out - - elif field == 's': - with nogil: - for i in range(count): - if tdindex[i] == NPY_NAT: - out[i] = -1 - continue - - td64_to_tdstruct(tdindex[i], &tds) - out[i] = tds.sec - return out - elif field == 'seconds': with nogil: for i in range(count): @@ -520,17 +498,6 @@ def get_timedelta_field(const int64_t[:] tdindex, str field): out[i] = tds.seconds return out - elif field == 'ms': - with nogil: - for i in range(count): - if tdindex[i] == NPY_NAT: - out[i] = -1 - continue - - td64_to_tdstruct(tdindex[i], &tds) - out[i] = tds.ms - return out - elif field == 'microseconds': with nogil: for i in range(count): @@ -542,28 +509,6 @@ def get_timedelta_field(const int64_t[:] tdindex, str field): out[i] = tds.microseconds return out - elif field == 'us': - with nogil: - for i in range(count): - if tdindex[i] == NPY_NAT: - out[i] = -1 - continue - - td64_to_tdstruct(tdindex[i], &tds) - out[i] = tds.us - return out - - elif field == 'ns': - with nogil: - for i in range(count): - if tdindex[i] == NPY_NAT: - out[i] = -1 - continue - - td64_to_tdstruct(tdindex[i], &tds) - out[i] = tds.ns - return out - elif field == 'nanoseconds': with nogil: for i in range(count):