Ticket #1132 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

OWDistributions exception in a specific case of data change

Reported by: matija Owned by: ales
Milestone: Future Component: canvas
Severity: minor Keywords:
Cc: Blocking:
Blocked By:


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:
  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.

Change History

comment:1 Changed 2 years ago by Ales Erjavec <ales.erjavec@…>

  • Status changed from new to closed
  • Resolution set to fixed

In [efccc12d7cac1a772e465e56df6b52f03883c15b/orange]:

Fixed some errors in OWDistribution widget (fixes #1132).

Note: See TracTickets for help on using tickets.