sfepy.base.log module¶
-
class
sfepy.base.log.
Log
(data_names=None, plot_kwargs=None, xlabels=None, ylabels=None, yscales=None, is_plot=True, aggregate=100, sleep=1.0, log_filename=None, formats=None)[source]¶ 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)[source]¶ Add a new data group. Notify the plotting process if it is already running.
-
count
= -1¶
-
static
from_conf
(conf, data_names)[source]¶ 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.
-
-
sfepy.base.log.
get_logging_conf
(conf, log_name='log')[source]¶ 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.
plot_log
(axs, log, info, xticks=None, yticks=None, groups=None)[source]¶ 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.
groups : list, optional
The list of data groups subplots. If not given, all groups are plotted.