from jours_feries_france.compute import JoursFeries
from logging import getLogger
from logging.config import fileConfig
+from pathlib import Path
from vacances_scolaires_france import SchoolHolidayDates
import itertools
bankHolidaysEve = tuple(u-timedelta(days=1) for u in bankHolidays)
name = self._config['ZONE']['name']
date = self._start
+ Date = datetime.date(date)
+ tomorrow = date + timedelta(days=1)
+ Tomorrow = datetime.date(tomorrow)
d = SchoolHolidayDates()
+ dict_hour = {
+ 'bankHolidays' : Date in bankHolidays,
+ 'bankHolidaysEve': Date in bankHolidaysEve,
+ 'holidays': d.is_holiday_for_zone(Date, self._get_academic_zone(name, date)),
+ 'holidaysEve': d.is_holiday_for_zone(Tomorrow, self._get_academic_zone(name, tomorrow))
+ }
while date <= self._end:
- Date = datetime.date(date)
- tomorrow = date + timedelta(days=1)
- Tomorrow = datetime.date(tomorrow)
- dict_hour = {
- 'bankHolidays' : Date in bankHolidays,
- 'bankHolidaysEve': Date in bankHolidaysEve,
- 'holidays': d.is_holiday_for_zone(Date, self._get_academic_zone(name, date)),
- 'holidaysEve': d.is_holiday_for_zone(Tomorrow, self._get_academic_zone(name, tomorrow))
- }
self._dated_features[date] = dict_hour
+ current = date
date += timedelta(hours=1)
+ if date.day != current.day:
+ Date = datetime.date(date)
+ tomorrow = date + timedelta(days=1)
+ Tomorrow = datetime.date(tomorrow)
+ dict_hour = {
+ 'bankHolidays' : Date in bankHolidays,
+ 'bankHolidaysEve': Date in bankHolidaysEve,
+ 'holidays': d.is_holiday_for_zone(Date, self._get_academic_zone(name, date)),
+ 'holidaysEve': d.is_holiday_for_zone(Tomorrow, self._get_academic_zone(name, tomorrow))
+ }
return self._dated_features
\ No newline at end of file