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] Feature Constructor: no fail when no values #2417

Merged
merged 2 commits into from
Jun 21, 2017
Merged

[FIX] Feature Constructor: no fail when no values #2417

merged 2 commits into from
Jun 21, 2017

Conversation

jerneju
Copy link
Contributor

@jerneju jerneju commented Jun 21, 2017

Issue

Error occurs when Values box is empty.
screenshot_20170621_114851

Description of changes
Includes
  • Code changes
  • Tests
  • Documentation

@jerneju
Copy link
Contributor Author

jerneju commented Jun 21, 2017

@codecov-io
Copy link

codecov-io commented Jun 21, 2017

Codecov Report

Merging #2417 into master will decrease coverage by 0.35%.
The diff coverage is 86.36%.

@@            Coverage Diff            @@
##           master   #2417      +/-   ##
=========================================
- Coverage   74.25%   73.9%   -0.36%     
=========================================
  Files         320     320              
  Lines       55786   55799      +13     
=========================================
- Hits        41425   41236     -189     
- Misses      14361   14563     +202

@@ -244,7 +244,7 @@ def setEditorData(self, data, domain):
def editorData(self):
values = self.valuesedit.text()
values = re.split(r"(?<!\\),", values)
values = tuple(v.replace(r"\,", ",").strip() for v in values)
values = tuple(filter(None, [v.replace(r"\,", ",").strip() for v in values]))
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 use generators instead of list comprehension, that is

values = tuple(filter(None, (v.replace(r",", ",").strip() for v in values)))

@@ -292,7 +292,7 @@ def data(self, index, role=Qt.DisplayRole):
return super().data(index, role)


class FeatureConstructorSettingsHandler(DomainContextHandler):
class FeatureConstructorHandler(DomainContextHandler):
Copy link
Contributor

Choose a reason for hiding this comment

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

I preferred the original name. In fact, I'd call it FeatureConstructorContextHandler and disable the pylint's warning. The current name suggest that it handles the feature constructor, not its contexts.

@janezd janezd merged commit 5afe1c2 into biolab:master Jun 21, 2017
@jerneju jerneju deleted the index-feature branch June 23, 2017 06:56
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