当前位置: 首页>>代码示例>>Python>>正文


Python Table.dump_to_remarkup方法代码示例

本文整理汇总了Python中table.Table.dump_to_remarkup方法的典型用法代码示例。如果您正苦于以下问题:Python Table.dump_to_remarkup方法的具体用法?Python Table.dump_to_remarkup怎么用?Python Table.dump_to_remarkup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在table.Table的用法示例。


在下文中一共展示了Table.dump_to_remarkup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: print_results

# 需要导入模块: from table import Table [as 别名]
# 或者: from table.Table import dump_to_remarkup [as 别名]
def print_results(result_files, out_format):
    """Builds a table with the parsed results. Used when there is only one
    result file.

    """
    categories = transpose_result_data(result_files)
    columns = [result.short_name() for result in result_files]
    columns.insert(0, "Benchmark")
    table = Table(columns)

    geomean = None
    for key in categories:
        scores = [run[1] for run in categories[key]]
        entries = ["%.2f +- %.2f" % score for score in scores]
        entries.insert(0, key)
        if key == 'Geomean':
            geomean = entries
        else:
            table.add_row(entries)

    if geomean is not None:
        table.add_row(geomean)

    if out_format == 'terminal':
        table.dump_to_terminal()
    elif out_format == 'remarkup':
        table.dump_to_remarkup()
    else:
        raise RuntimeError("Unknown output format: %s" % out_format)
开发者ID:CryQ,项目名称:hhvm,代码行数:31,代码来源:significance.py

示例2: print_comparison_results

# 需要导入模块: from table import Table [as 别名]
# 或者: from table.Table import dump_to_remarkup [as 别名]
def print_comparison_results(result_files, out_format):
    """Builds a table of the various gathered results and prints it out.

    The table also includes an extra column for deltas and adds entries for
    significant changes between the last two provided files.

    """
    def entries_for_scores(key, scores):
        """Returns entries for the next row, prepending the category name and
        appending any significant changes.

        """
        old_score, old_ci = scores[-2]
        new_score, new_ci = scores[-1]
        entries = ["%.2f +- %.2f" % score for score in scores]
        entries.insert(0, key)
        if confidence_intervals_overlap(old_score, old_ci, new_score, new_ci):
            entries.append("")
        else:
            change = percent_delta(old_score, new_score)
            if change < 0.0:
                change_str = "%.4f%% slower" % (change * 100.0)
                entries.append(slower(out_format, change_str))
            else:
                change_str = "+%.4f%% faster" % (change * 100.0)
                entries.append(faster(out_format, change_str))
        return entries

    categories = transpose_result_data(result_files)
    columns = [result.short_name() for result in result_files]
    columns.insert(0, "Benchmark")
    columns.append("Deltas")
    table = Table(columns)

    geomean = None
    for key in categories:
        entries = entries_for_scores(key, [run[1] for run in categories[key]])
        if key == 'Geomean':
            geomean = entries
            geomean[0] = bold(out_format, geomean[0])
        else:
            table.add_row(entries)

    if geomean is not None:
        table.add_row(geomean)

    if out_format == 'terminal':
        table.dump_to_terminal()
    elif out_format == 'remarkup':
        table.dump_to_remarkup()
    else:
        raise RuntimeError("Unknown output format: %s" % out_format)
开发者ID:CryQ,项目名称:hhvm,代码行数:54,代码来源:significance.py


注:本文中的table.Table.dump_to_remarkup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。