docs: def set_partition(self, partition):
          """
          Store the partition in self.partition, and
          move the old self.partition into self.prev_partition
          """
          assert len(partition) == self.numgrp
          self.partition, self.prev_partition = partition, self.partition