lir.aggregation.plot_each module

class lir.aggregation.plot_each.PlotEach(plot_fn: Callable, plot_name: str, output_path: Path | None = None, **kwargs: Any)[source]

Bases: Aggregation

Aggregation that generates a plot for each call to report().

Repeated calls to report() will result in separate plots.

Parameters:
  • plot_fn (Callable) – The plotting function to be used for generating plots.

  • plot_name (str) – The name of the plot.

  • output_path (Path | None, optional) – The directory where the plots will be saved. If None, plots are not saved.

  • **kwargs (Any) – Additional arguments to be passed to the plotting function.

output_path

The directory where the plots will be saved. If None, plots are not saved.

Type:

Path | None

plot_fn

The plotting function to be used for generating plots.

Type:

Callable

plot_name

The name of the plot.

Type:

str

plot_fn_args

Additional arguments to be passed to the plotting function.

Type:

dict[str, Any]

report(data: AggregationData) None[source]

Plot the data when new results are available.

Parameters:

data (AggregationData) – The aggregated data to be plotted.

class lir.aggregation.plot_each.PlotEachConfigParser(method: str, default_plot_name: str | None = None)[source]

Bases: ConfigParser

Configuration parser for aggregate plots.

Parameters:
  • method (str) – The Python name of the plot function.

  • default_plot_name (str | None) – The plot name. If None, the value of method is used.

parse(config: ContextAwareDict, output_dir: Path) PlotEach[source]

Parse a configuration section for an aggregate plot.

Parameters:
  • config (ContextAwareDict) – Configuration section.

  • output_dir (Path) – Output directory.

Returns:

Parsed aggregate plot.

Return type:

PlotEach

reference() str[source]

Return the method argument of the constructor as the reference object.

Returns:

The method argument of the constructor.

Return type:

str