diff --git a/python/damask/_grid.py b/python/damask/_grid.py index 9a240cc19..c33b008f3 100644 --- a/python/damask/_grid.py +++ b/python/damask/_grid.py @@ -33,9 +33,9 @@ class Grid: ---------- material : numpy.ndarray of shape (:,:,:) Material indices. - size : list or numpy.ndarray + size : list or numpy.ndarray of shape (3) Physical size of grid in meter. - origin : list or numpy.ndarray, optional + origin : list or numpy.ndarray of shape (3), optional Coordinates of grid origin in meter. comments : list of str, optional Comments, e.g. history of operations. diff --git a/python/damask/util.py b/python/damask/util.py index 529b63d20..8cf0d279f 100644 --- a/python/damask/util.py +++ b/python/damask/util.py @@ -588,9 +588,11 @@ class _ProgressBar: fraction = (iteration+1) / self.total filled_length = int(self.bar_length * fraction) - if filled_length > int(self.bar_length * self.last_fraction): + delta_time = datetime.datetime.now() - self.start_time + + if filled_length > int(self.bar_length * self.last_fraction) or \ + delta_time > datetime.timedelta(minutes=1): bar = '█' * filled_length + '░' * (self.bar_length - filled_length) - delta_time = datetime.datetime.now() - self.start_time remaining_time = (self.total - (iteration+1)) * delta_time / (iteration+1) remaining_time -= datetime.timedelta(microseconds=remaining_time.microseconds) # remove μs sys.stderr.write(f'\r{self.prefix} {bar} {fraction:>4.0%} ETA {remaining_time}')