From a19276b26815da410346095359a9b3acbcc82bd2 Mon Sep 17 00:00:00 2001 From: RichieHakim Date: Mon, 18 Mar 2024 02:19:41 -0400 Subject: [PATCH] bug fix again --- bnpm/optimization.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bnpm/optimization.py b/bnpm/optimization.py index 4ef6c1a..cd170f1 100644 --- a/bnpm/optimization.py +++ b/bnpm/optimization.py @@ -320,6 +320,6 @@ def check( study.stop() if self.verbose: - best, value = (f"{val:3e}" for val in [self.best, trial.value] if val is not None) - print(f'Trial num: {self.num_trial}. Duration: {duration:.3f}s. Best value: {best:3e}. Current value: {value:3e}') if self.verbose else None + best, value = (f"{val:.3e}" if isinstance(val, float) else val for val in (self.best, trial.value)) + print(f'Trial num: {self.num_trial}. Duration: {duration:.3f}s. Best value: {best}. Current value: {value}') if self.verbose else None self.num_trial += 1