Skip to content

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

Merged
janezd merged 2 commits intobiolab:masterfrom
jerneju:index-feature
Jun 21, 2017
Merged

[FIX] Feature Constructor: no fail when no values#2417
janezd merged 2 commits intobiolab:masterfrom
jerneju:index-feature

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

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)))



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