Calling make_complete() on an instance of MultiIndexSet raises an exception
Following MR !64 (merged) (see Issue #37 (closed)), the default constructor of the MultiIndexSet
class now explicitly requires the value of lp_degree
to be passed because it cannot be inferred just from a given set of exponents.
However, it appears some part of the codebase still assume that lp_degree
in the default constructor has a default value.
Specifically, in the make_complete()
method (line 361):
...
new_instance = self.__class__(new_exponents) # re-compute degree etc.
...
Calling make_complete()
on an instance of MultiIndexSet
raises an exception:
>>> mi = mp.MultiIndexSet(np.array([[0, 0, 2]]), lp_degree=2.0)
>>> mi.make_complete()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[7], line 1
----> 1 mi.make_complete()
File ~/projects/minterpy/dev-113/src/minterpy/core/multi_index.py:361, in MultiIndexSet.make_complete(self)
359 return self
360 new_exponents = self.exponents_completed # compute if necessary!
--> 361 new_instance = self.__class__(new_exponents) # re-compute degree etc.
362 # NOTE: avoid checking for completeness again!
363 new_instance._is_complete = True
TypeError: __init__() missing 1 required positional argument: 'lp_degree'
It also seems there is no tests yet for make_complete()
method, otherwise this problem would have been caught during the merge request (see MR !64 (merged)).
PS: I'm assigning this to myself. The MR related to this Issue is a (very) small hotfix and I will merge them immediately so as not to obstruct other developments.