Skip to content

Refactor superset checking of MultiIndexSet instsances.

Damar Wicaksono requested to merge dev-129-c into dev

The method is_super_index_set_of() method of the MultiIndexSet class is now renamed to is_superset() for brevity and to conform with the method of the Python sets.

The instance of the class now also supports the operator >= for superset checking. By default via the operator, if there is a difference in the spatial dimension, the set with the lower dimension is first expanded. This behavior can be changed via a parameter in the method call.

This MR should partially resolve Issue #129 (closed).

Some additional changes:

  • The method contains_these_exponents() is refactored to include an optional parameter expand_dim whose default value is set to False. This change is to simplify the code as both is_subset() and is_superset() methods both use contains_these_exponents() and each of those methods implement the same dimension expansion logic.
  • The test suite is updated to include testing for superset checking.
  • The How-To Guide on superset checking is updated with the checking via operator.

Merge request reports