Interactive Interface

The rail_projects has a few main entry points for interactive using, e.g., via jupyter notebooks. One is a combination of the RailProject class and the functions in the rail.projects.library module, which, together, work with the tools in rail.projects and help to manage analysis projects. The other is the functions in the rail.plotting.control module, which work with the tools in rail.plotting and help to make plots.

Using RailProject interface

class rail.projects.RailProject(**kwargs)[source]

Main analysis driver class, this collects all the elements needed to run a collection of studies using RAIL.

The key concepts are:

1. analysis ‘Flavors’, which are versions of similar analyses with slightly different parameter settings and/or input files.

  1. ceci ‘Pipelines’, which run blocks of analysis code

A RailProject basically specifies which Pipelines to run under which flavors, and keeps track of the outputs.

RailProject.functionality_help() for more on class functionality

RailProject.configuration_help() for more on class configuration

Parameters:

kwargs (Any)

Using rail.projects.library interface

Functions to manage various objects associated to RailProjects

rail.projects.library.clear()[source]

Clean all the factories

Return type:

None

rail.projects.library.load_yaml(yaml_file)[source]

Read a yaml file and load the factory accordingly

Return type:

None

Parameters:

yaml_file (str) – File to read

Notes

See class description for yaml file syntax

rail.projects.library.print_contents()[source]

Print the contents of the factories

Return type:

None

rail.projects.library.setup_project_area()[source]

Download test files to setup a project testsing area

Return type:

int

Returns:

0 for success, error code otherwise

Return type:

int

Notes

This will download files into ‘tests/temp_data’, and could take a few minutes.

This will not download the files if they are already present

rail.projects.library.write_yaml(yaml_file)[source]

Write the current contents for the factories to a yaml file

Return type:

None

Parameters:

yaml_file (str) – File to write

Notes

See class description for yaml file syntax

Using rail.plotting.control interface

Functions to control plot making in the context of a RailProject

rail.plotting.control.clear()[source]

Clean all the factories

Return type:

None

rail.plotting.control.extract_datasets(config_file, dataset_holder_class, output_yaml, **kwargs)[source]

Extract datasets into a yaml file

Return type:

None

Parameters:
  • config_file (str) – Yaml project configuration file

  • dataset_holder_class (str) – Class used to extract Datasets

  • output_yaml (str) – Path to output file

  • **kwargs – See notes for details

Notes

dataset_list_name: str

Name for the resulting DatasetList

selections: list[str]

Selections to use

flavors: list[str]

Flavors to use

split_by_flavor: bool

Split dataset lists by flavor

rail.plotting.control.load_yaml(yaml_file)[source]

Read a yaml file and load the factory accordingly

Return type:

None

Parameters:

yaml_file (str) – File to read

Notes

See class description for yaml file syntax

rail.plotting.control.print_classes()[source]

Print the loaded classes

Return type:

None

rail.plotting.control.print_contents()[source]

Print the contents of the factories

Return type:

None

rail.plotting.control.run(yaml_file, include_groups=None, exclude_groups=None, **kwargs)[source]

Read a yaml file an make the corresponding plots

Return type:

dict[str, RailPlotDict]

Parameters:
  • yaml_file (str) – Top level yaml file with definitinos

  • include_groups (list[str]) – PlotGroups to explicitly include Use None for all plots

  • exclude_groups (list[str]) – PlotGroups to explicity exclude Use None to not exclude anything

  • Keywords

  • --------

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

  • save_plots (bool=True) – Save plots to disk

  • purge_plots (bool=True) – Remove plots from memory after saving

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

  • make_html (bool) – If set, make an html page to browse plots

  • kwargs (Any)

Returns:

Newly created plots. If purge=True this will be empty

Return type:

dict[str, RailPlotDict]

rail.plotting.control.write_yaml(yaml_file)[source]

Write the current contents for the factories to a yaml file

Return type:

None

Parameters:

yaml_file (str) – File to write

Notes

See class description for yaml file syntax