    Delete a model component.

delete_model_component(name)
name - str

If a model instance called pl has been created - e.g. by

create_model_component('powlaw1d', 'pl') - then the following will remove it:

>>> delete_model_component('pl')

PARAMETERS

The parameter for this function is:

Parameter
Definition
name
The name used to refer to this instance, or component, of the model. The corresponding Python variable will be deleted by this function.

Notes

It is an error to try to delete a component that is part of a model expression - i.e. included as part of an expression in a

`set_model` or `set_source` call. In such a situation, use the

`delete_model` function to remove the source expression before calling `delete_model_component` .

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

December 2023