lama/common.py
def cfg_load(cfg) -> Dict:
    """
    There are 2 types of config file used in the project yaml an toml. Will move to al tml at some point

    This function wraps around both

    Returns
    -------
    Dictionary config
    """
    cfg = Path(cfg)

    if not cfg.is_file():
        raise FileNotFoundError(f'Cannot find required config file: {cfg}')

    if Path(cfg).suffix == '.yaml':

        try:
            with open(cfg, 'r') as fh:
                return yaml.load(fh, Loader=yaml.FullLoader)
        except Exception as e:
            raise ValueError("can't read the config file - {}".format(e))

    elif Path(cfg).suffix == '.toml':
        try:
            return toml.load(cfg)
        except Exception as e:
            raise ValueError("can't read the config file - {}".format(e))

    else:
        raise ValueError('Config file should end in .toml or .yaml')

    There are 2 types of config file used in the project yaml an toml. Will move to al tml at some point

    This function wraps around both

    Returns
    -------
    Dictionary config
    
There are 2 types of config file used in the project yaml an toml. Will move to al tml at some point
This function wraps around both

Returns

Dictionary config
There are 2 types of config file used in the project yaml an toml . Will move to al tml at some point This function wraps around both Returns Dictionary config
def cfg_load(cfg) -> Dict:
    cfg = Path(cfg)
    if not cfg.is_file():
        raise FileNotFoundError(f'Cannot find required config file: {cfg}')
    if Path(cfg).suffix == '.yaml':
        try:
            with open(cfg, 'r') as fh:
                return yaml.load(fh, Loader=yaml.FullLoader)
        except Exception as e:
            raise ValueError("can't read the config file - {}".format(e))
    elif Path(cfg).suffix == '.toml':
        try:
            return toml.load(cfg)
        except Exception as e:
            raise ValueError("can't read the config file - {}".format(e))
    else:
        raise ValueError('Config file should end in .toml or .yaml')
def cfg_load ( cfg ) -> Dict : cfg = Path ( cfg ) if not cfg . is_file ( ) : raise FileNotFoundError ( f'Cannot find required config file: {cfg}' ) if Path ( cfg ) . suffix == '.yaml' : try : with open ( cfg , 'r' ) as fh : return yaml . load ( fh , Loader = yaml . FullLoader ) except Exception as e : raise ValueError ( "can't read the config file - {}" . format ( e ) ) elif Path ( cfg ) . suffix == '.toml' : try : return toml . load ( cfg ) except Exception as e : raise ValueError ( "can't read the config file - {}" . format ( e ) ) else : raise ValueError ( 'Config file should end in .toml or .yaml' )
There are 2 types of config file used in the project yaml an toml.
There are 2 types of config file used in the project yaml an toml .
"""
    There are 2 types of config file used in the project yaml an toml. Will move to al tml at some point

    This function wraps around both

    Returns
    -------
    Dictionary config
    """
cfg