15
15
class Intro (Component ):
16
16
"""
17
17
"""
18
- localization_file = "intro.md "
18
+ localization_file = "intro.yml "
19
19
20
20
def get_html (self ) -> List [ComponentMeta ]: # pylint: disable=W0613
21
21
"""Initializes the header dash html
@@ -28,33 +28,31 @@ def build(self, model, pars):
28
28
if model and pars :
29
29
intro = self .content
30
30
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" ]
36
32
if model .infected > pars .population
37
33
else ""
38
34
)
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 (
40
42
total_infections = model .infected ,
41
43
current_hosp = pars .current_hospitalized ,
42
44
hosp_rate = pars .hospitalized .rate ,
43
45
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 ,
45
49
recovery_days = pars .infectious_days ,
46
50
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 (
48
53
relative_contact_rate = pars .relative_contact_rate ,
49
- r_t = model .r_t ,
50
54
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
59
57
)
60
58
return [result ]
0 commit comments