-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
Description
I'd like to implement the Julia set operations union
, intersect
, setdiff
, etc. on ComponentSelector
s. I want the interface to look roughly like this:
selector_i = intersect(selector1, selector2, selector3; groupby = SOMETHING)
but I need to think through the grouping behavior in more detail. Here are some invariants I think I want for a default grouping behavior:
union
of two selectors where none of the group names are the same and none of the components are the same: new groups = union of old groups, new components = union of old components- Any set operation on two selectors that each only have one group, and the group name is the same: new groups = that one group, new components = that set operation on old components
get_components(set_operation(selectors...))
should be the same asset_operation(get_components(selectors)...)
and then I guess the task is to parsimoniously fill in the gaps. One option to avoid this complexity would be to force the user to specify a groupby
, but I want the union
of two non-overlapping ListComponentSelector
s to "just work." Another option is to error on the tricky cases, but it would be nice if the user could do this and be guaranteed that it won't error no matter the system.