From: Jérôme Benoit Date: Fri, 3 Oct 2025 10:34:05 +0000 (+0200) Subject: refactor(reforcexy): cleanup optuna study best trial test X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=d03d40d45c9c1a584dc7bc3107b20c7184a02df4;p=freqai-strategies.git refactor(reforcexy): cleanup optuna study best trial test Signed-off-by: Jérôme Benoit --- diff --git a/ReforceXY/user_data/freqaimodels/ReforceXY.py b/ReforceXY/user_data/freqaimodels/ReforceXY.py index bcc1fc7..246c8be 100644 --- a/ReforceXY/user_data/freqaimodels/ReforceXY.py +++ b/ReforceXY/user_data/freqaimodels/ReforceXY.py @@ -967,7 +967,8 @@ class ReforceXY(BaseReinforcementLearningModel): ) hyperopt_failed = True time_spent = time.time() - start_time - if not ReforceXY.study_has_best_trial(study): + study_has_best_trial = ReforceXY.study_has_best_trial(study) + if not study_has_best_trial: logger.error( f"Hyperopt {study_name} failed ({time_spent:.2f} secs): no study best trial found" ) @@ -990,7 +991,7 @@ class ReforceXY(BaseReinforcementLearningModel): study_name, time_spent, ) - if ReforceXY.study_has_best_trial(study): + if study_has_best_trial: logger.info( "Best trial: %s. Score: %s", study.best_trial.number,