Example #1
0
    def boom(self):
        if hasattr(self, "_boom_holiday"):
            return self._boom_holiday
        start_days = [R.to_boom_date(x) for x in self._start]
        end_days = [R.to_boom_date(x) for x in self._end]

        return boom.DateRangeHoliday(start_days, end_days)
    def _build_state_model(self):
        self._state_model = boom.ScalarRegressionHolidayStateModel(
            R.to_boom_date(self._time0), self._parent_model,
            self._prior.boom())

        holiday_factory = HolidayFactory()
        for holiday in self._holiday_list:
            self._state_model.add_holiday(
                holiday_factory.create_boom_holiday(holiday))
Example #3
0
 def nearest(self, date):
     """
     The date of the closest instance of this holiday to 'date'.
     """
     return R.to_pd_timestamp(
         self._boom_holiday.nearest(R.to_boom_date(date)))
Example #4
0
 def date_on_or_before(self, date):
     """
     Either 'date' or the first instance of the holiday before 'date'.
     """
     return R.to_pd_timestamp(
         self._boom_holiday.date_on_or_before(R.to_boom_date(date)))
Example #5
0
 def date_on_or_after(self, date):
     """
     Either 'date' or the first instance of the holiday after 'date'.
     """
     ans = self._boom_holiday.date_on_or_after(R.to_boom_date(date))
     return R.to_pd_timestamp(ans)
Example #6
0
 def active(self, arbitrary_date):
     """
     Returns True iff 'arbitrary_date' falls inisde the influence window for
     the holiday.
     """
     return self._boom_holiday.active(R.to_boom_date(arbitrary_date))