Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -129,16 +129,20 @@ def shade_top5(col: pd.Series) -> list[str]:
|
|
| 129 |
def build_leaderboard_styler(selected_methods=None, selected_metrics=None):
|
| 130 |
df = get_baseline_df(selected_methods, selected_metrics).round(4)
|
| 131 |
|
| 132 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
df["Method"] = df["Method"].apply(colour_method_html)
|
| 134 |
|
| 135 |
numeric_cols = [c for c in df.columns if c != "Method"]
|
| 136 |
|
| 137 |
-
# 2️⃣ add the green gradient only to numeric cols
|
| 138 |
styler = (
|
| 139 |
df.style
|
| 140 |
.apply(shade_top5, axis=0, subset=numeric_cols)
|
| 141 |
-
.format(precision=4)
|
| 142 |
)
|
| 143 |
return styler
|
| 144 |
|
|
|
|
| 129 |
def build_leaderboard_styler(selected_methods=None, selected_metrics=None):
|
| 130 |
df = get_baseline_df(selected_methods, selected_metrics).round(4)
|
| 131 |
|
| 132 |
+
|
| 133 |
+
df = (
|
| 134 |
+
df.sort_values("Method", key=lambda s: s.str.lower()) # A->Z
|
| 135 |
+
.reset_index(drop=True) # tidy row index
|
| 136 |
+
)
|
| 137 |
+
|
| 138 |
df["Method"] = df["Method"].apply(colour_method_html)
|
| 139 |
|
| 140 |
numeric_cols = [c for c in df.columns if c != "Method"]
|
| 141 |
|
|
|
|
| 142 |
styler = (
|
| 143 |
df.style
|
| 144 |
.apply(shade_top5, axis=0, subset=numeric_cols)
|
| 145 |
+
.format(precision=4)
|
| 146 |
)
|
| 147 |
return styler
|
| 148 |
|