Skip to content

Commit 9f62964

Browse files
Merge branch 'develop' into btr-pr-template
2 parents 07c01d2 + 05799a1 commit 9f62964

File tree

3 files changed

+34
-30
lines changed

3 files changed

+34
-30
lines changed

src/chime_dash/app/components/intro.py

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class Intro(Component):
1616
"""
1717
"""
18-
localization_file = "intro.md"
18+
localization_file = "intro.yml"
1919

2020
def get_html(self) -> List[ComponentMeta]: # pylint: disable=W0613
2121
"""Initializes the header dash html
@@ -28,33 +28,31 @@ def build(self, model, pars):
2828
if model and pars:
2929
intro = self.content
3030
infected_population_warning_str = (
31-
"(Warning:"
32-
" The number of estimated infections is greater than"
33-
" the total regional population."
34-
" Please verify the values entered in the sidebar.)"
35-
""
31+
intro["infected-population-warning"]
3632
if model.infected > pars.population
3733
else ""
3834
)
39-
result = intro.format(
35+
mitigation_rt_str = (
36+
intro["mitigation-rt-less-than-1"]
37+
if model.r_t < 1
38+
else intro["mitigation-rt-more-than-equal-1"]
39+
)
40+
41+
result = intro["description-total-infection"].format(
4042
total_infections=model.infected,
4143
current_hosp=pars.current_hospitalized,
4244
hosp_rate=pars.hospitalized.rate,
4345
S=pars.population,
44-
market_share=pars.market_share,
46+
market_share=pars.market_share
47+
) + "\n\n" + infected_population_warning_str + "\n\n" + intro["description-doubling-time"].format(
48+
doubling_time=pars.doubling_time,
4549
recovery_days=pars.infectious_days,
4650
r_naught=model.r_naught,
47-
doubling_time=pars.doubling_time,
51+
daily_growth=model.daily_growth_rate * 100.0
52+
) + "\n\n" + mitigation_rt_str.format(
4853
relative_contact_rate=pars.relative_contact_rate,
49-
r_t=model.r_t,
5054
doubling_time_t=model.doubling_time_t,
51-
impact_statement=(
52-
"halves the infections every"
53-
if model.r_t < 1
54-
else "reduces the doubling time to"
55-
),
56-
daily_growth=model.daily_growth_rate * 100.0,
57-
daily_growth_t=model.daily_growth_rate_t * 100.0,
58-
infected_population_warning_str=infected_population_warning_str,
55+
r_t=model.r_t,
56+
daily_growth_t=model.daily_growth_rate_t * 100.0
5957
)
6058
return [result]

src/chime_dash/app/templates/en/intro.md

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
description-total-infection: "
2+
The estimated number of currently infected individuals is **{total_infections:.0f}**. This is based on current inputs for
3+
Hospitalizations (**{current_hosp}**), Hospitalization rate (**{hosp_rate:.0%}**), Regional population (**{S}**),
4+
and Hospital market share (**{market_share:.0%}**)."
5+
infected-population-warning: "
6+
(Warning: The number of estimated infections is greater than the total regional population. Please verify the values entered in the sidebar.)"
7+
description-doubling-time: "
8+
An initial doubling time of **{doubling_time}** days and a recovery time of **{recovery_days}** days imply an **`R0`** of
9+
**{r_naught:.2f}** and daily growth rate of **{daily_growth:.2f}%**."
10+
mitigation-rt-less-than-1: "
11+
**Mitigation**: A **{relative_contact_rate:.0%}** reduction in social contact after the onset of the
12+
outbreak **halves the infections every {doubling_time_t:.1f}** days, implying an effective **`R(t)`** of **{r_t:.2f}**
13+
and daily growth rate of **{daily_growth_t:.2f}%**."
14+
mitigation-rt-more-than-equal-1: "
15+
**Mitigation**: A **{relative_contact_rate:.0%}** reduction in social contact after the onset of the
16+
outbreak **reduces the doubling time to {doubling_time_t:.1f}** days, implying an effective **`R(t)`** of **{r_t:.2f}**
17+
and daily growth rate of **{daily_growth_t:.2f}%**."
18+

0 commit comments

Comments
 (0)