Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] owpaintdata: Adjust color model to input dataset #1988

Merged
merged 1 commit into from
Feb 3, 2017

Conversation

ales-erjavec
Copy link
Contributor

Issue

Fix a IndexError when the input dataset's class variable has more then 17 values.

Traceback (most recent call last):
  File "/Users/aleserjavec/workspace/orange3/Orange/canvas/scheme/widgetsscheme.py", line 822, in process_signals_for_widget
    handler(*args)
  File "/Users/aleserjavec/workspace/orange3/Orange/widgets/data/owpaintdata.py", line 1029, in set_data
    self.reset_to_input()
  File "/Users/aleserjavec/workspace/orange3/Orange/widgets/data/owpaintdata.py", line 1051, in reset_to_input
    self._replot()
  File "/Users/aleserjavec/workspace/orange3/Orange/widgets/data/owpaintdata.py", line 1230, in _replot
    pens = [pen(self.colors[i]) for i in range(nclasses)]
  File "/Users/aleserjavec/workspace/orange3/Orange/widgets/data/owpaintdata.py", line 1230, in <listcomp>
    pens = [pen(self.colors[i]) for i in range(nclasses)]
  File "/Users/aleserjavec/workspace/orange3/Orange/widgets/utils/colorpalette.py", line 657, in __getitem__
    return QColor(*self.getRGB(value))
  File "/Users/aleserjavec/workspace/orange3/Orange/widgets/utils/colorpalette.py", line 667, in getRGB
    return self.rgb_array[-1 if np.isnan(value) else int(value)]
IndexError: index 18 is out of bounds for axis 0 with size 18
Description of changes

Adjust the color palette to the input dataset's class var colors.

Includes
  • Code changes
  • Tests
  • Documentation

Fix a IndexError when the input dataset's class variable has more then
17 values.
@ales-erjavec ales-erjavec added this to the 3.3.11 milestone Feb 3, 2017
@codecov-io
Copy link

codecov-io commented Feb 3, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@ef56cfb). Click here to learn what that means.

@@            Coverage Diff            @@
##             master    #1988   +/-   ##
=========================================
  Coverage          ?   89.47%           
=========================================
  Files             ?       91           
  Lines             ?     9198           
  Branches          ?        0           
=========================================
  Hits              ?     8230           
  Misses            ?      968           
  Partials          ?        0

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef56cfb...784589c. Read the comment docs.

@ales-erjavec ales-erjavec force-pushed the fixes/paint-data-input-colors branch 2 times, most recently from 1f0ff32 to 784589c Compare February 3, 2017 11:18
@janezd janezd self-assigned this Feb 3, 2017
@janezd janezd merged commit 2da497c into biolab:master Feb 3, 2017
astaric pushed a commit that referenced this pull request Feb 3, 2017
[FIX] owpaintdata: Adjust color model to input dataset
(cherry picked from commit 2da497c)
@ales-erjavec ales-erjavec deleted the fixes/paint-data-input-colors branch May 12, 2017 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants