Skip to content

skais_mapper.utils.config

Configuration and runtime utility functions.

Functions:

Name Description
get_run_id

Fetch a run-specific identifier.

set_run_id

Set the run-specific identifier.

get_run_id

get_run_id(length: int = 8) -> str

Fetch a run-specific identifier.

Source code in skais_mapper/utils/config.py
13
14
15
16
17
def get_run_id(
    length: int = 8,
) -> str:
    """Fetch a run-specific identifier."""
    return str(skais_mapper.RUN_UID).replace("-", "")[:length]

set_run_id

set_run_id(run_id: uuid.UUID | str | None = None)

Set the run-specific identifier.

Source code in skais_mapper/utils/config.py
20
21
22
23
24
25
26
def set_run_id(run_id: uuid.UUID | str | None = None):
    """Set the run-specific identifier."""
    if run_id is None:
        run_id = uuid.uuid4()
    if not isinstance(run_id, uuid.UUID):
        run_id = uuid.UUID(run_id)
    skais_mapper.RUN_UID = run_id