Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/dynamic message #66

Merged
merged 8 commits into from
May 29, 2016
Merged

Conversation

joe-antognini
Copy link
Contributor

This PR addresses Issue #53 by creating a DynamicMessage widget so that a user can supply some number (or numbers) on each update. This would be useful for machine learning applications where the user may want to keep track of some changing value like the accuracy or loss as a model is being trained. The widget could be used as follows:

import random
widgets = [Percentage(), Bar(), DynamicMessage('loss'), DynamicMessage('accuracy')]
with ProgressBar(widgets=widgets, max_value=2000) as pbar:
    max_so_far = 0
    min_so_far = 1
    for i in range(2000):
        val = random.random()
        if val > max_so_far:
            max_so_far = val
        if val < min_so_far:
            min_so_far = val
        time.sleep(.01)
        bar.update(i, accuracy=max_so_far, loss=min_so_far)

This PR is similar in purpose to PR #59 but it modifies update directly rather than adding an additional update_mapping function.

cbrnr and others added 7 commits April 21, 2016 10:38
Show initial progressbar when starting
This commit adds a new DynamicMessage widget.  This allows a user to supply
a keyword argument (or multiple keyword arguments) to the update method
whose value(s) will be displayed on the progress bar.

Test coverage of DynamicMessage is included.
@wolph wolph merged commit bbef395 into wolph:develop May 29, 2016
@wolph
Copy link
Owner

wolph commented May 29, 2016

Thanks for the fix Joe :)

It's merged now and as soon as I have everything tested I will create a new release

@Kyalma
Copy link

Kyalma commented May 24, 2017

Why does it support only interger (or float) value ? Couldn't we display a string ? I could change the code myself but I don't know if there is a length limitation

@wolph
Copy link
Owner

wolph commented May 24, 2017

@Kyalma you can try the FormatLabel or FormatCustomText

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants