    Set the method used to create model component identifiers.

set_model_autoassign_func(func=None)
func - function reference

When a model component is created, the default behavior is to add the component to the default Python namespace. This is controlled by a function which can be changed with this routine.

PARAMETERS

The parameter for this function is:

Parameter
Definition
func
The function to use: this should accept two arguments, a string (component name), and the model instance.

Notes

The default assignment function first renames a model component to include the model type and user-defined identifier. It then updates the '__main__' module's dictionary with the model identifier as the key and the model instance as the value. Similarly, it updates the '__builtin__' module's dictionary just like '__main__' for compatibility with IPython.

See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

December 2023