Skip to content

Commit

Permalink
WIP: Disable default values for NdPolynomials
Browse files Browse the repository at this point in the history
  • Loading branch information
schmoelder committed Aug 15, 2023
1 parent 6ce1aa4 commit 523f63f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/test_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,8 @@ def __init__(self, methodName='runTest'):

def setUp(self):
class Model(Structure):
poly_param = Polynomial(n_coeff=2, default=1)
ndpoly_param = NdPolynomial(n_entries=2, n_coeff=4, default=1)
poly_param = Polynomial(n_coeff=2, default=0)
ndpoly_param = NdPolynomial(n_entries=2, n_coeff=4)

n_coeff = 4
poly_param_dep = Polynomial(size=('n_coeff'))
Expand Down Expand Up @@ -565,7 +565,15 @@ def test_values(self):
self.model.ndpoly_param_dep = [[1], [1], [1], [1]]

def test_default(self):
np.testing.assert_equal(self.model.poly_param, [1, 0])
"""
Currently, only `0` is allowed as default value.
Notes
-----
Technically, default values would be possible from point of the NdPolynomial
class. However, due to its use as an Event Parameter, this is currently diabled.
"""
np.testing.assert_equal(self.model.poly_param, [0, 0])

np.testing.assert_equal(self.model.ndpoly_param, None)

Expand Down

0 comments on commit 523f63f

Please sign in to comment.