From 1b4bc3acecea2697eefc45685d29f24b371ba986 Mon Sep 17 00:00:00 2001 From: jvivian Date: Wed, 5 Jun 2024 19:11:28 -0700 Subject: [PATCH] Fix transforms not-applied in dashboard Fixes #83 --- covid19_drdfm/streamlit/Dashboard.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/covid19_drdfm/streamlit/Dashboard.py b/covid19_drdfm/streamlit/Dashboard.py index cfc4377..fa72324 100644 --- a/covid19_drdfm/streamlit/Dashboard.py +++ b/covid19_drdfm/streamlit/Dashboard.py @@ -77,8 +77,10 @@ def get_data(): # Transforms st.subheader("Transforms") c1, c2 = st.columns(2) - c1.multiselect("Difference", ad.var.index, default=ad.var[ad.var["difference"]].index.to_list()) - c2.multiselect("LogDifference", ad.var.index, default=ad.var[ad.var["logdiff"]].index.to_list()) + diff = c1.multiselect("Difference", ad.var.index, default=ad.var[ad.var["difference"]].index.to_list()) + logdiff = c2.multiselect("LogDifference", ad.var.index, default=ad.var[ad.var["logdiff"]].index.to_list()) + ad.var["difference"] = ad.var.index.isin(diff) + ad.var["logdiff"] = ad.var.index.isin(logdiff) # Variable Metadata with st.expander("Variable Metadata"): @@ -98,7 +100,6 @@ def get_data(): if not submitted: st.stop() - start = time.time() _, c, _ = st.columns([0.3, 0.4, 0.3]) c.write("Creating output directory and starting model run(s)")