def __init__(self): # pylint: disable=super-init-not-called self._calendar = self.p.calendar # pylint: disable=no-member if isinstance(self._calendar, string_types): from trading_calendars import get_calendar self._calendar = get_calendar(self._calendar) self.dcache = DatetimeIndex([0.0]) self.idcache = DataFrame(index=DatetimeIndex([0.0])) self.csize = datetime.timedelta(days=self.p.cachesize) # pylint: disable=no-member self._tz = self.p.tz # pylint: disable=no-member if self._tz is None: self._tz = self._calendar.tz elif isinstance(self._tz, string_types): self._tz = tzparse(self._tz)
def _gettz(self): '''To be overriden by subclasses which may auto-calculate the timezone''' return tzparse(self.p.tz)
def _gettzinput(self): '''Can be overriden by classes to return a timezone for input''' return tzparse(self.p.tzinput)