Skip to content

Commit

Permalink
Add colon at the end of single line headers
Browse files Browse the repository at this point in the history
  • Loading branch information
AVHopp committed Sep 6, 2024
1 parent 6e1cac9 commit 646fb95
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions baybe/utils/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ def to_string(header: str, *fields: Any, single_line: bool = False) -> str:
raise ValueError(
"``single_line`` is only applicable when given a single field."
)
# Since single line headers look ugly without a ":", we add it manually
header = header if header.endswith(":") else header + ":"
return f"{header} {str(fields[0])}"

return "\n".join([header] + [indent(str(f)) for f in fields])

0 comments on commit 646fb95

Please sign in to comment.