class_docstr: The base class for a solver. In only deals with verbosing
  information, creating an History object, etc.
  
  Parameters
  ----------
  tol : `float`, default=0
      The tolerance of the solver (iterations stop when the stopping
      criterion is below it). By default the solver does ``max_iter``
      iterations
  
  max_iter : `int`
      Maximum number of iterations of the solver
  
  verbose : `bool`, default=True
      If `True`, we verbose things, otherwise the solver does not
      print anything (but records information in history anyway)
  
  print_every : `int`, default = 10
      Print history information every time the iteration number is a
      multiple of ``print_every``
  
  record_every : `int`, default = 1
      Information along iteration is recorded in history each time the
      iteration number of a multiple of ``record_every``
  
  Attributes
  ----------
  time_start : `str`
      Start date of the call to solve()
  
  time_elapsed : `float`
      Duration of the call to solve(), in seconds
  
  time_end : `str`
      End date of the call to solve()
  
  Notes
  -----
  This class should not be used by end-users
class_docstr_tok: ["The","base","class","for","a","solver",".","In","only","deals","with","verbosing","information",",","creating","an","History","object",",","etc",".","Parameters","--","--","--","--","--","tol",":","`","float","`",",","default=0","The","tolerance","of","the","solver","(","iterations","stop","when","the","stopping","criterion","is","below","it",")",".","By","default","the","solver","does","``","max_iter","``","iterations","max_iter",":","`","int","`","Maximum","number","of","iterations","of","the","solver","verbose",":","`","bool","`",",","default=True","If","`","True","`",",","we","verbose","things",",","otherwise","the","solver","does","not","print","anything","(","but","records","information","in","history","anyway",")","print_every",":","`","int","`",",","default","=","10","Print","history","information","every","time","the","iteration","number","is","a","multiple","of","``","print_every","``","record_every",":","`","int","`",",","default","=","1","Information","along","iteration","is","recorded","in","history","each","time","the","iteration","number","of","a","multiple","of","``","record_every","``","Attributes","--","--","--","--","--","time_start",":","`","str","`","Start","date","of","the","call","to","solve","(",")","time_elapsed",":","`","float","`","Duration","of","the","call","to","solve","(",")",",","in","seconds","time_end",":","`","str","`","End","date","of","the","call","to","solve","(",")","Notes","--","--","-","This","class","should","not","be","used","by","end-users"]
docstr: Handles history for keywords and current iteration
  
  Parameters
  ----------
  n_iter : `int`
      The current iteration (will determine if we record it or
      not)
  force : `bool`
      If True, we will record no matter the value of ``n_iter``
  
  **kwargs : `dict`
      key, value pairs of the values to record in the History of
      the solver
docstr_tok: ["Handles","history","for","keywords","and","current","iteration","Parameters","--","--","--","--","--","n_iter",":","`","int","`","The","current","iteration","(","will","determine","if","we","record","it","or","not",")","force",":","`","bool","`","If","True",",","we","will","record","no","matter","the","value","of","``","n_iter","``","*","*","kwargs",":","`","dict","`","key",",","value","pairs","of","the","values","to","record","in","the","History","of","the","solver"]
code: def _handle_history(self, n_iter: int, force: bool = False, **kwargs):
      """Handles history for keywords and current iteration
  
      Parameters
      ----------
      n_iter : `int`
          The current iteration (will determine if we record it or
          not)
      force : `bool`
          If True, we will record no matter the value of ``n_iter``
  
      **kwargs : `dict`
          key, value pairs of the values to record in the History of
          the solver
      """
  
      # TODO: this should be protected : _handle_history
      verbose = self.verbose
      print_every = self.print_every
      record_every = self.record_every
      should_print = verbose and (force or n_iter % print_every == 0)
      should_record = (
          force
          or n_iter % print_every == 0
          or n_iter % record_every == 0
      )
      if should_record:
          iter_time = kwargs.get("iter_time", time() - self._time_start)
          self.history._update(n_iter=n_iter, time=iter_time, **kwargs)
      if should_print:
          self.history._print_history()
  
file_path: tick/tick/solver/base/solver.py
imports: from abc import abstractmethod
  from time import time
  from tick.base import Base
  from tick.solver.history import History
label_desc: Use image node_id 6 for calling the Solver obj's underlying member method code with example usage: obj._handle_history(n_iter, force) without return types