# AUTOGENERATED! DO NOT EDIT! File to edit: nbdev_nbs/settings.ipynb (unless otherwise specified).

__all__ = ['update_settings', 'global_settings', 'model_const']

# Cell
import os
import collections

from alphabase.yaml_utils import load_yaml

_base_dir = os.path.dirname(__file__)

global_settings = load_yaml(
    os.path.join(_base_dir, 'constants/default_settings.yaml')
)

model_const = load_yaml(
    os.path.join(_base_dir, 'constants/model_const.yaml')
)

def update_settings(dict_, new_dict):
    for k, v in new_dict.items():
        if isinstance(v, collections.abc.Mapping):
            dict_[k] = update_settings(dict_.get(k, {}), v)
        else:
            dict_[k] = v
    return dict_