Function pretty

Synopsis

def pretty(self)

Description

Pretty string representation of the config

Source

Lines 60-71 in anyfig/config_functions.py.

def pretty(self):
  ''' Pretty string representation of the config '''
  lines = [f'{type(self).__name__}:']
  for key, val in self.get_parameters(copy=False).items():
    val_str = str(val)
    if figutils.is_config_class(val):  # Remove class name info
      val_str = val_str.replace(f'{type(val).__name__}:', '')
    lines += f'{key} ({type(val).__name__}): {val_str}'.split('\n')
  return '\n    '.join(lines)





Add Discussion as Guest

Log in