slitflow.name module

This module provides file path processing functions.

make_info_path(root_dir, grp_no, ana_no, obs_name, ana_name='', grp_name='')[source]

Return an info path with creating all folders required.

Parameters:
  • root_dir (str) – Top level project directory path.

  • grp_no (int) – Group number.

  • ana_no (int) – Analysis number.

  • obs_name (str) – Observation name.

  • ana_name (str, optional) – Set ana name if you make a new analysis.

  • grp_name (str, optional) – Set group name if you make a new group.

Returns:

Path to info JSON file with .sf extension

Return type:

str

split_info_path(info_path)[source]

Split info path string into part names.

Parameters:

info_path (str) – Path to an information JSON file.

Returns:

Tuples containing

  • ana_path (str): path to the analysis folder

  • obs_name (str): observation name

  • ana_name (str): analysis name without extension

  • grp_name (str): group name without extension

make_data_paths(Info, ext)[source]

Create a set of data paths.

Parameters:
  • Info (Info) – Information object.

  • ext (str) – Data file extension.

Returns:

List of paths to the data files

Return type:

list of str

load_data_paths(Info, ext)[source]

Find saved data and create the path list.

Parameters:
  • Info (Info) – Information object.

  • ext (str) – Data file extension.

Returns:

List of paths to the data files

Return type:

list of str

make_group(root_dir, grp_no, grp_name)[source]

Create a group folder.

Parameters:
  • root_dir (str) – Path to the project directory.

  • grp_no (int) – Group number.

  • grp_name (str) – Group name.

Returns:

Path to the group directory

Return type:

str

get_obs_names(root_dir, req_address)[source]

Return observation names from existing folder.

Parameters:
  • root_dir (str) – Path to the project directory.

  • req_address (tuple of int) – (group number, analysis number) of the directory to search observations names.

Returns:

List of observation names

Return type:

list of str

get_class_name(info_path)[source]

Return the class name string from info meta data.

Parameters:

info_path (str) – Path to information file with .sf extension.

Returns:

eval() executable class_name string

Return type:

str