Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
[progressreporter] fixed a bug in force_finish, where numerator could…
Browse files Browse the repository at this point in the history
… raise above denominator. (#869)

* [progressreporter] fixed a bug in force_finish, where numerator could raise above denominator.

This used to happen when the progress bar gets updated beyond its previously
registered amount of work.

* [doc] added missing changelog entries...
  • Loading branch information
marscher authored Jul 14, 2016
1 parent 8d3105d commit 732e32f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 7 deletions.
26 changes: 20 additions & 6 deletions doc/source/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
Changelog
=========

2.2.2 ()
--------

*Fixes**:
2.2.2 (7-14-16)
---------------

- coordinates: set chunksize correctly. #846
**New features**:
- coordinates: SQLite backend for trajectory info data. This enables fast access to this data
on parallel filesystems where multiple processes are writing to the database. This greatly
speeds ups reader construction and enables fast random access for formats which usually do not
support it. #798
- plots: new optional parameter **arrow_label_size** for network plotting functions to use a custom
font size for the arrow labels; the default state and arrow label sizes are now determined by the
matplotlib default.
matplotlib default. #858
- coordinates: save_trajs takes optional parameter "image_molecules" to correct for broken
molecules across periodic boundary conditions. #841

**Fixes**:

- coordinates: set chunksize correctly. #846
- coordinates: For angle features it was possible to use both cossin=True and deg=True, which
makes not sense. #857
- coordinates: fixed a memory error in kmeans clustering which affected large data sets (>=64GB). #839
- base: fixed a bug in ProgressReporter (_progress_force_finish in stack trace). #869
- docs: fixed a lot of docstrings for inherited classes both in coordinates and msm package.


2.2.1 (6-21-16)
---------------
Expand Down
5 changes: 4 additions & 1 deletion pyemma/_base/progress/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@ def _progress_force_finish(self, stage=0, description=None):
pg = self._prog_rep_progressbars[stage]
if not isinstance(pg, _ProgressBar):
return
pg.numerator = pg.denominator

if pg.numerator < pg.denominator:
pg.numerator = pg.denominator

pg._eta.eta_epoch = 0

if description is not None:
Expand Down
10 changes: 10 additions & 0 deletions pyemma/_base/tests/test_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,15 @@ def call_back(stage, progressbar, *args, **kw):
worker._progress_update(1, stage=0)
self.assertEqual(self.has_been_called, amount_of_work)

def test_force_finish(self):
import warnings
worker = ProgressReporter()
worker._progress_register(100)
# intentionally overshoot registered work
with warnings.catch_warnings(record=True) as cm:
worker._progress_update(101)
self.assertIn("more work than registered", cm[0].message[0])
worker._progress_force_finish()

if __name__ == "__main__":
unittest.main()

0 comments on commit 732e32f

Please sign in to comment.