Giter VIP home page Giter VIP logo

etaprogress's Issues

division by 0 in eta.py

Hello,

I am using the progress bar to report progress on some long running task. Sometime I get a division by 0 exception in eta.py at line 155:

pearson_r = sum_xy / sqrt(sum_sq_v_x * sum_sq_v_y)

This does not happen all the time, but it does happen quite frequently. Sometimes the numerator is incremented by 0, sometime by some thousands.

Is this a known bug?

Thanks,
Iulian

simple usage example misleading

The simple usage example assumes that the total number of items to process is 5 and iterates over range(5 + 1) (= 6) items in order to draw a full 100%. Obviously you cannot iterate six times in a loop over a list of five items.

The following shows a "real life" usage example:

progress_set = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)

total = len(progress_set)
bar   = ProgressBar(total)

for index, item in enumerate(progress_set):
    bar.numerator = index
    print(bar, end = '\r')

    # do stuff with item of progress_set
    time.sleep(0.25)

bar.numerator += 1
print(bar)

example.py shows in progress_bar() print(bar) # Always print one last time. This is probably an - incomplete - remainder of the correct usage. The author just forgot to increment the numerator.

Installing on windows

Line 137 of setup.py
**get_metadata(os.path.join(NAME_FILE + ('/init.py' if PACKAGE else '.py')))

Should this be \ \ for windows?

Installing on windows gives me this error: FileNotFoundError: [Errno 2] No such file or directory: 'c:\users\sean\appdata\local\temp\pip_build_Sean\etaprogress\etaprogress/init.py'

locale.format is deprecated since Python 3.7

I get the following deprecation warnings:

.../lib/python3.7/site-packages/etaprogress/progress.py:79: DeprecationWarning: This method will be removed in a future version of Python. Use 'locale.format_string()' instead.
    denominator = locale.format('%d', self.denominator, grouping=True)
.../lib/python3.7/site-packages/etaprogress/progress.py:86: DeprecationWarning: This method will be removed in a future version of Python. Use 'locale.format_string()' instead.
    return locale.format('%d', self.numerator, grouping=True)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.