Skip to the navigation links
Last modified: 1 November 2022

URL: https://cxc.cfa.harvard.edu/sherpa/bugs/delete_model_component.html

Bugs: delete_model_component


Bugs

The command fails with a KeyError.

There is a bug in delete_model_component in Sherpa which causes it to fail with a KeyError: dataset_id

sherpa> set_source(xsphabs.abs1*powlaw1d.pl)
sherpa> delete_model_component("pl") 
KeyError: 1

While an error is thrown, the model component is successfully deleted.

sherpa> set_source(xsphabs.abs1*powlaw1d.p1)
sherpa> list_model_components()
          ['abs1', 'p1']
sherpa> delete_model_component("p1")
KeyError: 1
sherpa> list_model_components()
          ['abs1']