Ticket #1132 (closed bug: fixed)
OWDistributions exception in a specific case of data change
|Reported by:||matija||Owned by:||ales|
OWDistributions throws the following exception when the number of classes in the input dataset is reduced and previously a class with a large index was selected as target value:
Unhandled exception of type IndexError occured at 8:55:13: Traceback: File: OWBaseWidget.py, line 678 in processSignals Code: handler(value) File: OWDistributions.py, line 666 in setData Code: f() File: OWDistributions.py, line 590 in setTarget Code: self.graph.setTargetValue(self.targetValue) File: OWDistributions.py, line 97 in setTargetValue Code: self.refreshProbGraph() File: OWDistributions.py, line 354 in refreshProbGraph Code: mps.append(ps[self.targetValue] + 0.0) IndexError: list index out of range
Steps to reproduce:
- Use a File widget to open the zoo dataset.
- Connect it to a Distributions widget.
- In this widget, choose mammal as target class.
- Connect File to a Select data widget, and in it, select only data where type=bird OR type=insect.
- Connect the output of Select Data to the input of (previously created) Distributions widget.
The exception is thrown, because now there are only two distinct class values, but the previously selected 'mammal' had index 5.