Skip to content

envconfig

envconfig

Module for extracting information from the environment

Functions

get_local_exp_cache_path

get_local_exp_cache_path()

Returns path of local exp cache from environment

Source code in niceml/config/envconfig.py
def get_local_exp_cache_path() -> Optional[str]:
    """Returns path of local exp cache from environment"""
    return getenv(LOCAL_EXP_CACHE_PATH_KEY, None)

replace_id_keys

replace_id_keys(input_str, short_id, run_id)

Replaces the keys $SHORT_ID and $RUN_ID with their actual values

Source code in niceml/config/envconfig.py
def replace_id_keys(input_str: str, short_id: str, run_id: str) -> str:
    """Replaces the keys $SHORT_ID and $RUN_ID with their actual values"""
    input_str = input_str.replace("$" + SHORT_ID_KEY, short_id)
    input_str = input_str.replace("$" + RUN_ID_KEY, run_id)

    return input_str