ska_sdp_e2e_batch_continuum_imaging.pipelines.environment module
- class ska_sdp_e2e_batch_continuum_imaging.pipelines.environment.EnvironmentContext[source]
Bases:
objectClass deals with environment context detection for the pipeline.
- static is_multinode()[source]
Determine if the current execution environment is multinode.
- Return type:
- Returns:
True if running in a multinode environment, False otherwise.
- ska_sdp_e2e_batch_continuum_imaging.pipelines.environment.use_env_vars(env)[source]
Temporarily updates the environment variables within a context.
This function is intended to be used as a context manager. It updates the current process's environment variables with the provided dictionary for the duration of the context, and restores the original environment afterwards.
- Parameters:
env (dict) -- A dictionary of environment variables to set temporarily.
- Yields:
None -- Control is yielded to the context block.
Examples
>>> with use_env_vars({'MY_VAR': 'value'}): ... # 'MY_VAR' is set within this block ... pass # 'MY_VAR' is removed/restored to its previous value after the block