示例#1
0
def global_monitoring_settings():
    if covfr.covid_need_update() or covfr.positive_need_update():
        upcovfr, updaily, updaily_reg, upcv = CvCreation().cv_load(
            covid_state=covfr.covid_need_update(),
            positive_state=covfr.positive_need_update())
        global_select = request.form.getlist('global_parameters')
        rp = RenderPage("graphs.html", **upcv)
        rp.pcdim = int(global_select[0])
        rp.normalize = eval(global_select[1])
        rp.start_d_learn_fr = global_select[2].split(" - ")[0]
        rp.end_d_learn_fr = global_select[2].split(" - ")[1]
        rp.alpha = float(global_select[3])
        rp.charts_pca_global = upcovfr.pca_charts(
            data=updaily,
            pcdim=rp.pcdim,
            normalize=rp.normalize,
            start_d_learn=rp.start_d_learn_fr,
            end_d_learn=rp.end_d_learn_fr,
            alpha=rp.alpha)
        return rp.appview()

    global_select = request.form.getlist('global_parameters')
    rp = RenderPage("graphs.html", **cv)
    rp.pcdim = int(global_select[0])
    rp.normalize = eval(global_select[1])
    rp.start_d_learn_fr = global_select[2].split(" - ")[0]
    rp.end_d_learn_fr = global_select[2].split(" - ")[1]
    rp.alpha = float(global_select[3])
    rp.charts_pca_global = covfr.pca_charts(data=daily,
                                            pcdim=rp.pcdim,
                                            normalize=rp.normalize,
                                            start_d_learn=rp.start_d_learn_fr,
                                            end_d_learn=rp.end_d_learn_fr,
                                            alpha=rp.alpha)
    return rp.appview()
示例#2
0
def hosp_monitoring_settings():
    if covfr.covid_need_update() or covfr.positive_need_update():
        upcovfr, updaily, updaily_reg, upcv = CvCreation().cv_load(
            covid_state=covfr.covid_need_update(),
            positive_state=covfr.positive_need_update())
        hosp_select = request.form.getlist('hosp_parameters')
        rp = RenderPage("graphs.html", **upcv)
        rp.pcdim_reg = int(hosp_select[0])
        rp.normalize_reg = eval(hosp_select[1])
        rp.start_d_learn_fr_reg = hosp_select[2].split(" - ")[0]
        rp.end_d_learn_fr_reg = hosp_select[2].split(" - ")[1]
        rp.alpha_reg = float(hosp_select[3])
        rp.charts_pca_hosp_reg = upcovfr.pca_charts(
            data=updaily_reg,
            pcdim=rp.pcdim_reg,
            normalize=rp.normalize_reg,
            start_d_learn=rp.start_d_learn_fr_reg,
            end_d_learn=rp.end_d_learn_fr_reg,
            alpha=rp.alpha_reg)
        return rp.appview()

    hosp_select = request.form.getlist('hosp_parameters')
    rp = RenderPage("graphs.html", **cv)
    rp.pcdim_reg = int(hosp_select[0])
    rp.normalize_reg = eval(hosp_select[1])
    rp.start_d_learn_fr_reg = hosp_select[2].split(" - ")[0]
    rp.end_d_learn_fr_reg = hosp_select[2].split(" - ")[1]
    rp.alpha_reg = float(hosp_select[3])
    rp.charts_pca_hosp_reg = covfr.pca_charts(
        data=daily_reg,
        pcdim=rp.pcdim_reg,
        normalize=rp.normalize_reg,
        start_d_learn=rp.start_d_learn_fr_reg,
        end_d_learn=rp.end_d_learn_fr_reg,
        alpha=rp.alpha_reg)
    return rp.appview()