# sfepy.base.log module

class sfepy.base.log.Log(data_names=None, plot_kwargs=None, xlabels=None, ylabels=None, yscales=None, show_legends=True, is_plot=True, aggregate=100, sleep=1.0, log_filename=None, formats=None)

  Log data and (optionally) plot them in the second process via LogPlotter.

  add_group(names, plot_kwargs=None, yscale=None, xlabel=None, ylabel=None, formats=None)

    Add a new data group. Notify the plotting process if it is already running.

  count = -1
  static from_conf(conf, data_names)
    Parameters:
      data_names list of lists of str

        The data names grouped by subplots: [[name1, name2, …], [name3, name4, …], …], where name<n> are strings to display in (sub)plot legends.

  get_log_name()
  plot_data(igs)
  plot_vlines(igs=None, **kwargs)

    Plot vertical lines in axes given by igs at current x locations to mark some events.

  terminate()

sfepy.base.log.get_logging_conf(conf, log_name='log')

  Check for a log configuration (‘log’ attribute by default) in conf. Supply default values if necessary.

  Parameters:
    conf Struct

      The configuration object.

    log_name str, optional

      The name of the log configuration attribute in conf.

  Returns:
    log dict

      The dictionary {‘plot’ : <figure_file>, ‘text’ : <text_log_file>}. One or both values can be None.

sfepy.base.log.iter_names(data_names, igs=None)

sfepy.base.log.plot_log(axs, log, info, xticks=None, yticks=None, xnbins=None, ynbins=None, groups=None, show_legends=True, swap_axes=False)

  Plot log data returned by `read_log()` into a specified figure.

  Parameters:
    axs sequence of matplotlib.axes.Axes

      The list of axes for the log data plots.

    log dict

      The log with data names as keys and `(xs, ys, vlines)` as values.

    info dict

      The log plot configuration with subplot numbers as keys.

    xticks list of arrays, optional

      The list of x-axis ticks (array or None) for each subplot.

    yticks list of arrays, optional

      The list of y-axis ticks (array or None) for each subplot.

    xnbins list, optional

      The list of x-axis number of bins (int or None) for each subplot.

    ynbins list, optional

      The list of y-axis number of bins (int or None) for each subplot.

    groups list, optional

      The list of data groups subplots. If not given, all groups are plotted.

    show_legends bool

      If True, show legends in plots.

    swap_axes bool

      If True, swap the axes of the plots.

sfepy.base.log.read_log(filename)

  Read data saved by `Log` into a text file.

  Parameters:
    filename str

      The name of a text log file.

  Returns:
    log dict

      The log with data names as keys and `(xs, ys, vlines)` as values.

    info dict

      The log plot configuration with subplot numbers as keys.

sfepy.base.log.write_log(output, log, info)