From 24063c751eadda4d6264837d4acc4f557f02617b Mon Sep 17 00:00:00 2001 From: Hal Simpson <hasimpson@usgs.gov> Date: Tue, 16 Feb 2016 15:42:42 -0700 Subject: [PATCH] Changed update_count to be an optional parameter that defaults to zero for the run_as_update method. --- geomagio/Controller.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/geomagio/Controller.py b/geomagio/Controller.py index 54d61676..19e59b4f 100644 --- a/geomagio/Controller.py +++ b/geomagio/Controller.py @@ -176,7 +176,7 @@ class Controller(object): endtime=options.endtime, channels=output_channels) - def run_as_update(self, options): + def run_as_update(self, options, update_count=0): """Updates data. Parameters ---------- @@ -197,10 +197,10 @@ class Controller(object): """ # If an update_limit is set, make certain we don't step past it. if options.update_limit != 0: - if self._update_count < options.update_limit: - self._update_count += 1 + if update_count < options.update_limit: + update_count += 1 else: - return + return algorithm = self._algorithm input_channels = options.inchannels or \ algorithm.get_input_channels() @@ -235,7 +235,7 @@ class Controller(object): endtime = options.starttime - delta options.starttime = starttime options.endtime = endtime - self.run_as_update(options) + self.run_as_update(options, update_count) # fill gap options.starttime = output_gap[0] options.endtime = output_gap[1] -- GitLab