Skip to content

Commit d115fc1

Browse files
committed
use ternary operator to make computer happy
1 parent c9d56b6 commit d115fc1

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

bayes_opt/logger.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,7 @@ def _format_number(self, x: float) -> str:
7575
-------
7676
A stringified, formatted version of `x`.
7777
"""
78-
if abs(x) > 1e7 - 1:
79-
s = f"{x:.5e}"
80-
else:
81-
s = str(x)
78+
s = f"{x:.5e}" if abs(x) >= 10000000.0 else str(x)
8279

8380
if len(s) > self._default_cell_size:
8481
# Convert to str representation of scientific notation

0 commit comments

Comments
 (0)