Spaces:
Runtime error
Runtime error
add min max
Browse files
app.py
CHANGED
|
@@ -274,6 +274,12 @@ def plot_bars(
|
|
| 274 |
|
| 275 |
return fig
|
| 276 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 277 |
|
| 278 |
def update_graph(
|
| 279 |
base_folder,
|
|
@@ -307,7 +313,7 @@ def update_graph(
|
|
| 307 |
|
| 308 |
data = {path: result for path, result in zip(datasets, data)}
|
| 309 |
return plot_data(data, metric_name, normalization, rounding, grouping, top_k, direction, regex, log_scale_x,
|
| 310 |
-
log_scale_y, progress), data, export_data(data, metric_name)
|
| 311 |
|
| 312 |
|
| 313 |
def plot_data(data, metric_name, normalization, rounding, grouping, top_k, direction, regex, log_scale_x, log_scale_y,
|
|
@@ -413,6 +419,8 @@ The data might not be 100% representative, due to the sampling and optimistic me
|
|
| 413 |
with gr.Row():
|
| 414 |
# export_data_button = gr.Button("Export data", visible=True, link=export_data_json)
|
| 415 |
export_data_json = gr.File(visible=False)
|
|
|
|
|
|
|
| 416 |
with gr.Column(scale=4):
|
| 417 |
with gr.Row(visible=False) as group_choices:
|
| 418 |
with gr.Column(scale=2):
|
|
@@ -484,7 +492,7 @@ The data might not be 100% representative, due to the sampling and optimistic me
|
|
| 484 |
direction_checkbox,
|
| 485 |
group_regex,
|
| 486 |
],
|
| 487 |
-
outputs=[graph_output, exported_data, export_data_json],
|
| 488 |
)
|
| 489 |
|
| 490 |
for inp in [normalization_checkbox, rounding, group_regex, direction_checkbox, top_select, log_scale_x_checkbox,
|
|
@@ -565,18 +573,20 @@ The data might not be 100% representative, due to the sampling and optimistic me
|
|
| 565 |
return {
|
| 566 |
normalization_checkbox: gr.Column(visible=True),
|
| 567 |
group_choices: gr.Column(visible=False),
|
|
|
|
| 568 |
}
|
| 569 |
else:
|
| 570 |
return {
|
| 571 |
normalization_checkbox: gr.Column(visible=False),
|
| 572 |
group_choices: gr.Column(visible=True),
|
|
|
|
| 573 |
}
|
| 574 |
|
| 575 |
|
| 576 |
grouping_dropdown.select(
|
| 577 |
fn=update_grouping_options,
|
| 578 |
inputs=[grouping_dropdown],
|
| 579 |
-
outputs=[normalization_checkbox, group_choices],
|
| 580 |
)
|
| 581 |
|
| 582 |
# Launch the application
|
|
|
|
| 274 |
|
| 275 |
return fig
|
| 276 |
|
| 277 |
+
def get_desc(data):
|
| 278 |
+
res = {name: list(dt.to_dict().keys()) for name, dt in data.items()}
|
| 279 |
+
return "\n".join([
|
| 280 |
+
f"**{name}**: min={min(dt)}, max={max(dt)}" for name, dt in res.items()
|
| 281 |
+
])
|
| 282 |
+
|
| 283 |
|
| 284 |
def update_graph(
|
| 285 |
base_folder,
|
|
|
|
| 313 |
|
| 314 |
data = {path: result for path, result in zip(datasets, data)}
|
| 315 |
return plot_data(data, metric_name, normalization, rounding, grouping, top_k, direction, regex, log_scale_x,
|
| 316 |
+
log_scale_y, progress), data, export_data(data, metric_name), get_desc(data)
|
| 317 |
|
| 318 |
|
| 319 |
def plot_data(data, metric_name, normalization, rounding, grouping, top_k, direction, regex, log_scale_x, log_scale_y,
|
|
|
|
| 419 |
with gr.Row():
|
| 420 |
# export_data_button = gr.Button("Export data", visible=True, link=export_data_json)
|
| 421 |
export_data_json = gr.File(visible=False)
|
| 422 |
+
with gr.Column(visible=False) as min_max_hist:
|
| 423 |
+
min_max_hist_data = gr.Markdown()
|
| 424 |
with gr.Column(scale=4):
|
| 425 |
with gr.Row(visible=False) as group_choices:
|
| 426 |
with gr.Column(scale=2):
|
|
|
|
| 492 |
direction_checkbox,
|
| 493 |
group_regex,
|
| 494 |
],
|
| 495 |
+
outputs=[graph_output, exported_data, export_data_json, min_max_hist_data],
|
| 496 |
)
|
| 497 |
|
| 498 |
for inp in [normalization_checkbox, rounding, group_regex, direction_checkbox, top_select, log_scale_x_checkbox,
|
|
|
|
| 573 |
return {
|
| 574 |
normalization_checkbox: gr.Column(visible=True),
|
| 575 |
group_choices: gr.Column(visible=False),
|
| 576 |
+
min_max_hist: gr.Column(visible=True),
|
| 577 |
}
|
| 578 |
else:
|
| 579 |
return {
|
| 580 |
normalization_checkbox: gr.Column(visible=False),
|
| 581 |
group_choices: gr.Column(visible=True),
|
| 582 |
+
min_max_hist: gr.Column(visible=False),
|
| 583 |
}
|
| 584 |
|
| 585 |
|
| 586 |
grouping_dropdown.select(
|
| 587 |
fn=update_grouping_options,
|
| 588 |
inputs=[grouping_dropdown],
|
| 589 |
+
outputs=[normalization_checkbox, group_choices, min_max_hist],
|
| 590 |
)
|
| 591 |
|
| 592 |
# Launch the application
|