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


Python Report.from_simple_dict方法代码示例

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


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

示例1: test_merge

# 需要导入模块: from pbcommand.models.report import Report [as 别名]
# 或者: from pbcommand.models.report.Report import from_simple_dict [as 别名]
 def test_merge(self):
     r = Report.merge([
         Report.from_simple_dict("pbcommand_test",
                                 {"n_reads": 50, "n_zmws": 10},
                                 "pbcommand"),
         Report.from_simple_dict("pbcommand_test",
                                 {"n_reads": 250, "n_zmws": 50},
                                 "pbcommand")])
     attr = {a.id: a.value for a in r.attributes}
     self.assertEqual(attr['pbcommand_n_reads'], 300)
     self.assertEqual(attr['pbcommand_n_zmws'], 60)
开发者ID:gconcepcion,项目名称:pbcommand,代码行数:13,代码来源:test_models_report.py

示例2: resolved_tool_contract_runner

# 需要导入模块: from pbcommand.models.report import Report [as 别名]
# 或者: from pbcommand.models.report.Report import from_simple_dict [as 别名]
def resolved_tool_contract_runner(rtc):
    opts = rtc.task.options
    # XXX to handle chunking I am simply re-using the old i/N arguments, but
    # embedded in the input pickle instead of passed on the command line
    final_pickle_fn = rtc.task.input_files[2]
    _tmp = cPickle.load(open(final_pickle_fn, 'rb'))
    i_chunk = 0
    n_chunks = 1
    if "__chunk_i" in _tmp:
        i_chunk = _tmp['__chunk_i']
        n_chunks = _tmp['__chunk_n']
        final_pickle_fn = _tmp['pickle_file']
    output_dir = os.path.dirname(final_pickle_fn)
    IceFiles.final_consensus_fa = property(
        lambda self: rtc.task.input_files[1])
    IceFiles.final_pickle_fn = property(lambda self: final_pickle_fn)
    IceFiles.nfl_all_pickle_fn = property(lambda self: rtc.task.input_files[3])
    iceq = IceQuiverRTC(
        root_dir=output_dir,
        subread_set=rtc.task.input_files[0],
        nproc=rtc.task.nproc)
    iceq.validate_inputs()
    iceq.process_chunk_i(i=i_chunk, num_chunks=n_chunks)
    with open(rtc.task.output_files[0], 'w') as f:
        report = Report.from_simple_dict(
            report_id="isoseq_ice_quiver",
            raw_d={'n_chunks': 1},
            namespace="ice_quiver")
        f.write(report.to_json())
    return 0
开发者ID:lpp1985,项目名称:lpp_Script,代码行数:32,代码来源:ice_quiver.py

示例3: test_from_simple_dict

# 需要导入模块: from pbcommand.models.report import Report [as 别名]
# 或者: from pbcommand.models.report.Report import from_simple_dict [as 别名]
 def test_from_simple_dict(self):
     r = Report.from_simple_dict("pbcommand_test", {"n_reads": 50},
                                 "pbcommand")
     json_dict = json.loads(r.to_json())
     self.assertEqual(json_dict['attributes'], [
         {
             "id": "pbcommand_test.pbcommand_n_reads",
             "name": "n_reads",
             "value": 50
         },
     ])
开发者ID:mpkocher,项目名称:pbcommand,代码行数:13,代码来源:test_models_report.py

示例4: _write_stats_to_json

# 需要导入模块: from pbcommand.models.report import Report [as 别名]
# 或者: from pbcommand.models.report.Report import from_simple_dict [as 别名]
def _write_stats_to_json(stats, output_json):
    with open(output_json, "w") as w:
        w.write(Report.from_simple_dict(report_id="pbcommand_test", raw_d=stats, namespace="pb").to_json())
开发者ID:natechols,项目名称:pbcoretools,代码行数:5,代码来源:test_chunking_gather.py


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