Skip to content

get_config

sklearn_wrap.config.get_config()

Return a copy of the current sklearn-wrap configuration.

Thread-local overrides (set via set_config or config_context) take precedence over the global defaults.

Returns

Type Description
dict[str, Any]

A dictionary with the current configuration values.

Examples

>>> cfg = get_config()
>>> "trusted_modules" in cfg
True

See Also

set_config : Persistently update the configuration. config_context : Temporarily update the configuration.

Source Code

Show/Hide source
def get_config() -> dict[str, Any]:
    """Return a copy of the current sklearn-wrap configuration.

    Thread-local overrides (set via `set_config` or `config_context`) take
    precedence over the global defaults.

    Returns
    -------
    dict[str, Any]
        A dictionary with the current configuration values.

    Examples
    --------
    >>> cfg = get_config()
    >>> "trusted_modules" in cfg
    True

    See Also
    --------
    set_config : Persistently update the configuration.
    config_context : Temporarily update the configuration.
    """
    config = _global_config.copy()
    config.update(getattr(_threadlocal, "config", {}))
    return config