rail.plotting.plot_group_factory module

class rail.plotting.plot_group_factory.RailPlotGroupFactory[source]

Bases: RailFactoryMixin

Factory class to make plot_groups

The yaml file should look something like this:

Includes:
  - <path_to_yaml_file_defining_plotter_lists>
  - <path_to_yaml_file defining_dataset_lists>

PlotGroups:
  - PlotGroup:
      name: some_name
      plotter_list_name: nice_plots
      dataset_dict_name: nice_data
  - PlotGroup:
      name: some_other_name
      plotter_list_name: janky_plots
      dataset_dict_name: janky_data
classmethod add_plot_group(plot_group)[source]

Add a particular RailPlotGroup to the factory

Return type:

None

Parameters:

plot_group (RailPlotGroup)

client_classes: list[type[Configurable]] = [<class 'rail.plotting.plot_group.RailPlotGroup'>]
classmethod get_plot_group(key)[source]

Return a project by name

Return type:

RailPlotGroup

Parameters:

key (str)

classmethod get_plot_group_names()[source]

Return the names of all the projectsRailPlotGroup

Return type:

list[str]

classmethod get_plot_groups()[source]

Return the dict of all the RailPlotGroup

Return type:

dict[str, RailPlotGroup]

classmethod make_plot_groups(plotter_list, **kwargs)[source]

Extract the datasets from a project and construct the approporiate PlotGroups

Return type:

dict

Parameters:

Paramters

**kwargs:

Passed to the generate_dataset_dict() functions of the holder classes

returns:

Projects: the extracted RailProjects Datasets: the extracted DatasetHolders DatasetLists: the extracted dataset lists PlotGroups: the constructed PlotGropus

rtype:

dict

make_plot_groups_instance(plotter_list, **kwargs)[source]

Extract the datasets from a project and construct the approporiate PlotGroups

Return type:

dict

Parameters:

Paramters

**kwargs:

Passed to the generate_dataset_dict() functions of the holder classes

returns:

Projects: the extracted RailProjects Datasets: the extracted DatasetHolders DatasetLists: the extracted dataset lists PlotGroups: the constructed PlotGropus

rtype:

dict

classmethod make_yaml_for_dataset_list(output_yaml, plotter_yaml_path, dataset_yaml_path, plotter_list_name, output_prefix='', dataset_list_name=None)[source]

Construct a yaml file defining plot groups

Return type:

None

Parameters:
  • output_yaml (str) – Path to the output file

  • plotter_yaml_path (str) – Path to the yaml file defining the plotter_lists

  • dataset_yaml_path (str) – Path to the yaml file defining the datasets

  • plotter_list_name (str) – Name of plotter list to use

  • output_prefix (str) – Prefix for PlotGroup names we construct

  • dataset_list_names – Names of dataset lists to use

  • dataset_list_name (list[str] | None)

make_yaml_for_dataset_list_instance(output_yaml, plotter_yaml_path, dataset_yaml_path, plotter_list_name, output_prefix='', dataset_list_name=None)[source]

Construct a yaml file defining plot groups

Return type:

None

Parameters:
  • output_yaml (str) – Path to the output file

  • plotter_yaml_path (str) – Path to the yaml file defining the plotter_lists

  • dataset_yaml_path (str) – Path to the yaml file defining the datasets

  • plotter_list_name (str) – Name of plotter list to use

  • output_prefix (str="") – Prefix for PlotGroup names we construct

  • dataset_list_name (list[str]) – Names of dataset lists to use

classmethod make_yaml_for_project(output_yaml, plotter_yaml_path, project_yaml_path, **kwargs)[source]

Construct a yaml file defining plot groups

Return type:

None

Parameters:
  • output_yaml (str) – Path to the output file

  • plotter_yaml_path (str) – Path to the yaml file defining the plotter_lists

  • project_yaml_path (str) – Path to the underlying project file

  • **kwargs (Any) – See notes

make_yaml_for_project_instance(output_yaml, plotter_yaml_path, project_yaml_path, **kwargs)[source]

Construct a yaml file defining plot groups

Return type:

None

Parameters:
  • output_yaml (str) – Path to the output file

  • plotter_yaml_path (str) – Path to the yaml file defining the plotter_lists

  • project_yaml_path (str) – Path to the underlying project file

  • **kwargs (Any) – See notes

property plot_groups: dict[str, RailPlotGroup]

Return the dictionary of RailProjects

yaml_tag: str = 'PlotGroups'