Skip to content

Commit

Permalink
Refactor test assertions in test_penalties.py for improved clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeCrux21 committed Dec 2, 2024
1 parent 2deeb4c commit 3fd17ea
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pygam/tests/test_penalties.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ def test_single_spline_penalty():
monotonic_ and convexity_ should be 0.
"""
coef = np.array(1.0)
assert np.alltrue(derivative(1, coef).A == 0.0)
assert np.alltrue(l2(1, coef).A == 1.0)
assert np.alltrue(monotonic_inc(1, coef).A == 0.0)
assert np.alltrue(monotonic_dec(1, coef).A == 0.0)
assert np.alltrue(convex(1, coef).A == 0.0)
assert np.alltrue(concave(1, coef).A == 0.0)
assert np.alltrue(none(1, coef).A == 0.0)
assert np.all(derivative(1, coef).A == 0.0)
assert np.all(l2(1, coef).A == 1.0)
assert np.all(monotonic_inc(1, coef).A == 0.0)
assert np.all(monotonic_dec(1, coef).A == 0.0)
assert np.all(convex(1, coef).A == 0.0)
assert np.all(concave(1, coef).A == 0.0)
assert np.all(none(1, coef).A == 0.0)


def test_wrap_penalty():
Expand Down

0 comments on commit 3fd17ea

Please sign in to comment.