Skip to content

Commit d767e5e

Browse files
committed
Improve formatting. Add explanation for {linebreak} placeholder.
1 parent ef45193 commit d767e5e

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/optimagic/visualization/profile_plot.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,14 +271,22 @@ def _find_switch_points(solution_times: pd.DataFrame) -> NDArray[np.float64]:
271271

272272

273273
def _get_profile_plot_xlabel(runtime_measure: str, normalize_runtime: bool) -> str:
274+
# The '{linebreak}' placeholder is replaced with the backend-specific line break
275+
# in the corresponding plotting function.
276+
274277
if normalize_runtime:
275278
runtime_measure_to_xlabel = {
276-
"walltime": "Multiple of Minimal Wall Time"
277-
"{linebreak}Needed to Solve the Problem",
278-
"n_evaluations": "Multiple of Minimal Number of Function Evaluations"
279-
"{linebreak}Needed to Solve the Problem",
280-
"n_batches": "Multiple of Minimal Number of Batches"
281-
"{linebreak}Needed to Solve the Problem",
279+
"walltime": (
280+
"Multiple of Minimal Wall Time{linebreak}Needed to Solve the Problem"
281+
),
282+
"n_evaluations": (
283+
"Multiple of Minimal Number of Function Evaluations"
284+
"{linebreak}Needed to Solve the Problem"
285+
),
286+
"n_batches": (
287+
"Multiple of Minimal Number of Batches"
288+
"{linebreak}Needed to Solve the Problem"
289+
),
282290
}
283291
else:
284292
runtime_measure_to_xlabel = {

0 commit comments

Comments
 (0)