set_model_autoassign_func¶
-
sherpa.astro.ui.
set_model_autoassign_func
(func=None)¶ Set the method used to create model component identifiers.
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: func (function reference) – The function to use: this should accept two arguments, a string (component name), and the model instance. See also
create_model_component()
- Create a model component.
get_model_autoassign_func()
- Return the method used to create model component identifiers
set_model()
- Set the source model expression for a data set.
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.