From e023960f6181ef7d3edd835ebcc13be89a26a707 Mon Sep 17 00:00:00 2001 From: RichieHakim Date: Mon, 18 Mar 2024 01:59:05 -0400 Subject: [PATCH] bug fix --- bnpm/optimization.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bnpm/optimization.py b/bnpm/optimization.py index b0ffb6b..4ef6c1a 100644 --- a/bnpm/optimization.py +++ b/bnpm/optimization.py @@ -320,5 +320,6 @@ def check( study.stop() if self.verbose: - print(f'Trial num: {self.num_trial}. Duration: {duration:.3f}s. Best value: {self.best:3e}. Current value:{trial.value:3e}') if self.verbose else None + 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 self.num_trial += 1