rail.plotting.plot_group module

Class to get track of groups of plots to make

class rail.plotting.plot_group.RailPlotGroup(**kwargs)[source]

Bases: Configurable

Class defining of a group on plots to make with a particular list of coherent datasets

Parameters:

kwargs (Any)

config_options: dict[str, StageParameter] = {'dataset_list_name': Parameter(DatasetList name, type: <class 'str'>, default: None [required]), 'figtype': Parameter(Plot type, type: <class 'str'>, default: png [optional]), 'name': Parameter(PlotGroupName name, type: <class 'str'>, default: None [required]), 'outdir': Parameter(Output directory, type: <class 'str'>, default: . [optional]), 'plotter_list_name': Parameter(PlotterList name, type: <class 'str'>, default: None [required])}
property dataset_list: list[RailDatasetHolder]
find_plot(dataset_name, plotter_name)[source]

Find a particular plot

Return type:

RailPlotHolder

Parameters:
  • dataset_name (str)

  • plotter_name (str)

find_plot_path(dataset_name, plotter_name)[source]

Find a particular plot and get the path to the associated file

Return type:

str | None

Parameters:
  • dataset_name (str)

  • plotter_name (str)

find_plots(outdir)[source]

Find a set of plots

Return type:

dict[str, RailPlotDict]

Parameters:

outdir (str) – Prepend this to the groups output dir

Returns:

out_dict – Dictionary of the newly created figures

Return type:

dict[str, Figure]

jinja_env: Environment | None = None
jinja_index_template: Template | None = None
jinja_template: Template | None = None
make_html(outfile)[source]

Make the html page to display the plots made by this plot group

Return type:

None

Parameters:

outfile (str) – Html file to write

classmethod make_html_index(outfile, output_pages)[source]

Make the html index page for a list of other pages

Return type:

None

Parameters:
  • outfile (str) – Html file to write

  • output_pages (list[str]) – Set of pages to include in the index

make_plots()[source]

Make a set of plots

Return type:

dict[str, RailPlotDict]

Returns:

out_dict – Dictionary of the newly created figures

Return type:

dict[str, RailPlotDict]

property plotter_list: list[RailPlotter]
resolve()[source]

Get the PlotterList and DatasetList

Return type:

None

run(save_plots=True, purge_plots=True, find_only=False, outdir=None, make_html=False, output_html=None)[source]

Make all the plots given the data

Return type:

dict[str, RailPlotDict]

Parameters:
  • save_plots (bool) – If true, save the plots to disk

  • purge_plots (bool) – If true, delete the plots after saving

  • find_only (bool) – If true, only look for existing plots

  • make_html (bool) – If true, make an html table to browse plots

  • outdir (str | None) – If set, prepend this to the groups output dir

  • output_html (str | None) – Path for output html file

Returns:

out_dict – Dictionary of the newly created figures

Return type:

dict[str, Figure]

yaml_tag: str = 'PlotGroup'