mgyigit commited on
Commit
77c09e0
·
verified ·
1 Parent(s): 8e77a26

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
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
- # 1️⃣ colour method names via inline-HTML
 
 
 
 
 
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) # keep numbers tidy
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