Skip to content

Commit

Permalink
bug fix again
Browse files Browse the repository at this point in the history
  • Loading branch information
RichieHakim committed Mar 18, 2024
1 parent e023960 commit a19276b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bnpm/optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a19276b

Please sign in to comment.