Skip to content

Refactor custom copy behavior of MultiIndexSet instances.

Damar Wicaksono requested to merge dev-106 into dev

The custom dunder method __copy__() is removed as the desired behavior is already covered by the default behavior of copy.copy() on a compound object; the exponents property which is mutable is the only one that is copied by reference. All other properties are immutable.

The custom dunder method __deepcopy__() is kept and modified to use the copy method from numpy.ndarray as the preferred method for deepcopying the exponents.

This MR should resolve Issue #106 (closed).

Additionally, the test suite of MultiIndexSet is extended to include the expected behaviors from copying (resp. deepcopying) MultiIndexSet instances.

Merge request reports

Loading