exa.core.model_selection_fitter.models.model_utils.prefixed_expr

Contents

exa.core.model_selection_fitter.models.model_utils.prefixed_expr#

prefixed_expr(set_param_hint)#

Decorates set_param_hint to prefix every parameter name inside an expr hint.

lmfit prefixes the parameters a model owns but never rewrites the expression text of its hints, so an expr written in bare names refers to nothing once the model has a prefix. Rewriting the expression here, before it reaches lmfit, means every hint that ties parameters together can be written once, in bare names, and keeps working regardless of the prefix the model is given.

Parameters:

set_param_hint (Callable[[...], None]) – The model’s set_param_hint method, wrapped so any expr it is given is prefixed first.

Returns:

A set_param_hint that prefixes the parameter names inside expr before lmfit sees it.

Return type:

Callable[[…], None]