phenotypic.sdk_.slurm.format_sbatch_directives#

phenotypic.sdk_.slurm.format_sbatch_directives(job_name: str, slurm_args: Dict[str, Any], output_log: Path, error_log: Path) str[source]#

Generate #SBATCH directive lines for a SLURM script.

Converts CLI SLURM parameters to #SBATCH directives with proper formatting. Reserved keys (array, output, error, job-name) are silently skipped because they are managed by the script generators.

Parameters:
  • job_name (str) – Job name for --job-name.

  • slurm_args (Dict[str, Any]) – SLURM parameters dict (CLI-style keys like slurm_partition, mem_gb, time).

  • output_log (Path) – Path for stdout log.

  • error_log (Path) – Path for stderr log.

Returns:

String with all #SBATCH directives joined by newlines.

Return type:

str

Notes

  • Time parameters (time, slurm_time) as integers are treated as minutes and converted to HH:MM:SS.

  • mem_gb is converted to --mem=<N>G.