From 732e32fb14587f4c43357620ddadd90aca6ea4c9 Mon Sep 17 00:00:00 2001 From: "Martin K. Scherer" Date: Thu, 14 Jul 2016 12:13:43 +0200 Subject: [PATCH] [progressreporter] fixed a bug in force_finish, where numerator could 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... --- doc/source/CHANGELOG.rst | 26 ++++++++++++++++++++------ pyemma/_base/progress/reporter.py | 5 ++++- pyemma/_base/tests/test_progress.py | 10 ++++++++++ 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/doc/source/CHANGELOG.rst b/doc/source/CHANGELOG.rst index 1e76b15dd..ef45331d6 100644 --- a/doc/source/CHANGELOG.rst +++ b/doc/source/CHANGELOG.rst @@ -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) --------------- diff --git a/pyemma/_base/progress/reporter.py b/pyemma/_base/progress/reporter.py index ba8d810aa..fe6cf0d71 100644 --- a/pyemma/_base/progress/reporter.py +++ b/pyemma/_base/progress/reporter.py @@ -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: diff --git a/pyemma/_base/tests/test_progress.py b/pyemma/_base/tests/test_progress.py index 1a87b645a..bb7c77e32 100644 --- a/pyemma/_base/tests/test_progress.py +++ b/pyemma/_base/tests/test_progress.py @@ -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()