Commit a6a20f55 authored by eric pellegrini's avatar eric pellegrini
Browse files

The number of steps is not compulsory for status derived objects

parent 9eb349e2
......@@ -4,8 +4,6 @@ import datetime
import numpy
from MDANSE.Externals.pubsub import pub as Publisher
def total_seconds(td):
return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10.0**6
......@@ -127,9 +125,6 @@ class Status(object):
def update(self,force=False):
if self._nSteps is None:
return
if self._updateStep == 0:
return
......@@ -143,6 +138,7 @@ class Status(object):
self._lastRefresh = lastUpdate
if self._nSteps is not None:
self._elapsedTime = '%02dd:%02dh:%02dm:%02ds' % convert_duration(total_seconds(datetime.datetime.today() - self._startTime))
duration = [total_seconds(self._deltas[i+1]-self._deltas[i]) for i in range(self._currentStep)]
duration = numpy.median(duration)*(self._nSteps-self._currentStep)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment