diff --git a/ui/demo_streamlit/views/experiments_set.py b/ui/demo_streamlit/views/experiments_set.py index 15b67b5..a02674d 100755 --- a/ui/demo_streamlit/views/experiments_set.py +++ b/ui/demo_streamlit/views/experiments_set.py @@ -59,12 +59,28 @@ def display_experiment_set_result(expset, experiments_df): def display_experiment_sets(experiment_sets): cols = st.columns(3) for idx, exp_set in enumerate(experiment_sets): + total_tries = sum(exp["num_try"] for exp in exp_set["experiments"]) + total_successes = sum(exp["num_success"] for exp in exp_set["experiments"]) + + status = "OK" if total_tries == total_successes else "FAILURE" + status_color = "green" if status == "OK" else "orange" + when = datetime.fromisoformat(exp_set["created_at"]).strftime("%d %B %Y") + with cols[idx % 3]: with st.container(border=True): + st.markdown( + f"
", + unsafe_allow_html=True, + ) + if st.button(f"{exp_set['name']}", key=f"exp_set_{idx}"): st.session_state["experimentset"] = exp_set st.rerun() + st.markdown(exp_set.get("readme", "No description available")) col1, col2, col3 = st.columns([1 / 6, 2 / 6, 3 / 6]) @@ -75,6 +91,13 @@ def display_experiment_sets(experiment_sets): with col3: st.caption(f"Created on {when}") + if status == "FAILURE": + with st.expander("Failure Analysis", expanded=False): + for exp in exp_set["experiments"]: + if exp["num_try"] == exp["num_success"]: + continue + st.write(f"{exp['id']} {exp['name']}") + def display_experiment_details(experimentset, experiments_df): experiment_ids = experiments_df["Id"].tolist()