exa.core.model_selection_fitter.models.model_utils.prefix_expr#
- prefix_expr(model, expr)#
The expression with every parameter of
modelit names carrying the model prefix.lmfitprefixes the parameters a model owns but not the names inside the expressions its hints carry, so an expression written in bare names refers to nothing once the model has a prefix. Rewriting it here keeps one spelling of the expression working for every prefix.Used directly where a prefixed expression is needed outside of
set_param_hint, such aspost_fitadding a parameter to an already-fittedParametersobject. Everywhere a hint is set, prefer decoratingset_param_hintwithprefixed_expr()instead.- Parameters:
model (Model) – Model whose prefix and parameter names the expression is rewritten for.
expr (str) – Expression in bare (prefix-free) parameter names.
- Returns:
The expression with the model prefix on each name that is a parameter of the model, and every other name, such as a function or a constant, left as it was.
- Return type: