Skip to content

Commit c420419

Browse files
authored
CLN: remove unused fields.pyx code/asvs (#44150)
1 parent 7a26dac commit c420419

File tree

2 files changed

+1
-56
lines changed

2 files changed

+1
-56
lines changed

asv_bench/benchmarks/tslibs/fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class TimeGetTimedeltaField:
1313
params = [
1414
_sizes,
15-
["days", "h", "s", "seconds", "ms", "microseconds", "us", "ns", "nanoseconds"],
15+
["days", "seconds", "microseconds", "nanoseconds"],
1616
]
1717
param_names = ["size", "field"]
1818

pandas/_libs/tslibs/fields.pyx

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -487,28 +487,6 @@ def get_timedelta_field(const int64_t[:] tdindex, str field):
487487
out[i] = tds.days
488488
return out
489489

490-
elif field == 'h':
491-
with nogil:
492-
for i in range(count):
493-
if tdindex[i] == NPY_NAT:
494-
out[i] = -1
495-
continue
496-
497-
td64_to_tdstruct(tdindex[i], &tds)
498-
out[i] = tds.hrs
499-
return out
500-
501-
elif field == 's':
502-
with nogil:
503-
for i in range(count):
504-
if tdindex[i] == NPY_NAT:
505-
out[i] = -1
506-
continue
507-
508-
td64_to_tdstruct(tdindex[i], &tds)
509-
out[i] = tds.sec
510-
return out
511-
512490
elif field == 'seconds':
513491
with nogil:
514492
for i in range(count):
@@ -520,17 +498,6 @@ def get_timedelta_field(const int64_t[:] tdindex, str field):
520498
out[i] = tds.seconds
521499
return out
522500

523-
elif field == 'ms':
524-
with nogil:
525-
for i in range(count):
526-
if tdindex[i] == NPY_NAT:
527-
out[i] = -1
528-
continue
529-
530-
td64_to_tdstruct(tdindex[i], &tds)
531-
out[i] = tds.ms
532-
return out
533-
534501
elif field == 'microseconds':
535502
with nogil:
536503
for i in range(count):
@@ -542,28 +509,6 @@ def get_timedelta_field(const int64_t[:] tdindex, str field):
542509
out[i] = tds.microseconds
543510
return out
544511

545-
elif field == 'us':
546-
with nogil:
547-
for i in range(count):
548-
if tdindex[i] == NPY_NAT:
549-
out[i] = -1
550-
continue
551-
552-
td64_to_tdstruct(tdindex[i], &tds)
553-
out[i] = tds.us
554-
return out
555-
556-
elif field == 'ns':
557-
with nogil:
558-
for i in range(count):
559-
if tdindex[i] == NPY_NAT:
560-
out[i] = -1
561-
continue
562-
563-
td64_to_tdstruct(tdindex[i], &tds)
564-
out[i] = tds.ns
565-
return out
566-
567512
elif field == 'nanoseconds':
568513
with nogil:
569514
for i in range(count):

0 commit comments

Comments
 (0)