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


Python progressbar.AdaptiveETA方法代码示例

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


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

示例1: _make_progressbar

# 需要导入模块: import progressbar [as 别名]
# 或者: from progressbar import AdaptiveETA [as 别名]
def _make_progressbar(self, N):
        """ Returns a progressbar to use during optimization"""

        if self.max_ind_shift is not None:

            bar = progressbar.ProgressBar(widgets=[
                ' ', progressbar.DynamicMessage('ObjectiveFn'),
                ' ', progressbar.DynamicMessage('ObjectiveFn_Normalized'),
                ' Iteration: ',
                ' ', progressbar.Counter(), '/%d' % N,
                ' ', progressbar.AdaptiveETA(),
            ], max_value=N)

        else:

            bar = progressbar.ProgressBar(widgets=[
                ' ', progressbar.DynamicMessage('ObjectiveFn'),
                ' Iteration: ',
                ' ', progressbar.Counter(), '/%d' % N,
                ' ', progressbar.AdaptiveETA(),
            ], max_value=N)

        return bar 
开发者ID:fancompute,项目名称:angler,代码行数:25,代码来源:optimization.py

示例2: start

# 需要导入模块: import progressbar [as 别名]
# 或者: from progressbar import AdaptiveETA [as 别名]
def start(self, threads, version_search=False):
		global bar
		toolbar_width = (self.__work_queue).qsize()
		widgets = ['  \u251c Processed: ', Percentage(),' ', Bar(),' ', AdaptiveETA()]
		bar = ProgressBar(widgets=widgets, maxval=toolbar_width).start()
		if self.__active_threads:
			raise Exception('Threads already started.')
		try:
			# Create thread pool
			for _ in range(threads):
				worker = threading.Thread(
					target=_work_function,
					args=(self.__work_queue, self.__result_queue, version_search))
				worker.daemon = True
				worker.start()
				self.__thread_list.append(worker)
				self.__active_threads += 1

			# Put sentinels to let the threads know when there's no more jobs
			[self.__work_queue.put(ThreadPoolSentinel()) for worker in self.__thread_list]
		except KeyboardInterrupt:
			print('\nReceived keyboard interrupt.\nQuitting...')
			exit(-1) 
开发者ID:whoot,项目名称:Typo3Scan,代码行数:25,代码来源:thread_pool.py


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