phenotypic.sdk_.slurm.sbatch_submission_environment#

phenotypic.sdk_.slurm.sbatch_submission_environment(environment: Mapping[str, str] | None = None) dict[str, str][source]#

Snapshot the caller’s Python path under a SLURM-safe variable.

Some clusters explicitly filter PYTHONPATH even when sbatch uses --export=ALL. PhenoTypic batch scripts restore this namespaced copy before invoking Python.

Parameters:

environment (Mapping[str, str] | None) – Environment to copy. Defaults to os.environ.

Returns:

A detached environment mapping suitable for subprocess.run.

Return type:

dict[str, str]