예제 #1
0
def plot_active_cases(country):
    data.process_data(country)
    model = Model(data.dtf)
    model.forecast()
    model.add_deaths(data.mortality)
    result = Result(model.dtf)
    return result.plot_active(model.today)
예제 #2
0
def render_output_panel(country):
    data.process_data(country)
    model = Model(data.dtf)
    model.forecast()
    model.add_deaths(data.mortality)
    result = Result(model.dtf)
    peak_day, num_max, total_cases_until_today, total_cases_in_30days, active_cases_today, active_cases_in_30days = result.get_panel(
    )
    peak_color = "white" if model.today > peak_day else "red"
    panel = html.Div([
        html.H4(country),
        dbc.Card(body=True,
                 className="text-white bg-primary",
                 children=[
                     html.H6("Total cases until today:",
                             style={"color": "white"}),
                     html.H3("{:,.0f}".format(total_cases_until_today),
                             style={"color": "white"}),
                     html.H6("Total cases in 30 days:",
                             className="text-danger"),
                     html.H3("{:,.0f}".format(total_cases_in_30days),
                             className="text-danger"),
                     html.H6("Active cases today:", style={"color": "white"}),
                     html.H3("{:,.0f}".format(active_cases_today),
                             style={"color": "white"}),
                     html.H6("Active cases in 30 days:",
                             className="text-danger"),
                     html.H3("{:,.0f}".format(active_cases_in_30days),
                             className="text-danger"),
                     html.H6("Peak day:", style={"color": peak_color}),
                     html.H3(peak_day.strftime("%Y-%m-%d"),
                             style={"color": peak_color}),
                     html.H6("with {:,.0f} cases".format(num_max),
                             style={"color": peak_color})
                 ])
    ])
    return panel
예제 #3
0
teacher2 = Teacher(first_name="Гунёва",
                   second_name="Раисия",
                   patronymic="Петровна")
"""----------------------------------------------------------------------"""
"""Предметы"""
subject1 = Subject(item_name="Математика", teacher=teacher1)
subject2 = Subject(item_name="Биология", teacher=teacher2)
"""----------------------------------------------------------------------"""
"""Темы занятий"""
topic1 = Topic(name_topic="Дроби")
topic2 = Topic(name_topic="Рациональные числа")
topic3 = Topic(name_topic="Анатомия человека")
topic4 = Topic(name_topic="Физиология человека")
"""----------------------------------------------------------------------"""
"""Изучается"""
studying1 = Studying(2, klass1, syllabus1, subject1, teacher1)
sub_topic = Subtheme(studying1, topic1)
sub_topic1 = Subtheme(studying1, topic2)
sub_topic2 = Subtheme(studying1, topic3)
sub_topic3 = Subtheme(studying1, topic4)
studying1.get_sub_themes().extend(
    [sub_topic, sub_topic1, sub_topic2, sub_topic3])
print(studying1)
print("----------------------------------------------------------------------")
"""----------------------------------------------------------------------"""
"""Результат"""

result1 = Result(5, datetime(2013, 9, 2), student1, topic1)
result2 = Result(4, datetime(2013, 9, 19), student2, topic3)
print(result1)
print(result2)