Skip to content

Commit

Permalink
add global status in ExpSet choice (#54)
Browse files Browse the repository at this point in the history
* add global status in ExpSet choice

* better exp failure

---------

Co-authored-by: Audrey_CLEVY <[email protected]>
Co-authored-by: dtrckd <[email protected]>
  • Loading branch information
3 people authored Dec 17, 2024
1 parent 6d6fae2 commit f9bd7ce
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions ui/demo_streamlit/views/experiments_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"<div style='position: absolute; top: 10px; right: 10px; "
f"width: 10px; height: 10px; border-radius: 50%; "
f"background-color: {status_color};' "
f"title='{status}'></div>",
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])
Expand All @@ -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()
Expand Down

0 comments on commit f9bd7ce

Please sign in to comment.