-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
MultiplicativeBasis does not have the bounds defined in its two sub-bases, this messes up evaluate_on_grid.
Also, get_equi_spaced_samples can not handle a list of None and numbers.
To Reproduce
import nemos as nmo
bspline1 = nmo.basis.BSplineEval(5, bounds=(0, 100))
bspline2 = nmo.basis.BSplineEval(5, bounds=(0, 100))
basis = bspline1 * bspline2
X, Y, Z = basis.evaluate_on_grid(100, 100)
print(basis.bounds)
print(X.min(), X.max())
print(Y.min(), Y.max())Expected behavior
The passed bounds should be respected.
Suggested solution
We can add the following to MultiplicativeBasis:
@property
def bounds(self):
b1 = self.basis1.bounds
b2 = self.basis2.bounds
if b1 is None:
b1 = [None]
if b2 is None:
b2 = [None]
return b1 + b2
Alternatively, but more work, the bounds could be a property of CompositeBasisMixin, and we can have a setter which sets all sub basis bounds.
That is, the user passes a list of bounds and the composite basis iterates over the list and assigns bounds to components.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working