Skip to content

Commit

Permalink
Merge pull request #8 from jvivian/fix-dashboard-bug
Browse files Browse the repository at this point in the history
Fix bug in runner
  • Loading branch information
jvivian authored Feb 4, 2024
2 parents d965469 + 1bcd890 commit 3e1158b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion covid19_drdfm/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
"PPP": ("Global", "Response"),
"CARES": ("Global", "Response"),
"School": ("Global", "Response"),
"School": ("Global", "Response"),
"Cons1": ("Global", "Consumption"),
"Cons2": ("Global", "Consumption"),
"Cons3": ("Global", "Consumption"),
Expand Down
9 changes: 3 additions & 6 deletions covid19_drdfm/streamlit/runner.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import time
from collections import defaultdict
from pathlib import Path

import pandas as pd
Expand All @@ -12,8 +13,7 @@

from covid19_drdfm.constants import FACTORS
from covid19_drdfm.dfm import state_process
from covid19_drdfm.processing import NAME_MAP, get_df, normalize
from collections import defaultdict
from covid19_drdfm.processing import get_df

st.set_page_config(layout="wide")
pio.templates.default = "plotly_white"
Expand All @@ -25,9 +25,6 @@
FACTORS_GROUPED = dict(FACTORS_GROUPED)
DEFAULTS = FACTORS_GROUPED

# DEFAULTS = {x: [NAME_MAP[z] for z in y] for x, y in FACTORS_GROUPED.items()}
# st.write(DEFAULTS)


def center_title(text):
return st.markdown(f"<h1 style='text-align: center; color: grey;'>{text}</h1>", unsafe_allow_html=True)
Expand Down Expand Up @@ -133,7 +130,7 @@ def get_data():
selectors = {}
for group, stcol in zip(sub.Group.unique(), [c1, c2, c3, c4, c5, c6]):
variables = sub[sub.Group == group].Variables
selectors[group] = stcol.multiselect(group, variables, DEFAULTS[group])
selectors[group] = stcol.multiselect(group, variables, variables)

# State selections
state_sel = st.multiselect("States", df.State.unique(), default=df.State.unique())
Expand Down

0 comments on commit 3e1158b

Please sign in to comment.