robpol86 / etaprogress Goto Github PK
View Code? Open in Web Editor NEWEasy to use ETA calculation and progress bar library.
License: MIT License
Easy to use ETA calculation and progress bar library.
License: MIT License
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
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.
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'
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)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.