X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/predictops.git/blobdiff_plain/288baa6ff06c1b815ec24d164770acc93ac80499..a2faba3f0797b7be72d0c8fa9cb9db67456136d6:/predictops/engine.py?ds=sidebyside diff --git a/predictops/engine.py b/predictops/engine.py index f87e82e..e7bbf1c 100644 --- a/predictops/engine.py +++ b/predictops/engine.py @@ -6,6 +6,7 @@ from pathlib import Path from shutil import rmtree from .source.ephemeris import Ephemeris +from .source.holidays import Holidays from .source.meteofrance import MeteoFrance from .learn.learning import Learning from .learn.preprocessing import Preprocessing @@ -66,6 +67,17 @@ class Engine: for date in dated_features: self._X.setdefault(date,{}).update(dated_features[date]) + if self._config['FEATURES'].getboolean('holidays'): + holidays = Holidays(config_file = + eval(self._config['FEATURE_CONFIG']['holidays'])) + + holidays.start = self._start + holidays.end = self._end + + dated_features = holidays.dated_features + for date in dated_features: + self._X.setdefault(date,{}).update(dated_features[date]) + def add_target(self): self._target = Target(config_file = eval(self._config['TARGET']['config']),