message: fixed divison by zero when calling `_estimate_step_duration` with `current==1` for the second time
diff: @@ -681,14 +681,16 @@ class Progbar(object):
  self.update(self._seen_so_far + n, values)
  def _estimate_step_duration(self, current, now):
  - """
  + """Estimate the duration of a single step.
  +
  Given the step number `current` and the corresponding time `now`
  this function returns an estimate for how long a single step
  takes. If this is called before one step has been completed
  (i.e. `current == 0`) then zero is given as an estimate. If
  `ignore_first` is set for this `Progbar` instance, then
  the duration estimate ignores the duration of the (assumed to
  - be non-representative) first step.
  + be non-representative) first step for estimates when more steps
  + are available (i.e. `current>1`).
  Arguments:
  current: Index of current step.
  now: The current time.
  @@ -697,7 +699,13 @@ class Progbar(object):
  """
  if current:
  - if self._ignore_first and self._time_after_first_step is not None:
  + # there are a few special scenarios here:
  + # 1) somebody is calling the progress bar without ever supplying step 1
  + # 2) somebody is calling the progress bar and supplies step one mulitple
  + # times, e.g. as part of a finalizing call
  + # in these cases, we just fall back to the simple calculation
  + can_estimate = self._time_after_first_step is not None and current > 1
  + if self._ignore_first and can_estimate:
  time_per_unit = (now - self._time_after_first_step) / (current - 1)
  else:
  time_per_unit = (now - self._start) / current
  