From f0cb04049edb20a06717ff933d65b54deb7a2163 Mon Sep 17 00:00:00 2001 From: BalzaniEdoardo Date: Mon, 16 Dec 2024 15:51:11 -0500 Subject: [PATCH] added a test for window size after init for orth exp --- tests/test_basis.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_basis.py b/tests/test_basis.py index e8759ace..2cace735 100644 --- a/tests/test_basis.py +++ b/tests/test_basis.py @@ -1714,6 +1714,16 @@ def test_window_size_at_init(self, window_size, n_basis, expectation): with expectation: self.cls["conv"](n_basis, decay_rates=decay_rates, window_size=window_size) + def test_check_window_size_after_init(self): + decay_rates = np.asarray(np.arange(1, 5 + 1), dtype=float) + expectation = pytest.raises( + ValueError, + match="OrthExponentialConv basis requires at least a window_size", + ) + bas = self.cls["conv"](5, decay_rates=decay_rates, window_size=10) + with expectation: + bas.window_size = 4 + @pytest.mark.parametrize( "window_size, n_basis, expectation", [