[ENH] Edit Domain: Merge categorical values#3725
Merged
janezd merged 8 commits intobiolab:masterfrom Apr 12, 2019
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3725 +/- ##
==========================================
+ Coverage 84.53% 84.81% +0.27%
==========================================
Files 373 374 +1
Lines 68471 68749 +278
==========================================
+ Hits 57884 58307 +423
+ Misses 10587 10442 -145 |
... to count values within renamed values only and not added/dropped.
janezd
reviewed
Apr 10, 2019
Orange/widgets/data/oweditdomain.py
Outdated
|
|
||
| from Orange.preprocess.transformation import Identity, Lookup | ||
| from Orange.widgets import widget, gui, settings | ||
| from Orange.widgets.data.owconcatenate import unique |
Contributor
There was a problem hiding this comment.
I'd avoid importing functions from widget modules if possible because it messes up dependencies and complicates future refactorings. I think we'd better treat all functions in widget modules as private (even if not named as such), just as we treat widget classes as final.
Do we have a better place for functions like unique?
Perhaps better, isn't unique(s) same as iter(dict.fromkeys(s)) (formally from Python 3.7, de facto already in 3.6). In below code, it's used as list(unique(s)), which is, I suppose, the same as list(dict.fromkeys(s)).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Implements gh-3371
Also fixes and assertion error when two values are renamed to the same value.
Description of changes
Implement merging of categorical values.
Merging can be achieved by simply renaming individual values to the same name, or by selecting multiple values and pressing the merge button (shortcut ctrl + =) and entering/selecting a name in an editable combo box.
Includes