Skip to content

CLN: remove unused fields.pyx code/asvs #44150

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
Oct 23, 2021
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
2 changes: 1 addition & 1 deletion asv_bench/benchmarks/tslibs/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
55 changes: 0 additions & 55 deletions pandas/_libs/tslibs/fields.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand All @@ -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):
Expand Down