[ENH] DomainModel: Don't Show Hidden Variables by Default#2690
[ENH] DomainModel: Don't Show Hidden Variables by Default#2690janezd merged 2 commits intobiolab:masterfrom
Conversation
Orange/widgets/utils/itemmodels.py
Outdated
| (domain.attributes, domain.class_vars, domain.metas)) | ||
| if (1 << i) & section))) | ||
| if self.skip_hidden_vars: | ||
| to_add = filter_visible(to_add) |
There was a problem hiding this comment.
to_add = list(filter_visible(to_add))
This is needed because of if to_add later on, which tests whether there is some more content and a separator needs to be added. Since filter_visible returns a generator, the condition is always True and a separator is added even when the generator would return nothing.
There was a problem hiding this comment.
It should be fixed now. Though, in the future, we might consider changing filter_visible to return a tuple instead of a generator.
janezd
left a comment
There was a problem hiding this comment.
Fails existing tests. See the comment on how to fix it.
|
Could you add some tests? Actually, I added them. (You're welcome. :) ). I haven't added the fix for the bug from the comment. Squash it into your previous commit. :) |
ce019e3 to
175887e
Compare
Codecov Report
@@ Coverage Diff @@
## master #2690 +/- ##
==========================================
+ Coverage 75.81% 75.82% +<.01%
==========================================
Files 338 338
Lines 59493 59512 +19
==========================================
+ Hits 45106 45125 +19
Misses 14387 14387 |
Issue
DomainModel shows all variables, even those, that are marked as hidden.
Description of changes
DomainModel shows only non-hidden variables by default. If
skip_hidden_varsis set toFalse, all variables are shown.Includes