@@ -100,16 +100,10 @@ iNaT = NPY_NAT
100
100
101
101
102
102
from tslibs.timezones cimport (
103
- is_utc, is_tzlocal, _is_fixed_offset ,
103
+ is_utc, is_tzlocal, is_fixed_offset ,
104
104
treat_tz_as_dateutil, treat_tz_as_pytz,
105
105
get_timezone, get_utcoffset, maybe_get_tz,
106
- _get_dst_info
107
- )
108
- from tslibs.timezones import ( # noqa
109
- get_timezone, get_utcoffset, maybe_get_tz,
110
- _p_tz_cache_key, dst_cache,
111
- _unbox_utcoffsets,
112
- _dateutil_gettz
106
+ get_dst_info
113
107
)
114
108
115
109
@@ -168,7 +162,7 @@ def ints_to_pydatetime(ndarray[int64_t] arr, tz=None, freq=None, box=False):
168
162
pandas_datetime_to_datetimestruct(
169
163
value, PANDAS_FR_ns, & dts)
170
164
result[i] = func_create(value, dts, tz, freq)
171
- elif is_tzlocal(tz) or _is_fixed_offset (tz):
165
+ elif is_tzlocal(tz) or is_fixed_offset (tz):
172
166
for i in range (n):
173
167
value = arr[i]
174
168
if value == NPY_NAT:
@@ -182,7 +176,7 @@ def ints_to_pydatetime(ndarray[int64_t] arr, tz=None, freq=None, box=False):
182
176
dt = Timestamp(dt)
183
177
result[i] = dt
184
178
else :
185
- trans, deltas, typ = _get_dst_info (tz)
179
+ trans, deltas, typ = get_dst_info (tz)
186
180
187
181
for i in range (n):
188
182
@@ -1641,12 +1635,12 @@ cdef inline void _localize_tso(_TSObject obj, object tz):
1641
1635
obj.tzinfo = tz
1642
1636
else :
1643
1637
# Adjust datetime64 timestamp, recompute datetimestruct
1644
- trans, deltas, typ = _get_dst_info (tz)
1638
+ trans, deltas, typ = get_dst_info (tz)
1645
1639
1646
1640
pos = trans.searchsorted(obj.value, side = ' right' ) - 1
1647
1641
1648
1642
# static/pytz/dateutil specific code
1649
- if _is_fixed_offset (tz):
1643
+ if is_fixed_offset (tz):
1650
1644
# statictzinfo
1651
1645
if len (deltas) > 0 and obj.value != NPY_NAT:
1652
1646
pandas_datetime_to_datetimestruct(obj.value + deltas[0 ],
@@ -4066,7 +4060,7 @@ def tz_convert(ndarray[int64_t] vals, object tz1, object tz2):
4066
4060
* 1000000000 )
4067
4061
utc_dates[i] = v - delta
4068
4062
else :
4069
- trans, deltas, typ = _get_dst_info (tz1)
4063
+ trans, deltas, typ = get_dst_info (tz1)
4070
4064
4071
4065
# all-NaT
4072
4066
tt = vals[vals!= NPY_NAT]
@@ -4108,7 +4102,7 @@ def tz_convert(ndarray[int64_t] vals, object tz1, object tz2):
4108
4102
return result
4109
4103
4110
4104
# Convert UTC to other timezone
4111
- trans, deltas, typ = _get_dst_info (tz2)
4105
+ trans, deltas, typ = get_dst_info (tz2)
4112
4106
4113
4107
# use first non-NaT element
4114
4108
# if all-NaT, return all-NaT
@@ -4172,7 +4166,7 @@ cpdef int64_t tz_convert_single(int64_t val, object tz1, object tz2):
4172
4166
delta = int (get_utcoffset(tz1, dt).total_seconds()) * 1000000000
4173
4167
utc_date = val - delta
4174
4168
elif get_timezone(tz1) != ' UTC' :
4175
- trans, deltas, typ = _get_dst_info (tz1)
4169
+ trans, deltas, typ = get_dst_info (tz1)
4176
4170
pos = trans.searchsorted(val, side = ' right' ) - 1
4177
4171
if pos < 0 :
4178
4172
raise ValueError (' First time before start of DST info' )
@@ -4191,7 +4185,7 @@ cpdef int64_t tz_convert_single(int64_t val, object tz1, object tz2):
4191
4185
return utc_date + delta
4192
4186
4193
4187
# Convert UTC to other timezone
4194
- trans, deltas, typ = _get_dst_info (tz2)
4188
+ trans, deltas, typ = get_dst_info (tz2)
4195
4189
4196
4190
pos = trans.searchsorted(utc_date, side = ' right' ) - 1
4197
4191
if pos < 0 :
@@ -4261,7 +4255,7 @@ def tz_localize_to_utc(ndarray[int64_t] vals, object tz, object ambiguous=None,
4261
4255
" Length of ambiguous bool-array must be the same size as vals" )
4262
4256
ambiguous_array = np.asarray(ambiguous)
4263
4257
4264
- trans, deltas, typ = _get_dst_info (tz)
4258
+ trans, deltas, typ = get_dst_info (tz)
4265
4259
4266
4260
tdata = < int64_t* > trans.data
4267
4261
ntrans = len (trans)
@@ -4967,7 +4961,7 @@ cdef _normalize_local(ndarray[int64_t] stamps, object tz):
4967
4961
result[i] = _normalized_stamp(& dts)
4968
4962
else :
4969
4963
# Adjust datetime64 timestamp, recompute datetimestruct
4970
- trans, deltas, typ = _get_dst_info (tz)
4964
+ trans, deltas, typ = get_dst_info (tz)
4971
4965
4972
4966
_pos = trans.searchsorted(stamps, side = ' right' ) - 1
4973
4967
if _pos.dtype != np.int64:
@@ -5023,7 +5017,7 @@ def dates_normalized(ndarray[int64_t] stamps, tz=None):
5023
5017
if (dt.hour + dt.minute + dt.second + dt.microsecond) > 0 :
5024
5018
return False
5025
5019
else :
5026
- trans, deltas, typ = _get_dst_info (tz)
5020
+ trans, deltas, typ = get_dst_info (tz)
5027
5021
5028
5022
for i in range (n):
5029
5023
# Adjust datetime64 timestamp, recompute datetimestruct
0 commit comments