yasfpy.coupling.env#
Environment-variable helpers for coupling backends.
These helpers centralize parsing/normalization of environment variables used to control coupling backend behavior (GPU strategy selection, chunk sizes, experimental toggles).
Notes
These are intentionally forgiving: invalid inputs fall back to defaults rather than raising, to keep CLI and batch runs robust.
Functions#
|
Parse a boolean environment variable. |
|
Parse an integer environment variable with a lower bound. |
|
Normalize the GPU coupling strategy selector. |
Normalize the multi-wavelength GPU execution mode selector. |
Module Contents#
- yasfpy.coupling.env.parse_bool_env(name, *, default)#
Parse a boolean environment variable.
- Parameters:
name – Environment variable name.
default – Default value used when the variable is unset or invalid.
- Returns:
Parsed boolean value.
- Return type:
- yasfpy.coupling.env.parse_int_env(name, *, default, minimum=1)#
Parse an integer environment variable with a lower bound.
- Parameters:
name – Environment variable name.
default – Default value used when the variable is unset or invalid.
minimum – Lower bound enforced on the returned value.
- Returns:
Parsed integer value (at least
minimum).- Return type:
- yasfpy.coupling.env.normalize_gpu_strategy(value)#
Normalize the GPU coupling strategy selector.
- Parameters:
value – A raw environment variable value.
- Returns:
One of
{'auto', 'thread_row', 'block_row'}.- Return type: