[RFC] Domain: return all variables#2706
[RFC] Domain: return all variables#2706jerneju wants to merge 2 commits intobiolab:masterfrom jerneju:domain-variables
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2706 +/- ##
==========================================
- Coverage 75.9% 75.89% -0.01%
==========================================
Files 338 338
Lines 59594 59598 +4
==========================================
- Hits 45233 45232 -1
- Misses 14361 14366 +5 |
|
Great. Now please update the description of the pull request with the description of the problem (what are we trying to solve) and the proposed way to fix it. If there are alternative ways we could do this, list those as well so we can discuss and find out which of them should be implemented. |
|
Which of the issues does this PR solve? If I understand correctly, problems 1. and 3. remain even after the fix. Furthermore, I do not like the addition of a new "base class". Variable already has method Are there any other ways this could be solved? What are their (dis)advantages? Why should use the fix in this PR and not one of the alternative approaches? |
So you can call |
|
domain.all(Variable.is_primitive)? |
Interesting. And it can be called |
|
I would still like to know what are the alternatives. The correct way IMHO would be to fix |
|
👍² for fixing The predicate nature of input parameter is precisely why 👎 for |
|
Fixing
|
|
Yes, fixing |
Me? No chance. Too risky. I've no idea how to scan through all current iterations through Besides, add-ons do this, too. The first step towards this would be adding a warning to the existing |
|
I propose:
|
|
I am not too fond of adding methods we plan to remove in half a year (once |
|
I still like I don't mind if it's called |
|
|
|
|
|
Why aren't you happy? What's wrong with |
|
You mean But I'm OK with (builtin) |
|
I really really really dislike the artificial |
|
We already have |
Not much. But it's not so artificial: Variable can be either PrimitiveVariable or NonPrimitiveVariable. Primitive can be Discrete or Continuous. There is a hierarchy. There are just no specific common methods for PrimitiveVariable. Think about PrimitiveVariable as an ABC.
... which can be used as a predicate if |
|
Assuming we will some day fix With this PR we can already have Without any obvious advantage of the latter over the former, I'm applying Occam here. |
Issue
Due to historical background Orange Data Mining has issues:
domain.variablesare attributes and classes but not metasdomain.somethingwhere that would be attributes, classes, and metas.some_meta in domainmay returnTrue, but when one would iterate overdomainit does not iterate over metas.See also:
#2699 (comment)
#2699 (comment)
Description of changes
PrimitiveVariable (created only to be used for separating primitive and non primitive variables).
Domain method which returns list of all features. This method can be called with an argument which specifies which features to return (all by default).
Includes