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] ScatterPlot: Fix crash when coloring by column of unknowns #2061

Merged
merged 1 commit into from
Mar 3, 2017
Merged

[FIX] ScatterPlot: Fix crash when coloring by column of unknowns #2061

merged 1 commit into from
Mar 3, 2017

Conversation

jerneju
Copy link
Contributor

@jerneju jerneju commented Mar 1, 2017

Issue

ValueError cannot convert float NaN to integer owscatterplot
In case when all column values are NaN then it throws that error.
https://sentry.io/biolab/orange3/issues/196744604/

Description of changes

Logarithm of zero and division by zero are prevented.

Includes
  • Code changes
  • Tests
  • Documentation

@jerneju
Copy link
Contributor Author

jerneju commented Mar 1, 2017

@codecov-io
Copy link

codecov-io commented Mar 1, 2017

Codecov Report

Merging #2061 into master will increase coverage by 1.1%.
The diff coverage is 92.85%.

@@            Coverage Diff            @@
##           master    #2061     +/-   ##
=========================================
+ Coverage   68.84%   69.94%   +1.1%     
=========================================
  Files         315      315             
  Lines       53965    54006     +41     
=========================================
+ Hits        37152    37776    +624     
+ Misses      16813    16230    -583

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 34b5e94...1cba002. Read the comment docs.

In case when all column values are NaN then it throws that error.
GH-2061
"""
dat = """\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a special reason why the dataset is generated in this way? (and not with table like in https://github.com/biolab/orange3/pull/2057/files#diff-1a66c8eae521f07f1c5d904e0cd025a7R117)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No particular reason at all. Now changed.

data = TabReader(file).read()
self.send_signal("Data", data)

self.widget.graph.attr_color = self.widget.get_shown_attributes()[1]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you select attributes using helpers found in https://github.com/biolab/orange3/blob/master/Orange/widgets/tests/utils.py#L268?

@astaric astaric changed the title [FIX] ValueError owscatterplot [FIX] ScatterPlot: Fix crash when column with no values is selected as color Mar 3, 2017
@astaric astaric changed the title [FIX] ScatterPlot: Fix crash when column with no values is selected as color [FIX] ScatterPlot: Fix crash when coloring by column of unknowns Mar 3, 2017
@lanzagar lanzagar self-assigned this Mar 3, 2017
ValueError cannot convert float NaN to integer owscatterplot
In case when all column values are NaN then it throws that error.
https://sentry.io/biolab/orange3/issues/196744604/
@astaric astaric merged commit 0ad5641 into biolab:master Mar 3, 2017
@@ -409,7 +409,7 @@ def handleNewSignals(self):
self.graph.new_data(self.data_metas_X, self.subset_data)
if self.attribute_selection_list and \
all(attr in self.graph.domain
for attr in self.attribute_selection_list):
for attr in self.attribute_selection_list):
Copy link
Contributor

@kernc kernc Mar 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was indented OK before.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pylint complained and that is why I added 4 spaces.

@jerneju jerneju deleted the valueerror-owscatterplot-nanint branch April 20, 2017 13:47
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.

5 participants