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] OWRank: Select Attributes fixes and improvements #3084

Merged
merged 3 commits into from
Jul 2, 2018

Conversation

thocevar
Copy link
Contributor

@thocevar thocevar commented Jun 22, 2018

  • allow change of selection method from All to Manual
  • add selection method and selected_rows to context settings
Includes
  • Code changes
  • Tests
  • Documentation

@thocevar
Copy link
Contributor Author

Loading the manually selected rows from context settings doesn't work. Method autoSelection doesn't seem to successfully select the rows in the view's selection model. As a consequence, on_select overwrites the selected_rows with an empty list.

@codecov-io
Copy link

codecov-io commented Jun 22, 2018

Codecov Report

Merging #3084 into master will increase coverage by 0.01%.
The diff coverage is 60%.

@@            Coverage Diff             @@
##           master    #3084      +/-   ##
==========================================
+ Coverage   82.42%   82.43%   +0.01%     
==========================================
  Files         335      335              
  Lines       58037    58105      +68     
==========================================
+ Hits        47838    47901      +63     
- Misses      10199    10204       +5

@ales-erjavec
Copy link
Contributor

Loading the manually selected rows from context settings doesn't work.

Try

diff --git a/Orange/widgets/data/owrank.py b/Orange/widgets/data/owrank.py
index 83436d3ae..c0a009ff8 100644
--- a/Orange/widgets/data/owrank.py
+++ b/Orange/widgets/data/owrank.py
@@ -339,7 +339,7 @@ class OWRank(OWWidget):
             self.selectionMethod = OWRank.SelectNBest
 
         self.openContext(data)
-        self.setSelectionMethod(self.selectionMethod)
+        self.selectButtons.button(self.selectionMethod).setChecked(True)
 
     def handleNewSignals(self):
         self.setStatusMessage('Running')

setSelectionMethod calls autoSelection, but in set_data the ranksModel is still empty.

@thocevar thocevar changed the title [RFC] [FIX] OWRank: selection method [FIX] OWRank: selection method Jun 26, 2018
@@ -523,9 +523,6 @@ def commit(self):
selected_attrs = []
if self.data is not None:
attributes = self.data.domain.attributes
if len(attributes) == len(self.selected_rows):
Copy link
Contributor

Choose a reason for hiding this comment

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

You can delete the row above as well and use the long version below (it is now only used once)

@lanzagar
Copy link
Contributor

While fixing this, could you also change it so that commit is only called once.

@lanzagar lanzagar changed the title [FIX] OWRank: selection method [FIX] OWRank: Select Attributes fixes and improvements Jun 29, 2018
@lanzagar lanzagar merged commit 4b92960 into biolab:master Jul 2, 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.

4 participants