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

[ENH] Remove discrete attributes from scatter plot's axes #3434

Merged
merged 2 commits into from
Dec 10, 2018

Conversation

janezd
Copy link
Contributor

@janezd janezd commented Nov 30, 2018

Issue

Fixes #3318.

Includes
  • Code changes
  • Modified tests

@janezd janezd changed the title [ENH] Remove discrete attributes from scatter plot's axes [WIP] [ENH] Remove discrete attributes from scatter plot's axes Nov 30, 2018
@janezd janezd force-pushed the scatterplot-no-discrete branch 3 times, most recently from 5cbc1f7 to 02fca55 Compare December 1, 2018 21:52
@codecov
Copy link

codecov bot commented Dec 1, 2018

Codecov Report

Merging #3434 into master will decrease coverage by 0.03%.
The diff coverage is 96.87%.

@@            Coverage Diff             @@
##           master    #3434      +/-   ##
==========================================
- Coverage   83.27%   83.24%   -0.04%     
==========================================
  Files         365      365              
  Lines       64305    64276      -29     
==========================================
- Hits        53549    53505      -44     
- Misses      10756    10771      +15

@janezd janezd changed the title [WIP] [ENH] Remove discrete attributes from scatter plot's axes [ENH] Remove discrete attributes from scatter plot's axes Dec 1, 2018
Copy link
Contributor

@VesnaT VesnaT left a comment

Choose a reason for hiding this comment

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

Until this PR the widget expected self.effective_variables are always set when self.data is not None.
With this change, if there are not continuous variables in input data, self.effective_variables happens to be [None, None], which causes several errors.
Maybe you could add a check in check_data() (clearing the plot and showing an error message would be nice as well).

        if self.data is not None:
            if not self.data.domain.has_continuous_attributes(True, True):
            	self.Error.no_continuous_vars()
                self.data = None

I don't mind any other solution, just make sure (a potential test - that should probably be added) passes:

    def test_change_data(self):
        self.send_signal(self.widget.Inputs.data, self.data)
        self.send_signal(self.widget.Inputs.data, Table("titanic"))

@janezd janezd force-pushed the scatterplot-no-discrete branch 2 times, most recently from 05c3811 to 80ef6bd Compare December 6, 2018 21:03
@janezd
Copy link
Contributor Author

janezd commented Dec 6, 2018

Thanks for the fix and the test (I also added a few checks).

@VesnaT VesnaT merged commit 8e166fb into biolab:master Dec 10, 2018
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.

2 participants