posydon_setup_pipeline

class posydon_setup_pipeline.PostProcessingPipeline(path_to_inifile=None)[source]

Bases: object

A class to handle the post-processing pipeline.

Initialize a pipeline

Parameters:

path_to_inifile (path) – The location of an ini file to read the parameters for the pipeline (default: None)

create_csv_and_slurm_job_files()[source]

Creates all files the pipeline needs.

create_log_dirs()[source]

Create directories to store the log files.

static parse_setup_params(path=None)[source]

Parse inifile for running post-processing pipelines.

Parameters:

path (path) – The location of an ini file to read the parameters for the pipeline (default: None)

Returns:

A dictionary with all the parameters in the ini file. It accounts for one sectioning level.

Return type:

dict

posydon_setup_pipeline.create_cleanup_slurm_job(job_name, step_name, PATH='.', ACCOUNT=None, PARTITION=None, WALLTIME=None, MAILTYPE=None, EMAIL=None, GROUP=None, VERBOSE=False, **kwargs)[source]

Create slurm file for cleanup job.

Parameters:
  • job_name (str) – String representation of the job. It will be used in the file name.

  • step_name (str) – String representation of the parent step. It will be used for the logs.

  • PATH (str) – Path of the working directory.

  • ACCOUNT (str) – The slurm account name. Passed to slurm’s option ‘–account’.

  • PARTITION (str) – The slurm partition name. Passed to slurm’s option ‘–partition’.

  • WALLTIME (str) – Maximum time for the slurm job. Passed to slurm’s option ‘–time’.

  • MAILTYPE (str) – Specifier, which emails to send by slurm. Passed to slurm’s option ‘–mail-type’. It requires EMAIL to be set, too.

  • EMAIL (str) – Email address to send mails to. Passed to slurm’s option ‘–mail-user’. It requires MAILTYPE to be set, too.

  • GROUP (str) – Group name to get ownership and permissions on files created by the pipeline.

  • VERBOSE (bool) – Enables/Disables additional output.

  • kwargs (dict) – Other parameters (all being ignored).

posydon_setup_pipeline.create_csv(GRID_TYPES=[], METALLICITIES=[], GRID_SLICES=[], COMPRESSIONS=[], step_name='', VERSION='', PLOT_EXTENSION='pdf', GRIDS_COMBINED=[], ORIGINAL_COMPRESSIONS=[], INTERPOLATION_METHODS=[], PROFILE_NAMES=[], CONTROL_GRIDS=[], STOP_BEFORE_CARBON_DEPLETION=0, RERUN_TYPE='', CLUSTER='quest', DROP_MISSING_FILES=False, CREATE_PLOTS=[], DO_CHECKS=[], PATH_TO_GRIDS='', PATH='.', previously_created_files=[], **kwargs)[source]

Create csv file with a list containing all data to process a step.

Parameters:
  • GRID_TYPES (list) – Grid types in the directory tree in PATH_TO_GRIDS.

  • METALLICITIES (list) – Metallicities in the directory tree below grid types (or version).

  • GRID_SLICES (list) – Grid slices in the directory tree below the metallicities.

  • COMPRESSIONS (list) – Compression types (e.g. LITE or ORIGINAL).

  • step_name (str) – String representation of the step. It will be used in the file name.

  • VERSION (str) – Version in the directory tree level below the grid type. (outdated)

  • PLOT_EXTENSION (str) – The file extension for plots recognized by mathplotlib or ‘multipage-pdf’.

  • GRIDS_COMBINED (list) – The names of the new grids combined from several slices.

  • ORIGINAL_COMPRESSIONS (list) – Grids with the orgininal compression to get detailed data from them.

  • INTERPOLATION_METHODS (list) – The interpolation methodes (e.g. linear or 1NN).

  • PROFILE_NAMES (list) – The profiles which should get interpolated (e.g. radius, logRho, …)

  • CONTROL_GRIDS (list) – Grids used to check the interpolators.

  • STOP_BEFORE_CARBON_DEPLETION (int) – Flag to stop high mass stars before carbon depletion because of chaotic behavior.

  • RERUN_TYPE (str) – Rerun types (e.g. PISN, reverse_MT, …).

  • CLUSTER (str) – Name of the cluster (e.g. yggdrasil or quest).

  • DROP_MISSING_FILES (bool) – Enable/Disable to ignore files which neither exists nor are created beforehand.

  • CREATE_PLOTS (list) – Requested plots to be created (e.g. combined_TF12, termination_flag_1, …).

  • DO_CHECKS (list) – Requested checks (e.g. failure_rate, CO_type).

  • PATH_TO_GRIDS (str) – Path where to find the root directory of the grids.

  • PATH (str) – Path of the working directory.

  • previously_created_files (list) – List of filenames created by previous steps.

  • kwargs (dict) – Other parameters (all being ignored).

Returns:

List of names of files which will be created by this step.

Return type:

list

posydon_setup_pipeline.get_log_file_name(job_name, step_name)[source]

Get name of log file

Parameters:
  • job_name (str) – Name of the job.

  • step_name (str) – Name of the step/parent job the job belongs to.

Returns:

Name of the log file.

Return type:

str

posydon_setup_pipeline.slurm_job(job_name, step_name, PATH_TO_GRIDS=None, PATH_TO_POSYDON=None, PATH='.', ACCOUNT=None, PARTITION=None, WALLTIME=None, MAILTYPE=None, EMAIL=None, VERBOSE=False, **kwargs)[source]

Create slurm file.

Parameters:
  • job_name (str) – String representation of the job. It will be used in the file name.

  • step_name (str) – String representation of the parent step. It will be used for the logs.

  • PATH_TO_GRIDS (str) – Path where to find the root directory of the grids.

  • PATH_TO_POSYDON (str) – Path where to find the root directory of POSYDON.

  • PATH (str) – Path of the working directory.

  • ACCOUNT (str) – The slurm account name. Passed to slurm’s option ‘–account’.

  • PARTITION (str) – The slurm partition name. Passed to slurm’s option ‘–partition’.

  • WALLTIME (str) – Maximum time for the slurm job. Passed to slurm’s option ‘–time’.

  • MAILTYPE (str) – Specifier, which emails to send by slurm. Passed to slurm’s option ‘–mail-type’. It requires EMAIL to be set, too.

  • EMAIL (str) – Email address to send mails to. Passed to slurm’s option ‘–mail-user’. It requires MAILTYPE to be set, too.

  • VERBOSE (bool) – Enables/Disables additional output.

  • kwargs (dict) – Other parameters (all being ignored).