Skip to content

Commit

Permalink
rename header, sort backend name
Browse files Browse the repository at this point in the history
  • Loading branch information
FBruzzesi committed Jan 14, 2025
1 parent af27ffc commit 8d1fa5d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions utils/generate_backend_completeness.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def parse_module(module_name: str, backend: str, nw_class_name: str) -> list[str
def render_table_and_write_to_output(
results: list[pl.DataFrame], title: str, output_filename: str
) -> None:
results = (
results: pl.DataFrame = (
pl.concat(results)
.with_columns(supported=pl.lit(":white_check_mark:"))
.pivot(on="Backend", values="supported", index=["Method"])
Expand All @@ -103,7 +103,10 @@ def render_table_and_write_to_output(
.sort("Method")
)

results = results.with_columns(polars=pl.lit(":white_check_mark:"))
backends = [c for c in results.columns if c != "Method"] + ["polars"]
results = results.with_columns(polars=pl.lit(":white_check_mark:")).select(
"Method", *sorted(backends)
)

with pl.Config(
tbl_formatting="ASCII_MARKDOWN",
Expand Down Expand Up @@ -175,7 +178,9 @@ def get_backend_completeness_table() -> None:
continue

render_table_and_write_to_output(
results=results, title=module_name.capitalize(), output_filename=module_name
results=results,
title=module_name.capitalize().replace("_", "."),
output_filename=module_name,
)


Expand Down

0 comments on commit 8d1fa5d

Please sign in to comment.