app: Support floating point for Market Share
@@ -22,7 +22,9 @@ known_infections = 31
initial_infections = st.sidebar.number_input(
"Currently Known Regional Infections", value=known_infections, step=10, format="%i"
)
-current_hosp = st.sidebar.number_input("Currently Hospitalized COVID-19 Patients", value=2, step=1, format="%i")
+current_hosp = st.sidebar.number_input(
+ "Currently Hospitalized COVID-19 Patients", value=2, step=1, format="%i"
+)
doubling_time = st.sidebar.number_input(
"Doubling Time (days)", value=6, step=1, format="%i"
)
@@ -42,7 +44,7 @@ icu_los = st.sidebar.number_input("ICU LOS", value=9, step=1, format="%i")
vent_los = st.sidebar.number_input("Vent LOS", value=10, step=1, format="%i")
Penn_market_share = (
st.sidebar.number_input(
- "Hospital Market Share (%)", 0, 100, value=15, step=1, format="%i"
+ "Hospital Market Share (%)", 0.0, 100.0, value=15.0, step=1.0, format="%f"
)
/ 100.0
)
@@ -84,10 +86,12 @@ First, we need to express the two parameters $\\beta$ and $\\gamma$ in terms of
- The $\\gamma$ parameter represents 1 over the mean recovery time in days. Since the CDC is recommending 14 days of self-quarantine, we'll use $\\gamma = 1/14$.
- Next, the AHA says to expect a doubling time $T_d$ of 7-10 days. That means an early-phase rate of growth can be computed by using the doubling time formula:
-""")
+"""
+ )
st.latex("g = 2^{1/T_d} - 1")
- st.markdown("""
+ st.markdown(
+ """
- Since the rate of new infections in the SIR model is $g = \\beta S - \\gamma$, and we've already computed $\\gamma$, $\\beta$ becomes a function of the initial population size of susceptible individuals.
$$\\beta = (g + \\gamma)/s$$
@@ -252,7 +256,9 @@ st.markdown(
"""**Click the checkbox below to view additional data generated by this simulation**"""
)
if st.checkbox("Show Additional Projections"):
- st.subheader("The number of infected and recovered individuals in the hospital catchment region at any given moment")
+ st.subheader(
+ "The number of infected and recovered individuals in the hospital catchment region at any given moment"
+ )
fig, ax = plt.subplots(1, 1, figsize=(10, 4))
ax.plot(i, label="Infected")
ax.plot(r, label="Recovered")
