Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions smtcomp/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def find_disagreement_results(
)

def print_answers(d: List[Dict[str, Any]]) -> str:
return ",".join(map(lambda x: "{}({})".format(x["solver"], defs.Answer.name_of_int(x["answer"])), d))
return ", ".join(map(lambda x: "{}({})".format(x["solver"], defs.Answer.name_of_int(x["answer"])), d))

rich_print_pl(
"Disagreements",
Expand All @@ -397,10 +397,16 @@ def print_answers(d: List[Dict[str, Any]]) -> str:
footer="",
justify="left",
style="cyan",
no_wrap=False,
no_wrap=True,
custom=defs.Status.name_of_int,
),
Col("answers", "Disagreement", custom=print_answers, footer=""),
Col(
"answers",
"Disagreement",
custom=print_answers,
footer="",
no_wrap=False,
),
)


Expand Down
10 changes: 9 additions & 1 deletion smtcomp/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class Col:
justify: Literal["default", "left", "center", "right", "full"] = "right"
style: str | None = None
no_wrap: bool = False
min_width: int | None = None
custom: Callable[[Any], str] = str


Expand All @@ -81,7 +82,14 @@ def rich_print_pl(title: str, df: pl.DataFrame, *cols: Col) -> None:
table = Table(title=title)

for col in cols:
table.add_column(col.header, justify=col.justify, style=col.style, no_wrap=col.no_wrap)
table.add_column(
col.header,
justify=col.justify,
style=col.style,
no_wrap=col.no_wrap,
overflow="fold",
min_width=col.min_width,
)

for d in df.to_dicts():
l = list(map(lambda col: col.custom(d[col.name]), cols))
Expand Down