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


Python Executor.step方法代码示例

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


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

示例1: stats_run

# 需要导入模块: from executor import Executor [as 别名]
# 或者: from executor.Executor import step [as 别名]
def stats_run(n_steps=0):        
    e = Executor(endo())
    #e.debug = True
    
    start = clock()
    try:
        for i in xrange(2*10**9):
            if i > 0 and i%1000 == 0:
                print i, int(i/(clock()-start+1e-6)),'steps/s'
            e.step()
            n_steps -= 1
            if n_steps == 0: break
    except FinishException:
        print 'execution finished'
    finally:
        print e.iteration, 'iterations'
        print len(e.rna), 'rna produced'
        print 'it took', clock()-start
        print int(e.iteration/(clock()-start+1e-6)), 'iterations/s'
        print 'pattern freqs', e.pattern_freqs
        print 'template freqs', e.template_freqs
        print 'codon len freqs', e.codon_len_freqs
开发者ID:Vlad-Shcherbina,项目名称:Morph-Endo-Legacy,代码行数:24,代码来源:execute.py

示例2: main

# 需要导入模块: from executor import Executor [as 别名]
# 或者: from executor.Executor import step [as 别名]
def main():
    parser = argparse.ArgumentParser(description='Produce RNA from DNA')
    parser.add_argument('--trace', action='store_true')
    parser.add_argument('--pause', action='store_true')
    parser.add_argument('prefix_filename')
    
    args = parser.parse_args()
    prefix_filename = args.prefix_filename
    
    prefix = open(prefix_filename+'.dna').read().strip()
    
    assert all(c in 'ICFP' for c in prefix)
        
    e = Executor(prefix+endo())
    e.debug = args.trace or args.pause
    
    start = clock()
    
    #for r in e.obtain_rna():
    #    print>>rna, r
    try:
        while True:
            e.step()
            if args.pause:
                print 'press enter',
                raw_input()
    except FinishException:
        pass

    rna_file = open(prefix_filename+'.rna', 'w')
    for r in e.rna:
        print>>rna_file, r
    
    print 'it took', clock()-start
    print int(e.iteration/(clock()-start+1e-6)), 'iterations/s'
    
    rna_file.close()
开发者ID:Vlad-Shcherbina,项目名称:Morph-Endo-Legacy,代码行数:39,代码来源:execute.py

示例3: generate_trace

# 需要导入模块: from executor import Executor [as 别名]
# 或者: from executor.Executor import step [as 别名]
def generate_trace(n_steps=10):
    e = Executor(endo())
    
    e.debug = True
    for i in range(n_steps):
        e.step()
开发者ID:Vlad-Shcherbina,项目名称:Morph-Endo-Legacy,代码行数:8,代码来源:execute.py


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