@@ -107,7 +107,13 @@ cdef int64_t NPY_NAT = util.get_nat()
107107iNaT =  NPY_NAT
108108
109109
110- from  tslibs.timezones cimport _is_utc
110+ from  tslibs.timezones cimport (
111+     _is_utc, _is_tzlocal,
112+     _treat_tz_as_dateutil, _treat_tz_as_pytz,
113+     _get_zone,
114+     _get_utcoffset)
115+ from  tslibs.timezones import  get_timezone, _get_utcoffset  #  noqa
116+ 
111117
112118cdef inline object  create_timestamp_from_ts(
113119        int64_t value, pandas_datetimestruct dts,
@@ -235,10 +241,6 @@ def ints_to_pytimedelta(ndarray[int64_t] arr, box=False):
235241    return  result
236242
237243
238- cdef inline bint _is_tzlocal(object  tz):
239-     return  isinstance (tz, _dateutil_tzlocal)
240- 
241- 
242244cdef inline bint _is_fixed_offset(object  tz):
243245    if  _treat_tz_as_dateutil(tz):
244246        if  len (tz._trans_idx) ==  0  and  len (tz._trans_list) ==  0 :
@@ -1443,11 +1445,6 @@ cdef class _TSObject:
14431445        def  __get__ self ):
14441446            return  self .value
14451447
1446- cpdef _get_utcoffset(tzinfo, obj):
1447-     try :
1448-         return  tzinfo._utcoffset
1449-     except  AttributeError :
1450-         return  tzinfo.utcoffset(obj)
14511448
14521449#  helper to extract datetime and int64 from several different possibilities
14531450cdef convert_to_tsobject(object  ts, object  tz, object  unit,
@@ -1712,48 +1709,6 @@ def _localize_pydatetime(object dt, object tz):
17121709        return  dt.replace(tzinfo = tz)
17131710
17141711
1715- def  get_timezone (tz ):
1716-     return  _get_zone(tz)
1717- 
1718- 
1719- cdef inline object  _get_zone(object  tz):
1720-     """ 
1721-     We need to do several things here: 
1722-     1) Distinguish between pytz and dateutil timezones 
1723-     2) Not be over-specific (e.g. US/Eastern with/without DST is same *zone* 
1724-        but a different tz object) 
1725-     3) Provide something to serialize when we're storing a datetime object 
1726-        in pytables. 
1727- 
1728-     We return a string prefaced with dateutil if it's a dateutil tz, else just 
1729-     the tz name. It needs to be a string so that we can serialize it with 
1730-     UJSON/pytables. maybe_get_tz (below) is the inverse of this process. 
1731-     """  
1732-     if  _is_utc(tz):
1733-         return  ' UTC' 
1734-     else :
1735-         if  _treat_tz_as_dateutil(tz):
1736-             if  ' .tar.gz' in  tz._filename:
1737-                 raise  ValueError (
1738-                     ' Bad tz filename. Dateutil on python 3 on windows has a ' 
1739-                     ' bug which causes tzfile._filename to be the same for all ' 
1740-                     ' timezone files. Please construct dateutil timezones ' 
1741-                     ' implicitly by passing a string like "dateutil/Europe' 
1742-                     ' /London" when you construct your pandas objects instead ' 
1743-                     ' of passing a timezone object. See ' 
1744-                     ' https://github.com/pandas-dev/pandas/pull/7362' 
1745-             return  ' dateutil/' +  tz._filename
1746-         else :
1747-             #  tz is a pytz timezone or unknown.
1748-             try :
1749-                 zone =  tz.zone
1750-                 if  zone is  None :
1751-                     return  tz
1752-                 return  zone
1753-             except  AttributeError :
1754-                 return  tz
1755- 
1756- 
17571712cpdef inline object  maybe_get_tz(object  tz):
17581713    """ 
17591714    (Maybe) Construct a timezone object from a string. If tz is a string, use 
@@ -4285,13 +4240,6 @@ def tz_convert_single(int64_t val, object tz1, object tz2):
42854240#  Timezone data caches, key is the pytz string or dateutil file name.
42864241dst_cache =  {}
42874242
4288- cdef inline bint _treat_tz_as_pytz(object  tz):
4289-     return  hasattr (tz, ' _utc_transition_times' and  hasattr (
4290-         tz, ' _transition_info' 
4291- 
4292- cdef inline bint _treat_tz_as_dateutil(object  tz):
4293-     return  hasattr (tz, ' _trans_list' and  hasattr (tz, ' _trans_idx' 
4294- 
42954243
42964244def  _p_tz_cache_key (tz ):
42974245    """  Python interface for cache function to facilitate testing.""" 
0 commit comments