-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[ENH] DomainModel: Don't Show Hidden Variables by Default #2690
Conversation
Orange/widgets/utils/itemmodels.py
Outdated
@@ -903,6 +904,8 @@ def set_domain(self, domain): | |||
*(vars for i, vars in enumerate( | |||
(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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be fixed now. Though, in the future, we might consider changing filter_visible
to return a tuple instead of a generator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_vars
is set toFalse
, all variables are shown.Includes