Skip to content

Commit

Permalink
fix: fix test to work with new api
Browse files Browse the repository at this point in the history
  • Loading branch information
jolars committed Nov 29, 2023
1 parent 7981b47 commit 3192911
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test.py → tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
from numpy.random import default_rng

from sortedl1 import slope
from sortedl1 import Slope


class TestBasicUse(unittest.TestCase):
Expand All @@ -20,9 +20,11 @@ def test_simple_problem(self):
lam = np.array([2, 1, 0.2])
alph = np.array([1.0])

res = slope(x, y, lam, alph)
model = Slope(alph, lam)

np.testing.assert_array_almost_equal(res, 0)
res = model.fit(x, y).predict(x)

np.testing.assert_array_almost_equal(res, np.array([0.0, 1.0]))


if __name__ == "__main__":
Expand Down

0 comments on commit 3192911

Please sign in to comment.