Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ of widgets:
- `ReverseBar <http://progressbar-2.readthedocs.io/en/latest/_modules/progressbar/widgets.html#ReverseBar>`_
- `RotatingMarker <http://progressbar-2.readthedocs.io/en/latest/_modules/progressbar/widgets.html#RotatingMarker>`_
- `SimpleProgress <http://progressbar-2.readthedocs.io/en/latest/_modules/progressbar/widgets.html#SimpleProgress>`_
- `SmoothingETA <https://progressbar-2.readthedocs.io/en/latest/_modules/progressbar/widgets.html#SmoothingETA>`_
- `Timer <http://progressbar-2.readthedocs.io/en/latest/_modules/progressbar/widgets.html#Timer>`_

The progressbar module is very easy to use, yet very powerful. It will also
Expand Down
4 changes: 2 additions & 2 deletions progressbar/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ def __init__(
):
self.smoothing_parameters = smoothing_parameters or {}
self.smoothing_algorithm = smoothing_algorithm(
**(self.smoothing_parameters or {}),
**self.smoothing_parameters,
)
ETA.__init__(self, **kwargs)

Expand All @@ -682,7 +682,7 @@ def __call__(
if elapsed is None: # pragma: no branch
elapsed = data['time_elapsed']

self.smoothing_algorithm.update(value, elapsed)
value = self.smoothing_algorithm.update(value, elapsed)
return ETA.__call__(self, progress, data, value=value, elapsed=elapsed)


Expand Down
24 changes: 12 additions & 12 deletions tests/test_monitor_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ def test_list_example(testdir) -> None:
pprint.pprint(result.stderr.lines, width=70)
result.stderr.fnmatch_lines([
' 0% (0 of 9) | | Elapsed Time: ?:00:00 ETA: --:--:--',
' 11% (1 of 9) |# | Elapsed Time: ?:00:01 ETA: ?:00:08',
' 22% (2 of 9) |## | Elapsed Time: ?:00:02 ETA: ?:00:07',
' 33% (3 of 9) |#### | Elapsed Time: ?:00:03 ETA: ?:00:06',
' 44% (4 of 9) |##### | Elapsed Time: ?:00:04 ETA: ?:00:05',
' 11% (1 of 9) |# | Elapsed Time: ?:00:01 ETA: ?:00:16',
' 22% (2 of 9) |## | Elapsed Time: ?:00:02 ETA: ?:00:11',
' 33% (3 of 9) |#### | Elapsed Time: ?:00:03 ETA: ?:00:08',
' 44% (4 of 9) |##### | Elapsed Time: ?:00:04 ETA: ?:00:06',
' 55% (5 of 9) |###### | Elapsed Time: ?:00:05 ETA: ?:00:04',
' 66% (6 of 9) |######## | Elapsed Time: ?:00:06 ETA: ?:00:03',
' 77% (7 of 9) |######### | Elapsed Time: ?:00:07 ETA: ?:00:02',
Expand Down Expand Up @@ -144,14 +144,14 @@ def test_rapid_updates(testdir) -> None:
result.stderr.fnmatch_lines(
[
' 0% (0 of 10) | | Elapsed Time: 0:00:00 ETA: --:--:--',
' 10% (1 of 10) | | Elapsed Time: 0:00:01 ETA: 0:00:09',
' 20% (2 of 10) |# | Elapsed Time: 0:00:02 ETA: 0:00:08',
' 30% (3 of 10) |# | Elapsed Time: 0:00:03 ETA: 0:00:07',
' 40% (4 of 10) |## | Elapsed Time: 0:00:04 ETA: 0:00:06',
' 50% (5 of 10) |### | Elapsed Time: 0:00:05 ETA: 0:00:05',
' 60% (6 of 10) |### | Elapsed Time: 0:00:07 ETA: 0:00:04',
' 70% (7 of 10) |#### | Elapsed Time: 0:00:09 ETA: 0:00:03',
' 80% (8 of 10) |#### | Elapsed Time: 0:00:11 ETA: 0:00:02',
' 10% (1 of 10) | | Elapsed Time: 0:00:01 ETA: 0:00:18',
' 20% (2 of 10) |# | Elapsed Time: 0:00:02 ETA: 0:00:12',
' 30% (3 of 10) |# | Elapsed Time: 0:00:03 ETA: 0:00:09',
' 40% (4 of 10) |## | Elapsed Time: 0:00:04 ETA: 0:00:07',
' 50% (5 of 10) |### | Elapsed Time: 0:00:05 ETA: 0:00:06',
' 60% (6 of 10) |### | Elapsed Time: 0:00:07 ETA: 0:00:05',
' 70% (7 of 10) |#### | Elapsed Time: 0:00:09 ETA: 0:00:04',
' 80% (8 of 10) |#### | Elapsed Time: 0:00:11 ETA: 0:00:03',
' 90% (9 of 10) |##### | Elapsed Time: 0:00:13 ETA: 0:00:01',
'100% (10 of 10) |#####| Elapsed Time: 0:00:15 Time: 0:00:15',
],
Expand Down
Loading