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: Fix an error when the input dataset contains NaN #1972

Merged
merged 1 commit into from
Feb 3, 2017

Conversation

ales-erjavec
Copy link
Contributor

Issue

Input

X1,X2,D
c,c,d
,,class
1,1,a
1,1,?
2,1,b

To Paint Data widget (i.e. an unknown in the class column)

-> On current master

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 1237, in _replot
    pen = [pens[ci] for ci in self.__buffer[:, 2].astype(int)]
  File "/Users/aleserjavec/workspace/orange3/Orange/widgets/data/owpaintdata.py", line 1237, in <listcomp>
    pen = [pens[ci] for ci in self.__buffer[:, 2].astype(int)]
IndexError: list index out of range

-> On 3.3.10

Traceback (most recent call last):
  File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/Orange/canvas/scheme/widgetsscheme.py", line 822, in process_signals_for_widget
    handler(*args)
  File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/Orange/widgets/data/owpaintdata.py", line 1023, in set_data
    self.reset_to_input()
  File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/Orange/widgets/data/owpaintdata.py", line 1042, in reset_to_input
    self._replot()
  File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/Orange/widgets/data/owpaintdata.py", line 1227, in _replot
    pen=[pens[int(ci)] for ci in self.data[:, 2]]
  File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/Orange/widgets/data/owpaintdata.py", line 1227, in <listcomp>
    pen=[pens[int(ci)] for ci in self.data[:, 2]]
ValueError: cannot convert float NaN to integer
Description of changes
Includes
  • Code changes
  • Tests
  • Documentation

@codecov-io
Copy link

codecov-io commented Jan 27, 2017

Current coverage is 89.45% (diff: 100%)

Merging #1972 into master will not change coverage

@@             master      #1972   diff @@
==========================================
  Files            90         90          
  Lines          9182       9182          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits           8214       8214          
  Misses          968        968          
  Partials          0          0          

Sunburst

Powered by Codecov. Last update 75de2c8...86cfe97

@astaric astaric modified the milestone: 3.3.11 Jan 30, 2017
@janezd janezd merged commit ef56cfb into biolab:master Feb 3, 2017
astaric pushed a commit that referenced this pull request Feb 3, 2017
[FIX] owpaintdata: Fix an error when the input dataset contains NaN
(cherry picked from commit ef56cfb)
@ales-erjavec ales-erjavec deleted the fixes/paint-nan-input 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.

4 participants