Should the user be asked for the parameter values when creating a model?

When val is True, calls to set_model will cause the user to be prompted for each parameter in the expression. The prompt includes the parameter name and default value, in []: the valid responses are

  • return which accepts the default

  • value which changes the parameter value

  • value, min which changes the value and the minimum value

  • value, min, max which changes the value, minimum, and maximum values

The value, min, and max components are optional, so “,-5” will use the default parameter value and set its minimum to -5, while “2,,10” will change the parameter value to 2 and its maximum to 10, but leave the minimum at its default. If any value is invalid then the parameter is re-prompted.


val (bool, optional) – If True, the user will be prompted to enter each parameter value, including support for changing the minimum and maximum values, when a model component is created. The default is False.

See also


Set the source model expression for a data set.


Set the value, limits, or behavior of a model parameter.


Display the model expression used to fit a data set.


Setting this to True only makes sense in an interactive environment. It is designed to be similar to the parameter prompting provided by X-Spec 1.




In the following, the default parameter settings are accepted for the pl.gamma parameter, the starting values for the pl.ref and gline.pos values are changed, the starting value and ranges of both the pl.ampl and gline.ampl parameters are set, and the gline.fwhm parameter is set to 100, with its maximum changed to 10000.

>>> paramprompt(True)
>>> set_source( + gauss1d.gline)
pl.gamma parameter value [1]
pl.ref parameter value [1] 4500
pl.ampl parameter value [1] 1.0e-5,1.0e-8,0.01
gline.fwhm parameter value [10] 100,,10000
gline.pos parameter value [0] 4900
gline.ampl parameter value [1] 1.0e-3,1.0e-7,1