Jellyfish042 commited on
Commit
31bf9ae
·
1 Parent(s): 7354013

better visualization

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -164,7 +164,8 @@ def update_table(period: str,
164
  if len(combined_data) > 0:
165
  sorted_data = combined_data.sort_values(by=sort_by, ascending=ascending)
166
  sorted_data = sorted_data.rename(columns={'Average (The lower the better)': 'Average (lower=better)'})
167
- visible_columns = ['Name', 'Parameters Count (B)', 'Average (lower=better)'] + visible_columns
 
168
  filtered_data = sorted_data[visible_columns]
169
 
170
  filtered_data.columns = [col.replace('_', ' ') for col in filtered_data.columns]
@@ -178,7 +179,7 @@ def update_table(period: str,
178
  vmin = {}
179
  vmax = {}
180
  for column in filtered_data.columns:
181
- if column in ['Name', 'Parameters Count (B)']:
182
  continue
183
  col_values = filtered_data[column]
184
  if len(col_values) > 1:
@@ -191,9 +192,10 @@ def update_table(period: str,
191
  target_color_columns.append('Average (lower=better)')
192
  if 'Individual Tests' in color_columns:
193
  target_color_columns.extend([col for col in filtered_data.columns if
194
- col not in ['Name', 'Parameters Count (B)', 'Average (lower=better)']])
195
 
196
- styler = filtered_data.style.format(formatter)
 
197
 
198
  for column in target_color_columns:
199
  if column in vmin and column in vmax: # Ensure that the vmin and vmax dicts contain the column
@@ -395,7 +397,7 @@ with gr.Blocks(css=css) as demo:
395
  choices=get_unique_column_names(all_data),
396
  value=get_unique_column_names(all_data))
397
 
398
- table = gr.Dataframe(initial_data, column_widths=[130, 60, 60, 35, 35, 35, 35, 35, 35, 35],
399
  wrap=True,
400
  height=800,
401
  )
 
164
  if len(combined_data) > 0:
165
  sorted_data = combined_data.sort_values(by=sort_by, ascending=ascending)
166
  sorted_data = sorted_data.rename(columns={'Average (The lower the better)': 'Average (lower=better)'})
167
+ sorted_data = sorted_data.rename(columns={'Parameters Count (B)': 'Params (B)'})
168
+ visible_columns = ['Name', 'Params (B)', 'Average (lower=better)'] + visible_columns
169
  filtered_data = sorted_data[visible_columns]
170
 
171
  filtered_data.columns = [col.replace('_', ' ') for col in filtered_data.columns]
 
179
  vmin = {}
180
  vmax = {}
181
  for column in filtered_data.columns:
182
+ if column in ['Name', 'Params (B)']:
183
  continue
184
  col_values = filtered_data[column]
185
  if len(col_values) > 1:
 
192
  target_color_columns.append('Average (lower=better)')
193
  if 'Individual Tests' in color_columns:
194
  target_color_columns.extend([col for col in filtered_data.columns if
195
+ col not in ['Name', 'Params (B)', 'Average (lower=better)']])
196
 
197
+
198
+ styler = filtered_data.style.format(formatter).applymap(color_cell, subset=['Params (B)'])
199
 
200
  for column in target_color_columns:
201
  if column in vmin and column in vmax: # Ensure that the vmin and vmax dicts contain the column
 
397
  choices=get_unique_column_names(all_data),
398
  value=get_unique_column_names(all_data))
399
 
400
+ table = gr.Dataframe(initial_data, column_widths=[130, 50, 50, 35, 35, 35, 35, 35, 35, 35],
401
  wrap=True,
402
  height=800,
403
  )