def runTerrPlantModel(self, config_properties, results_dict):
     if not results_dict:
         results_dict = {}
     #this is where properties are searched, converted as needed, and any available methods are called
     A = None
     if 'application_lbs_rate' in config_properties:
         A = config_properties['application_lbs_rate']
     I = None
     if 'incorporation_depth' in config_properties:
         I = config_properties['incorporation_depth']
     R = None
     if 'runoff' in config_properties:
         R = config_properties['runoff']
     D = None
     if 'spray_drift' in config_properties:
         D = config_properties['spray_drift']
     nms = None
     if 'EC25_for_nonlisted_seedling_emergence_monocot' in config_properties:
         nms = config_properties[
             'EC25_for_nonlisted_seedling_emergence_monocot']
     lms = None
     if 'NOAEC_for_listed_seedling_emergence_monocot' in config_properties:
         lms = config_properties[
             'NOAEC_for_listed_seedling_emergence_monocot']
     nds = None
     if 'EC25_for_nonlisted_seedling_emergence_dicot' in config_properties:
         nds = config_properties[
             'EC25_for_nonlisted_seedling_emergence_dicot']
     lds = None
     if 'NOAEC_for_listed_vegetative_vigor_dicot' in config_properties:
         lds = config_properties['NOAEC_for_listed_vegetative_vigor_dicot']
     terr = terrplant_model.terrplant(True, True, A, I, R, D, nms, lms, nds,
                                      lds)
     results_dict['terrplant'] = vars(terr)
     return results_dict
 def runTerrPlantModel(self,config_properties,results_dict):
     if not results_dict:
         results_dict = {}
     #this is where properties are searched, converted as needed, and any available methods are called
     A = None
     if 'application_lbs_rate' in config_properties:
         A = config_properties['application_lbs_rate']
     I = None
     if 'incorporation_depth' in config_properties:
         I = config_properties['incorporation_depth']
     R = None
     if 'runoff' in config_properties:
         R = config_properties['runoff']
     D = None
     if 'spray_drift' in config_properties:
         D = config_properties['spray_drift']
     nms = None
     if 'EC25_for_nonlisted_seedling_emergence_monocot' in config_properties:
         nms = config_properties['EC25_for_nonlisted_seedling_emergence_monocot']
     lms = None
     if 'NOAEC_for_listed_seedling_emergence_monocot' in config_properties:
         lms = config_properties['NOAEC_for_listed_seedling_emergence_monocot']
     nds = None
     if 'EC25_for_nonlisted_seedling_emergence_dicot' in config_properties:
         nds = config_properties['EC25_for_nonlisted_seedling_emergence_dicot']
     lds = None
     if 'NOAEC_for_listed_vegetative_vigor_dicot' in config_properties:
         lds = config_properties['NOAEC_for_listed_vegetative_vigor_dicot']
     terr = terrplant_model.terrplant(True,True,A,I,R,D,nms,lms,nds,lds)
     results_dict['terrplant'] = vars(terr)
     return results_dict
def terrplantOutputPage(request):
    import terrplant_model

    version_terrplant = request.POST.get('version_terrplant')
    I = request.POST.get('incorporation')
    A = request.POST.get('application_rate')
    D = request.POST.get('drift_fraction')
    R = request.POST.get('runoff_fraction')
    nms = request.POST.get('EC25_for_nonlisted_seedling_emergence_monocot')
    nds = request.POST.get('EC25_for_nonlisted_seedling_emergence_dicot')
    lms = request.POST.get('NOAEC_for_listed_seedling_emergence_monocot')
    lds = request.POST.get('NOAEC_for_listed_seedling_emergence_dicot')
    #fill out terrplant object with yet to be used data
    chemical_name = request.POST.get('chemical_name')
    # terr.chemical_name = chemical_name
    pc_code = request.POST.get('pc_code')
    # terr.pc_code = pc_code
    use = request.POST.get('use')
    # terr.use = use
    application_method = request.POST.get('application_method')
    # terr.application_method = application_method
    application_form = request.POST.get('application_form')
    # terr.application_form = application_form
    solubility = request.POST.get('solubility')
    # terr.sol = sol
    terr = terrplant_model.terrplant(True, True, version_terrplant, "single",
                                     A, I, R, D, nms, lms, nds, lds,
                                     chemical_name, pc_code, use,
                                     application_method, application_form,
                                     solubility)

    nmv = request.POST.get('EC25_for_nonlisted_vegetative_vigor_monocot')
    terr.nmv = nmv
    ndv = request.POST.get('EC25_for_nonlisted_vegetative_vigor_dicot')
    terr.ndv = ndv
    lmv = request.POST.get('NOAEC_for_listed_vegetative_vigor_monocot')
    terr.lmv = lmv
    ldv = request.POST.get('NOAEC_for_listed_vegetative_vigor_dicot')
    terr.ldv = ldv

    return terr
示例#4
0
def terrplantOutputPage(request):
    import terrplant_model

    version_terrplant = request.POST.get('version_terrplant')
    I = request.POST.get('incorporation')
    A = request.POST.get('application_rate')
    D = request.POST.get('drift_fraction')
    R = request.POST.get('runoff_fraction')
    nms = request.POST.get('EC25_for_nonlisted_seedling_emergence_monocot')
    nds = request.POST.get('EC25_for_nonlisted_seedling_emergence_dicot')
    lms = request.POST.get('NOAEC_for_listed_seedling_emergence_monocot')
    lds = request.POST.get('NOAEC_for_listed_seedling_emergence_dicot')
    #fill out terrplant object with yet to be used data
    chemical_name = request.POST.get('chemical_name')
    # terr.chemical_name = chemical_name
    pc_code = request.POST.get('pc_code')
    # terr.pc_code = pc_code
    use = request.POST.get('use')
    # terr.use = use
    application_method = request.POST.get('application_method')
    # terr.application_method = application_method
    application_form = request.POST.get('application_form')
    # terr.application_form = application_form
    solubility = request.POST.get('solubility')
    # terr.sol = sol
    terr = terrplant_model.terrplant(True,True,version_terrplant,"single",A,I,R,D,nms,lms,nds,lds,chemical_name,pc_code,use,application_method,application_form,solubility)

    nmv = request.POST.get('EC25_for_nonlisted_vegetative_vigor_monocot')
    terr.nmv = nmv
    ndv = request.POST.get('EC25_for_nonlisted_vegetative_vigor_dicot')
    terr.ndv = ndv
    lmv = request.POST.get('NOAEC_for_listed_vegetative_vigor_monocot')
    terr.lmv = lmv
    ldv = request.POST.get('NOAEC_for_listed_vegetative_vigor_dicot')
    terr.ldv = ldv

    return terr
def html_table(row_inp_all):
    while True:
        row_inp_temp_all = row_inp_all.get()
        if row_inp_temp_all is None:
            break
        else:
            row_inp = row_inp_temp_all[0]
            iter = row_inp_temp_all[1]

            A_temp=float(row_inp[0])
            application_rate.append(A_temp)
            I_temp=float(row_inp[1])
            incorporation_depth.append(I_temp)
            R_temp=float(row_inp[2])
            runoff_fraction.append(R_temp)
            D_temp=float(row_inp[3])
            drift_fraction.append(D_temp)
            nms_temp=float(row_inp[4])
            ec25_nonlisted_seedling_emergence_monocot.append(nms_temp)
            lms_temp=float(row_inp[5])        
            ec25_nonlisted_seedling_emergence_dicot.append(lms_temp)
            nds_temp=float(row_inp[6])   
            noaec_listed_seedling_emergence_monocot.append(nds_temp)
            lds_temp=float(row_inp[7])
            noaec_listed_seedling_emergence_dicot.append(lds_temp)
            terr = terrplant_model.terrplant(True,True,"batch",A_temp,I_temp,R_temp,D_temp,nms_temp,lms_temp,nds_temp,lds_temp)
            logger.info("===============")
            rundry_temp=terr.rundry_results
            rundry_out.append(rundry_temp)
            runsemi_temp=terr.runsemi_results
            runsemi_out.append(runsemi_temp)
            spray_temp=terr.spray_results
            spray_out.append(spray_temp)
            totaldry_temp=terr.totaldry_results
            totaldry_out.append(totaldry_temp)
            totalsemi_temp=terr.totalsemi_results
            totalsemi_out.append(totalsemi_temp)
            nms_rq_dry_temp=terr.nms_rq_dry_results
            nms_rq_dry_out.append(nms_rq_dry_temp)
            LOCnmsdry_temp=terr.LOCnmsdry_results
            LOCnmsdry_out.append(LOCnmsdry_temp)
            nms_rq_semi_temp=terr.nms_rq_semi_results
            nms_rq_semi_out.append(nms_rq_semi_temp)
            LOCnmssemi_temp=terr.LOCnmssemi_results
            LOCnmssemi_out.append(LOCnmssemi_temp)
            nms_rq_spray_temp=terr.nms_rq_spray_results
            nms_rq_spray_out.append(nms_rq_spray_temp)
            LOCnmsspray_temp=terr.LOCnmsspray_results
            LOCnmsspray_out.append(LOCnmsspray_temp)
            lms_rq_dry_temp=terr.lms_rq_dry_results
            lms_rq_dry_out.append(lms_rq_dry_temp)
            LOClmsdry_temp=terr.LOClmsdry_results
            LOClmsdry_out.append(LOClmsdry_temp)
            lms_rq_semi_temp=terr.lms_rq_semi_results
            lms_rq_semi_out.append(lms_rq_semi_temp)
            LOClmssemi_temp=terr.LOClmssemi_results
            LOClmssemi_out.append(LOClmssemi_temp)
            lms_rq_spray_temp=terr.lms_rq_spray_results
            lms_rq_spray_out.append(lms_rq_spray_temp)
            LOClmsspray_temp=terr.LOClmsspray_results
            LOClmsspray_out.append(LOClmsspray_temp)
            nds_rq_dry_temp=terr.nds_rq_dry_results
            nds_rq_dry_out.append(nds_rq_dry_temp)
            LOCndsdry_temp=terr.LOCndsdry_results
            LOCndsdry_out.append(LOCndsdry_temp)
            nds_rq_semi_temp=terr.nds_rq_semi_results
            nds_rq_semi_out.append(nds_rq_semi_temp)
            LOCndssemi_temp=terr.LOCndssemi_results
            LOCndssemi_out.append(LOCndssemi_temp)
            nds_rq_spray_temp=terr.nds_rq_spray_results
            nds_rq_spray_out.append(nds_rq_spray_temp)
            LOCndsspray_temp=terr.LOCndsspray_results
            LOCndsspray_out.append(LOCndsspray_temp)
            lds_rq_dry_temp=terr.lds_rq_dry_results
            lds_rq_dry_out.append(lds_rq_dry_temp)
            LOCldsdry_temp=terr.LOCldsdry_results
            LOCldsdry_out.append(LOCldsdry_temp)
            lds_rq_semi_temp=terr.lds_rq_semi_results
            lds_rq_semi_out.append(lds_rq_semi_temp)
            LOCldssemi_temp=terr.LOCldssemi_results
            LOCldssemi_out.append(LOCldssemi_temp)
            lds_rq_spray_temp=terr.lds_rq_spray_results
            lds_rq_spray_out.append(lds_rq_spray_temp)
            LOCldsspray_temp=terr.LOCldsspray_results
            LOCldsspray_out.append(LOCldsspray_temp)

            jid_all.append(terr.jid)
            terr_all.append(terr)    
            if iter == 1:
                jid_batch.append(terr.jid)

            batch_header = """
                <div class="out_">
                    <br><H3>Batch Calculation of Iteration {0!s}:</H3>
                </div>
                """.format((iter))

            html_temp = terrplant_tables.table_all(terr)

            out_html_temp = batch_header + html_temp
            out_html_all[iter]=out_html_temp
def html_table(row_inp_all):
    while True:
        row_inp_temp_all = row_inp_all.get()
        if row_inp_temp_all is None:
            break
        else:
            row_inp = row_inp_temp_all[0]
            iter = row_inp_temp_all[1]

            A_temp=float(row_inp[0])
            A.append(A_temp)
            I_temp=float(row_inp[1])
            I.append(I_temp)
            R_temp=float(row_inp[2])
            R.append(R_temp)
            D_temp=float(row_inp[3])
            D.append(D_temp)
            nms_temp=float(row_inp[4])
            nms.append(nms_temp)
            lms_temp=float(row_inp[5])        
            lms.append(lms_temp)
            nds_temp=float(row_inp[6])   
            nds.append(nds_temp)
            lds_temp=float(row_inp[7])
            lds.append(lds_temp)
            terr = terrplant_model.terrplant(True,True,"batch",A_temp,I_temp,R_temp,D_temp,nms_temp,lms_temp,nds_temp,lds_temp)
            logger.info("===============")
            rundry_temp=terr.rundry_results
            rundry_out.append(rundry_temp)
            runsemi_temp=terr.runsemi_results
            runsemi_out.append(runsemi_temp)
            spray_temp=terr.spray_results
            spray_out.append(spray_temp)
            totaldry_temp=terr.totaldry_results
            totaldry_out.append(totaldry_temp)
            totalsemi_temp=terr.totalsemi_results
            totalsemi_out.append(totalsemi_temp)
            nmsRQdry_temp=terr.nmsRQdry_results
            nmsRQdry_out.append(nmsRQdry_temp)
            LOCnmsdry_temp=terr.LOCnmsdry_results
            LOCnmsdry_out.append(LOCnmsdry_temp)
            nmsRQsemi_temp=terr.nmsRQsemi_results
            nmsRQsemi_out.append(nmsRQsemi_temp)
            LOCnmssemi_temp=terr.LOCnmssemi_results
            LOCnmssemi_out.append(LOCnmssemi_temp)
            nmsRQspray_temp=terr.nmsRQspray_results
            nmsRQspray_out.append(nmsRQspray_temp)
            LOCnmsspray_temp=terr.LOCnmsspray_results
            LOCnmsspray_out.append(LOCnmsspray_temp)
            lmsRQdry_temp=terr.lmsRQdry_results
            lmsRQdry_out.append(lmsRQdry_temp)
            LOClmsdry_temp=terr.LOClmsdry_results
            LOClmsdry_out.append(LOClmsdry_temp)
            lmsRQsemi_temp=terr.lmsRQsemi_results
            lmsRQsemi_out.append(lmsRQsemi_temp)
            LOClmssemi_temp=terr.LOClmssemi_results
            LOClmssemi_out.append(LOClmssemi_temp)
            lmsRQspray_temp=terr.lmsRQspray_results
            lmsRQspray_out.append(lmsRQspray_temp)
            LOClmsspray_temp=terr.LOClmsspray_results
            LOClmsspray_out.append(LOClmsspray_temp)
            ndsRQdry_temp=terr.ndsRQdry_results
            ndsRQdry_out.append(ndsRQdry_temp)
            LOCndsdry_temp=terr.LOCndsdry_results
            LOCndsdry_out.append(LOCndsdry_temp)
            ndsRQsemi_temp=terr.ndsRQsemi_results
            ndsRQsemi_out.append(ndsRQsemi_temp)
            LOCndssemi_temp=terr.LOCndssemi_results
            LOCndssemi_out.append(LOCndssemi_temp)
            ndsRQspray_temp=terr.ndsRQspray_results
            ndsRQspray_out.append(ndsRQspray_temp)
            LOCndsspray_temp=terr.LOCndsspray_results
            LOCndsspray_out.append(LOCndsspray_temp)
            ldsRQdry_temp=terr.ldsRQdry_results
            ldsRQdry_out.append(ldsRQdry_temp)
            LOCldsdry_temp=terr.LOCldsdry_results
            LOCldsdry_out.append(LOCldsdry_temp)
            ldsRQsemi_temp=terr.ldsRQsemi_results
            ldsRQsemi_out.append(ldsRQsemi_temp)
            LOCldssemi_temp=terr.LOCldssemi_results
            LOCldssemi_out.append(LOCldssemi_temp)
            ldsRQspray_temp=terr.ldsRQspray_results
            ldsRQspray_out.append(ldsRQspray_temp)
            LOCldsspray_temp=terr.LOCldsspray_results
            LOCldsspray_out.append(LOCldsspray_temp)

            jid_all.append(terr.jid)
            terr_all.append(terr)    
            if iter == 1:
                jid_batch.append(terr.jid)

            batch_header = """
                <div class="out_">
                    <br><H3>Batch Calculation of Iteration %s:</H3>
                </div>
                """%(iter)

            html_temp = terrplant_tables.table_all(terr)

            out_html_temp = batch_header + html_temp
            out_html_all[iter]=out_html_temp
def html_table(row_inp_all):
    while True:
        row_inp_temp_all = row_inp_all.get()
        if row_inp_temp_all is None:
            break
        else:
            row_inp = row_inp_temp_all[0]
            iter = row_inp_temp_all[1]

            A_temp = float(row_inp[0])
            A.append(A_temp)
            I_temp = float(row_inp[1])
            I.append(I_temp)
            R_temp = float(row_inp[2])
            R.append(R_temp)
            D_temp = float(row_inp[3])
            D.append(D_temp)
            nms_temp = float(row_inp[4])
            nms.append(nms_temp)
            lms_temp = float(row_inp[5])
            lms.append(lms_temp)
            nds_temp = float(row_inp[6])
            nds.append(nds_temp)
            lds_temp = float(row_inp[7])
            lds.append(lds_temp)
            terr = terrplant_model.terrplant(True, True, "batch", A_temp,
                                             I_temp, R_temp, D_temp, nms_temp,
                                             lms_temp, nds_temp, lds_temp)
            logger.info("===============")
            rundry_temp = terr.rundry_results
            rundry_out.append(rundry_temp)
            runsemi_temp = terr.runsemi_results
            runsemi_out.append(runsemi_temp)
            spray_temp = terr.spray_results
            spray_out.append(spray_temp)
            totaldry_temp = terr.totaldry_results
            totaldry_out.append(totaldry_temp)
            totalsemi_temp = terr.totalsemi_results
            totalsemi_out.append(totalsemi_temp)
            nmsRQdry_temp = terr.nmsRQdry_results
            nmsRQdry_out.append(nmsRQdry_temp)
            LOCnmsdry_temp = terr.LOCnmsdry_results
            LOCnmsdry_out.append(LOCnmsdry_temp)
            nmsRQsemi_temp = terr.nmsRQsemi_results
            nmsRQsemi_out.append(nmsRQsemi_temp)
            LOCnmssemi_temp = terr.LOCnmssemi_results
            LOCnmssemi_out.append(LOCnmssemi_temp)
            nmsRQspray_temp = terr.nmsRQspray_results
            nmsRQspray_out.append(nmsRQspray_temp)
            LOCnmsspray_temp = terr.LOCnmsspray_results
            LOCnmsspray_out.append(LOCnmsspray_temp)
            lmsRQdry_temp = terr.lmsRQdry_results
            lmsRQdry_out.append(lmsRQdry_temp)
            LOClmsdry_temp = terr.LOClmsdry_results
            LOClmsdry_out.append(LOClmsdry_temp)
            lmsRQsemi_temp = terr.lmsRQsemi_results
            lmsRQsemi_out.append(lmsRQsemi_temp)
            LOClmssemi_temp = terr.LOClmssemi_results
            LOClmssemi_out.append(LOClmssemi_temp)
            lmsRQspray_temp = terr.lmsRQspray_results
            lmsRQspray_out.append(lmsRQspray_temp)
            LOClmsspray_temp = terr.LOClmsspray_results
            LOClmsspray_out.append(LOClmsspray_temp)
            ndsRQdry_temp = terr.ndsRQdry_results
            ndsRQdry_out.append(ndsRQdry_temp)
            LOCndsdry_temp = terr.LOCndsdry_results
            LOCndsdry_out.append(LOCndsdry_temp)
            ndsRQsemi_temp = terr.ndsRQsemi_results
            ndsRQsemi_out.append(ndsRQsemi_temp)
            LOCndssemi_temp = terr.LOCndssemi_results
            LOCndssemi_out.append(LOCndssemi_temp)
            ndsRQspray_temp = terr.ndsRQspray_results
            ndsRQspray_out.append(ndsRQspray_temp)
            LOCndsspray_temp = terr.LOCndsspray_results
            LOCndsspray_out.append(LOCndsspray_temp)
            ldsRQdry_temp = terr.ldsRQdry_results
            ldsRQdry_out.append(ldsRQdry_temp)
            LOCldsdry_temp = terr.LOCldsdry_results
            LOCldsdry_out.append(LOCldsdry_temp)
            ldsRQsemi_temp = terr.ldsRQsemi_results
            ldsRQsemi_out.append(ldsRQsemi_temp)
            LOCldssemi_temp = terr.LOCldssemi_results
            LOCldssemi_out.append(LOCldssemi_temp)
            ldsRQspray_temp = terr.ldsRQspray_results
            ldsRQspray_out.append(ldsRQspray_temp)
            LOCldsspray_temp = terr.LOCldsspray_results
            LOCldsspray_out.append(LOCldsspray_temp)

            jid_all.append(terr.jid)
            terr_all.append(terr)
            if iter == 1:
                jid_batch.append(terr.jid)

            batch_header = """
                <div class="out_">
                    <br><H3>Batch Calculation of Iteration %s:</H3>
                </div>
                """ % (iter)

            html_temp = terrplant_tables.table_all(terr)

            out_html_temp = batch_header + html_temp
            out_html_all[iter] = out_html_temp
    ldv.append(float(row[17]))
    nmsRQdry_results.append(float(row[18]))
    lmsRQdry_results.append(float(row[19]))
    ndsRQdry_results.append(float(row[20]))
    ldsRQdry_results.append(float(row[21]))
    nmsRQsemi_results.append(float(row[22]))
    lmsRQsemi_results.append(float(row[23]))
    ndsRQsemi_results.append(float(row[24]))
    ldsRQsemi_results.append(float(row[25]))
    nmsRQspray_results.append(float(row[26]))
    lmsRQspray_results.append(float(row[27]))
    ndsRQspray_results.append(float(row[28]))
    ldsRQspray_results.append(float(row[29]))


terrplant_obj = terrplant_model.terrplant(True,True,version_terrplant,"qaqc",A[0],I[0],R[0],D[0],nms[0],lms[0],nds[0],lds[0],chemical_name[0],pc_code[0],use[0],application_method[0],application_form[0],solubility[0])
terrplant_obj.chemical_name_expected = chemical_name[0]
terrplant_obj.pc_code_expected = pc_code[0]
terrplant_obj.use_expected = use[0]
terrplant_obj.application_method_expected = application_method[0]
terrplant_obj.application_form_expected = application_form[0]
terrplant_obj.solubility_expected = solubility[0]

# terrplant_obj.rundry_results_expected = out_fun_rundry[0]
# terrplant_obj.runsemi_results_expected = out_fun_runsemi[0]
# terrplant_obj.spray_results_expected = out_fun_spray[0]
# terrplant_obj.totaldry_results_expected = out_fun_totaldry[0]
# terrplant_obj.totalsemi_results_expected = out_fun_totalsemi[0]

terrplant_obj.nms_expected = nms[0]
terrplant_obj.nds_expected = nds[0]