From e58b75bd2b9c32aaef25d1cf327f0b3395753a01 Mon Sep 17 00:00:00 2001 From: Antoine CARME Date: Sun, 2 Apr 2023 15:20:01 +0200 Subject: [PATCH] Disable Timing Loggers by default #237. Added logging for main operations. --- pyaf/TS/SignalDecomposition.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pyaf/TS/SignalDecomposition.py b/pyaf/TS/SignalDecomposition.py index b3e38234f..39d3e9dfb 100644 --- a/pyaf/TS/SignalDecomposition.py +++ b/pyaf/TS/SignalDecomposition.py @@ -73,10 +73,12 @@ def reinterpret_by_signal_args(self, iTimes, iSignals, iHorizons, iExogenousData def train(self , iInputDS, iTimes, iSignals, iHorizons, iExogenousData = None): + logger = tsutil.get_pyaf_logger(); from . import SignalDecomposition_Trainer as tstrainer self.reinterpret_by_signal_args(iTimes, iSignals, iHorizons, iExogenousData) # tsutil.print_pyaf_detailed_info(iInputDS.shape, iInputDS.columns, self.mSignals, self.mDateColumns, self.mHorizons) + logger.info("TRAINING_ENGINE_START " + str({"Signals" : self.mSignals, "Horizons" : self.mHorizons})); lTimer = tsutil.cTimer(("TRAINING", {"Signals" : self.mSignals, "Horizons" : self.mHorizons})) for sig in self.mSignals: @@ -100,16 +102,19 @@ def train(self , iInputDS, iTimes, iSignals, iHorizons, iExogenousData = None): for (lSignal, lBestModel) in self.mBestModels.items(): lBestModel.clean_dataframes() del lTrainer + logger.info("TRAINING_ENGINE_END " + str(self.mTrainingTime)); def forecast(self , iInputDS, iHorizon): + logger = tsutil.get_pyaf_logger(); + logger.info("FORECASTING_ENGINE_START " + str({"Signals" : self.mSignals, "Horizons" : self.mHorizons})); from . import SignalDecomposition_Forecaster as tsforec lTimer = tsutil.cTimer(("FORECASTING", {"Signals" : self.mSignals, "Horizon" : iHorizon})) lForecaster = tsforec.cSignalDecompositionForecaster() lForecastFrame = lForecaster.forecast(self, iInputDS, iHorizon) del lForecaster - + logger.info("FORECASTING_ENGINE_END " + str(lTimer.get_elapsed_time())); return lForecastFrame; @@ -133,8 +138,6 @@ def get_competition_details(self): def getModelInfo(self): for lSignal in self.mSignals: self.mBestModels[lSignal].getInfo() - logger = tsutil.get_pyaf_logger(); - logger.info("TRAINING_TIME_IN_SECONDS " + str(self.mTrainingTime)); self.get_competition_details()