Clean up and update the available set operations associated with MultiIndexSet instances
The current implementation of MultiIndex
supports three set operations:
-
union
: create a union from two multi-index sets. -
is_sub_index_set_of
: Check if a given multi-index set is a subset of another. -
is_super_index_set_of
: Check if a given multi-index set is a superset of another.
To conform with Python set operations, we are going to update these methods with corresponding operators along with a couple of new methods and operators.
For now, we are going to focus on comparison operations.
Let mi_1
and mi_2
be two instances of MultiIndexSet
.
Operation | Method | Operator | Remark | Resolution |
---|---|---|---|---|
Subset | mi_1.is_subset(mi_2) |
<= |
renamed from is_sub_index_set_of
|
MR !98 (merged) |
Proper subset | mi_1.is_propsubset(mi_2) |
< |
New | MR !99 (merged) |
Superset | mi_1.is_superset(mi_2) |
>= |
renamed from is_super_index_set_of
|
MR !100 (merged) |
Proper superset | mi_1.is_propsuperset(mi_2) |
> |
New | MR !101 (merged) |
Disjoint check | mi_1.is_disjoint(mi_2) |
N/A | New | MR !102 (merged) |
This issue is related to the refactoring of the MultiIndexSet
class (Issue #99 (closed)).
Note that some of these operations are already listed as TODOs in the source code.
Several other obvious set operations like intersection and difference are for now deferred because we need to define an empty MultiIndexSet
to support those operations.
Edited by Damar Wicaksono