MCPcopy Index your code
hub / github.com/bayesian-optimization/BayesianOptimization / _format_str

Method _format_str

bayes_opt/logger.py:121–136  ·  view source on GitHub ↗

Format a str. Parameters ---------- str_ : str Value to format. Returns ------- A stringified, formatted version of `x`.

(self, str_: str)

Source from the content-addressed store, hash-verified

119 return f"{x_:<{self._default_cell_size}}"
120
121 def _format_str(self, str_: str) -> str:
122 """Format a str.
123
124 Parameters
125 ----------
126 str_ : str
127 Value to format.
128
129 Returns
130 -------
131 A stringified, formatted version of `x`.
132 """
133 s = f"{str_:^{self._default_cell_size}}"
134 if len(s) > self._default_cell_size:
135 return s[: self._default_cell_size - 3] + "..."
136 return s
137
138 def _print_step(
139 self,

Callers 2

test_format_strFunction · 0.95
_print_headerMethod · 0.95

Calls

no outgoing calls

Tested by 1

test_format_strFunction · 0.76