add_exponents in MultiIndex returns a multi-index set of different lp-degree
The method add_exponents
of a MultiIndexSet
instance may return a new instance that is of different lp-degree.
Here's a reproducible example:
import minterpy as mp
import numpy as np
mi = mp.MultiIndexSet.from_degree(3, 2, 1) # lp-degree = 1
mi_added = mi.add_exponents(np.array([0, 0, 3])) # lp-degree becomes 2 (the default)
assert mi.lp_degree == mi_added.lp_degree
This is an unexpected behavior.
The method add_exponents
itself has not been covered in the unit test.
So it's a good idea to expand the unit test.
Thanks to @schrei06 who indicates the issue.