Skip to content

Commit ba8d23a

Browse files
author
Corey Chivers
committed
Remove confirmed cases & detection prob
These are irrelevent to the calculations and only cause user confusion.
1 parent ce6fa6c commit ba8d23a

File tree

4 files changed

+5
-46
lines changed

4 files changed

+5
-46
lines changed

src/penn_chime/models.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ def __init__(self, p: Parameters):
5959

6060
susceptible = p.population - infected
6161

62-
detection_probability = (
63-
p.known_infected / infected if infected > EPSILON else None
64-
)
65-
6662
intrinsic_growth_rate = get_growth_rate(p.doubling_time)
6763

6864
gamma = 1.0 / p.infectious_days
@@ -86,8 +82,6 @@ def __init__(self, p: Parameters):
8682
self.infected = infected
8783
self.recovered = p.recovered
8884

89-
self.detection_probability = detection_probability
90-
9185
self.beta = beta
9286
self.gamma = gamma
9387
self.beta_t = get_beta(intrinsic_growth_rate, self.gamma, self.susceptible, p.relative_contact_rate)

src/penn_chime/parameters.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@ def __init__(
3434
current_hospitalized: int,
3535
hospitalized: RateLos,
3636
icu: RateLos,
37-
known_infected: int,
3837
relative_contact_rate: float,
3938
ventilated: RateLos,
40-
4139
current_date: date = date.today(),
4240
date_first_hospitalized: Optional[date] = None,
4341
doubling_time: Optional[float] = None,
@@ -51,7 +49,6 @@ def __init__(
5149
):
5250

5351
self.current_hospitalized = current_hospitalized
54-
self.known_infected = known_infected
5552
self.relative_contact_rate = relative_contact_rate
5653

5754
self.hospitalized = hospitalized

src/penn_chime/presentation.py

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,6 @@
3333

3434
def display_header(st, m, p):
3535

36-
detection_prob_str = (
37-
"{detection_prob:.0%}".format(detection_prob=m.detection_probability)
38-
if m.detection_probability
39-
else "unknown"
40-
)
41-
42-
infection_warning_str = (
43-
"""(Warning: The number of known infections is greater than the estimate of infected patients based on inputs for current hospitalization, market share, and hospitalization rate. Please verify the market share value in the sidebar, and see if the hospitalization rate needs to be lowered.)"""
44-
if p.known_infected > m.infected
45-
else ""
46-
)
47-
4836
infected_population_warning_str = (
4937
"""(Warning: The number of estimated infections is greater than the total regional population. Please verify the values entered in the sidebar.)"""
5038
if m.infected > p.population
@@ -65,25 +53,19 @@ def display_header(st, m, p):
6553
st.markdown(
6654
"""[Documentation](https://code-for-philly.gitbook.io/chime/) | [Github](https://github.com/CodeForPhilly/chime/) | [Slack](https://codeforphilly.org/chat?channel=covid19-chime-penn)"""
6755
)
68-
st.markdown(
69-
"""**IMPORTANT NOTICE**: Admissions and Census calculations were previously **undercounting**. Please update your reports generated before """ + str(CHANGE_DATE) + """. See more about changes [here](https://github.com/CodeForPhilly/chime/labels/models)."""
70-
)
7156
st.markdown(
7257
"""*This tool was developed by the [Predictive Healthcare team](http://predictivehealthcare.pennmedicine.org/) at
7358
Penn Medicine to assist hospitals and public health officials with hospital capacity planning,
7459
but can be used anywhere in the world.
75-
Customize it for your region by modifying data inputs in the left panel.
76-
For questions on how to use this tool see the [User docs]({docs_url}). Code can be found on [Github](https://github.com/CodeForPhilly/chime)*.
60+
Customize it for your region by modifying data inputs in the left panel.*
7761
""".format(docs_url=DOCS_URL)
7862
)
7963

8064
st.markdown(
81-
"""The estimated number of currently infected individuals is **{total_infections:.0f}**. The **{initial_infections}**
82-
confirmed cases in the region imply a **{detection_prob_str}** rate of detection. This is based on current inputs for
65+
"""The estimated number of currently infected individuals is **{total_infections:.0f}**. This is based on current inputs for
8366
Hospitalizations (**{current_hosp}**), Hospitalization rate (**{hosp_rate:.0%}**), Region size (**{S}**),
8467
and Hospital market share (**{market_share:.0%}**).
8568
86-
{infection_warning_str}
8769
{infected_population_warning_str}
8870
8971
An initial doubling time of **{doubling_time}** days and a recovery time of **{recovery_days}** days imply an $R_0$ of
@@ -94,8 +76,6 @@ def display_header(st, m, p):
9476
and daily growth rate of **{daily_growth_t:.2f}%**.
9577
""".format(
9678
total_infections=m.infected,
97-
initial_infections=p.known_infected,
98-
detection_prob_str=detection_prob_str,
9979
current_hosp=p.current_hospitalized,
10080
hosp_rate=p.hospitalized.rate,
10181
S=p.population,
@@ -107,10 +87,9 @@ def display_header(st, m, p):
10787
r_t=m.r_t,
10888
doubling_time_t=abs(m.doubling_time_t),
10989
impact_statement=("halves the infections every" if m.r_t < 1 else "reduces the doubling time to"),
110-
daily_growth=m.daily_growth_rate + 100.0,
90+
daily_growth=m.daily_growth_rate * 100.0,
11191
daily_growth_t=m.daily_growth_rate_t * 100.0,
11292
docs_url=DOCS_URL,
113-
infection_warning_str=infection_warning_str,
11493
infected_population_warning_str=infected_population_warning_str
11594
)
11695
)
@@ -162,8 +141,6 @@ def display_sidebar(st, d: Parameters) -> Parameters:
162141
# to the variables they are set equal to
163142
# it's kindof like ember or angular if you are familiar with those
164143

165-
if d.known_infected < 1:
166-
raise ValueError("Known cases must be larger than one to enable predictions.")
167144
st_obj = st.sidebar
168145
current_hospitalized_input = NumberInput(
169146
st_obj,
@@ -257,14 +234,6 @@ def display_sidebar(st, d: Parameters) -> Parameters:
257234
step=1,
258235
format="%i",
259236
)
260-
known_infected_input = NumberInput(
261-
st_obj,
262-
"Currently Known Regional Infections (only used to compute detection rate - does not change projections)",
263-
min_value=0,
264-
value=d.known_infected,
265-
step=1,
266-
format="%i",
267-
)
268237
infectious_days_input = NumberInput(
269238
st_obj,
270239
"Infectious Days",
@@ -282,7 +251,7 @@ def display_sidebar(st, d: Parameters) -> Parameters:
282251
st.sidebar.markdown("### Regional Parameters [ℹ]({docs_url}/what-is-chime/parameters)".format(docs_url=DOCS_URL))
283252
population = population_input()
284253
market_share = market_share_pct_input()
285-
known_infected = known_infected_input()
254+
#known_infected = known_infected_input()
286255
current_hospitalized = current_hospitalized_input()
287256

288257
st.sidebar.markdown("### Spread and Contact Parameters [ℹ]({docs_url}/what-is-chime/parameters)"
@@ -318,7 +287,7 @@ def display_sidebar(st, d: Parameters) -> Parameters:
318287
current_hospitalized=current_hospitalized,
319288
hospitalized=RateLos(hospitalized_rate, hospitalized_los),
320289
icu=RateLos(icu_rate, icu_los),
321-
known_infected=known_infected,
290+
#known_infected=known_infected,
322291
relative_contact_rate=relative_contact_rate,
323292
ventilated=RateLos(ventilated_rate, ventilated_los),
324293

src/penn_chime/settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
hospitalized=RateLos(0.025, 7),
1919
icu=RateLos(0.0075, 9),
2020
infectious_days=14,
21-
known_infected=510,
2221
market_share=0.15,
2322
n_days=75,
2423
relative_contact_rate=0.3,

0 commit comments

Comments
 (0)