Python progressbar.DynamicMessage() Examples

The following are 6 code examples of progressbar.DynamicMessage(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module progressbar , or try the search function .
Example #1
Source File: timing.py    From e2e-nlg-challenge-2017 with Apache License 2.0 6 votes vote down vote up
def create_progress_bar(dynamic_msg=None):
    # Taken from Andreas Rueckle.
    # usage:
    #   bar = _create_progress_bar('loss')
    #   L = []
    #   for i in bar(iterable):
    #       ...
    #       L.append(...)
    #
    #   bar.dynamic_messages['loss'] = np.mean(L)
    widgets = [
        ' [batch ', progressbar.SimpleProgress(), '] ',
        progressbar.Bar(),
        ' (', progressbar.ETA(), ') '
    ]
    if dynamic_msg is not None:
        widgets.append(progressbar.DynamicMessage(dynamic_msg))
    return progressbar.ProgressBar(widgets=widgets) 
Example #2
Source File: optimization.py    From angler with MIT License 6 votes vote down vote up
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 
Example #3
Source File: __init__.py    From iwcs2017-answer-selection with Apache License 2.0 5 votes vote down vote up
def _create_progress_bar(dynamic_msg=None):
    widgets = [
        ' [batch ', progressbar.SimpleProgress(), '] ',
        progressbar.Bar(),
        ' (', progressbar.ETA(), ') '
    ]
    if dynamic_msg is not None:
        widgets.append(progressbar.DynamicMessage(dynamic_msg))
    return progressbar.ProgressBar(widgets=widgets) 
Example #4
Source File: utilities.py    From urgent-care-comparative with GNU General Public License v3.0 5 votes vote down vote up
def make_widget():
    widgets = [progressbar.Percentage(), ' ', progressbar.SimpleProgress(), ' ', 
                                 progressbar.Bar(left = '[', right = ']'), ' ', progressbar.ETA(), ' ', 
                                 progressbar.DynamicMessage('LOSS'), ' ',  progressbar.DynamicMessage('PREC'), ' ',
                                 progressbar.DynamicMessage('REC')]
    bar = progressbar.ProgressBar(widgets = widgets)
    return bar


### Find nearest timestamps ### 
Example #5
Source File: __init__.py    From acl2017-non-factoid-qa with Apache License 2.0 5 votes vote down vote up
def _create_progress_bar(dynamic_msg=None):
    widgets = [
        ' [batch ', progressbar.SimpleProgress(), '] ',
        progressbar.Bar(),
        ' (', progressbar.ETA(), ') '
    ]
    if dynamic_msg is not None:
        widgets.append(progressbar.DynamicMessage(dynamic_msg))
    return progressbar.ProgressBar(widgets=widgets) 
Example #6
Source File: iters.py    From neupy with MIT License 5 votes vote down vote up
def make_progressbar(max_value, show_output):
    widgets = [
        progressbar.Timer(format='Time: %(elapsed)s'),
        ' |',
        progressbar.Percentage(),
        progressbar.Bar(),
        ' ',
        progressbar.ETA(),
    ]

    if show_output:
        widgets.extend([' | ', progressbar.DynamicMessage('loss')])

    return progressbar.ProgressBar(max_value=max_value, widgets=widgets)