Пример #1
0
def generateTableTextRemovedCols(verticalBorder, horizontalBorder,
                                 useBooktabs):
    print("Generating a table for table_variants_text_rc.tex ..")
    dimCx = Dim([("0.0", None), ("0.5", None)])
    dimSel = Dim([("T", None), ("L", None)])
    dimMethod = Dim([("U", None), ("P", None), ("S", None), ("IS", None)])
    dimSingleCol = Dim([("C", None), ("D", None)])
    main = dimSel * dimMethod * dimCx + dimSingleCol
    dimCols = main + Dim([("mean", None)])
    cells, rows_names = printer.latexToArrayRowNames(
        tableBody)  # maybe switch for pandas as a primary representation?
    dimRows = Dim.from_names(rows_names)

    rBold = printer.LatexTextbf(lambda v, b: v == "1.00")
    rShading = printer.CellShading(0.0, 0.5, 1.0, "colorLow", "colorMedium",
                                   "colorHigh")
    table = printer.Table(cells,
                          dimRows=dimRows,
                          dimCols=dimCols,
                          cellRenderers=[rBold, rShading],
                          verticalBorder=verticalBorder,
                          horizontalBorder=horizontalBorder,
                          useBooktabs=useBooktabs,
                          headerRowNames=["method", "", "cx"])

    table.leaveColumns([0, 2, 6, 8, 10, 14])  # leaving out S and C
    return table
Пример #2
0
def generateTableData(verticalBorder, horizontalBorder, useBooktabs):
    print("Generating a table for table_variants_data.tex ..")

    dimCols = Dim.from_dict(
        data, "A", nameFun=lambda v: "A={0}".format(v)) * Dim.from_dict(
            data, "B", nameFun=lambda v: "B={0}".format(v))
    dimRows = Dim.from_dict(data, "F", nameFun=lambda v: "F={0}".format(v))

    cells = printer.generateTableCells(
        data,
        dimRows=dimRows,
        dimCols=dimCols,
        fun=lambda props: sum([p["value"] for p in props]))

    rShading = printer.CellShading(0.0, 5.0, 10.0, "colorLow", "colorMedium",
                                   "colorHigh")
    table = printer.Table(cells,
                          dimCols=dimCols,
                          dimRows=dimRows,
                          cellRenderers=[rShading],
                          verticalBorder=verticalBorder,
                          horizontalBorder=horizontalBorder,
                          useBooktabs=useBooktabs,
                          headerRowNames=["A-value"])
    return table
Пример #3
0
def processTableNewInterface_SvsSI(tableBody, title):
    print(title)
    rBold = printer.LatexTextbf(lambda v, b: v == "1.00")
    rShading = printer.CellShading(0.0, 0.5, 1.0, "colorLow", "colorMedium",
                                   "colorHigh")
    table = printer.Table(printer.latexToArray(tableBody),
                          cellRenderers=[rBold, rShading])
    table.leaveColumns([0, 5, 6, 7, 8, 13, 14, 15,
                        16])  # comparing only SI with S

    colored = printer.table_color_map(str(table), 0.0, 0.5, 1.0, "colorLow",
                                      "colorMedium", "colorHigh")
    #print(reporting.color_scheme_green)
    print(colored)
    print(table.renderCsv())
Пример #4
0
def processTableNewInterface_withoutSC(tableBody, title):
    dimCx = Dim([("0.0", None), ("0.5", None)])
    dimSel = Dim([("T", None), ("L", None)])
    dimMethod = Dim([("U", None), ("P", None), ("S", None), ("IS", None)])
    main = dimSel * dimMethod * dimCx
    dimCols = Dim([("method", None)]) + main + Dim([("mean", None)])
    print("numConfigs: " + str(len(dimCols.configs)))
    print("asd: " + title)
    rBold = printer.LatexTextbf(lambda v, b: v == "1.00")
    rShading = printer.CellShading(0.0, 0.5, 1.0, "colorLow", "colorMedium",
                                   "colorHigh")
    table = printer.Table(printer.latexToArray(tableBody),
                          dimCols=dimCols,
                          cellRenderers=[rBold, rShading])
    table.leaveColumns([0, 1, 3, 7, 9, 11, 15])  # leaving out S and C
    print(table.render())
    print(table.renderCsv())
Пример #5
0
                                  cellRenderers=[
                                      printer.LatexTextbfMinInRow(),
                                      printer.CellShadingRow(
                                          "colorLow", "colorMedium",
                                          "colorHigh")
                                  ])  #, valueExtractor=log10ValueExtractor
    print("RUNTIME")
    print(table_runtime.renderTableBody())

    cells_fitness = printer.latexToArray(text_fitness, removeRenderings=True)
    table_fitness = printer.Table(cells_fitness,
                                  cellRenderers=[
                                      printer.LatexTextbfMaxInRow(),
                                      printer.CellShadingRow(
                                          "colorLow", "colorMedium",
                                          "colorHigh")
                                  ])  # , valueExtractor=log10ValueExtractor
    print("FITNESS")
    print(table_fitness.renderTableBody())

    cells_successRate = printer.latexToArray(text_successRate,
                                             removeRenderings=True)
    table_successRate = printer.Table(
        cells_successRate,
        cellRenderers=[
            printer.LatexTextbfMaxInRow(),
            printer.CellShading(0.0, 0.5, 1.0, "colorLow", "colorMedium",
                                "colorHigh")
        ])  # , valueExtractor=log10ValueExtractor
    print("SUCCESS RATE")
    print(table_successRate.renderTableBody())