def modelHistoryByVersion(model_obj):
    """
    Example method to return model object as HTML string 
    formatted by tables module. In practice, this method 
    should check model version to determine how to format 
    the model inputs and outputs.

    """
    import terrplant_tables
    modelOutputHTML = terrplant_tables.timestamp(model_obj)
    tables_output = terrplant_tables.table_all(model_obj)

    modelOutputHTML = modelOutputHTML + tables_output

    return modelOutputHTML
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