Skip to content

Commit

Permalink
TST: add test for refactored trajectory guard code
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob-Stevens-Haas committed Jul 11, 2023
1 parent 044b4f5 commit 415a63b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/test_pysindy.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from sklearn.model_selection import TimeSeriesSplit
from sklearn.utils.validation import check_is_fitted

from pysindy import pysindy
from pysindy import SINDy
from pysindy.differentiation import SINDyDerivative
from pysindy.differentiation import SmoothedFiniteDifference
Expand Down Expand Up @@ -436,6 +437,14 @@ def test_score_discrete_time(data_discrete_time):
assert model.score(x, x_dot=x) < 1


def test_bad_multiple_trajectories(data_multiple_trajectories):
x, t = data_multiple_trajectories
with pytest.raises(TypeError):
pysindy._check_multiple_trajectories(x, x_dot=x[0], u=None)
with pytest.raises(ValueError):
pysindy._check_multiple_trajectories(x, x_dot=x[:-1], u=None)


def test_fit_discrete_time_multiple_trajectories(
data_discrete_time_multiple_trajectories,
):
Expand Down

0 comments on commit 415a63b

Please sign in to comment.