Pass a Model defined in a config file to a later file

Hello! I have a code composed of various modules. I would like the user to be able to set the form of the priors of a model in a config file, but without fitting it until the function in which it’s used it’s called. Right now, I’m doing everything in the function, in a very inelegant way:

    model = pm.Model()

    with model:
        
        for par in config.PARAMETERS:
            if(par != 'csi'):
                guy.priors[par] = pm.Normal(par, mu=0, sigma=5)
            else:
                guy.priors[par] = pm.HalfNormal(par, sigma=5)
        # Expected value of outcome
        cost = config.TCA_MODEL.weighted_cost(data, guy.priors)
    
        # Likelihood (sampling distribution) of observations
        Y_obs = config.TCA_MODEL.likelihood('Y_obs', data, cost , guy.priors)`

I would like to set the Normal and HalfNormal in the same config file the variables come from. Is there a way to do it?

I too am interested in a correct, pythonic way to do this. What typically do is something a little annoying like

Definition file:

Normal,mu_b,0,1
HalfNormal,sd_b,1
Normal,X,mu_b,sd_b

and code like

obs = None
with pm.Model() as mod:
    vars = dict()
    for j, fields in enumerate(config_defs):
        cls = PYMC_CLASSES[fields[0]]
        name = fields[1]
        args = [name]
        for arg in fields[1:]:
            if isinstance(arg, str):
                args.append(vars[arg])
            else:
                args.append(arg)
        if j == len(config_defs) - 1:  # last entry in file assumed to be observed
            obs = Y
        vars[name] = cls(*args, observed=obs)

Hey! Pardon me, but I am a noob in Pymc, and am having some trouble understanding your code. How should I structure the config file in such a way that I can do the same You do with PYMC_CLASSES, fields and config_defs?