Skip to content

Commit 393f3e1

Browse files
committed
FIX: process trajectories only when x_dot is None
1 parent ee7866e commit 393f3e1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pysindy/pysindy.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,8 @@ def fit(
396396
x, t, x_dot, u, self.feature_library
397397
)
398398

399-
x, x_dot = self._process_trajectories(x, t, x_dot)
399+
if x_dot is None:
400+
x, x_dot = self._process_trajectories(x, t, x_dot)
400401

401402
if u is None:
402403
self.n_control_features_ = 0
@@ -500,7 +501,8 @@ def score(self, x, t, x_dot=None, u=None, metric=r2_score, **metric_kws):
500501

501502
x_dot_predict = self.predict(x, u)
502503

503-
x, x_dot = self._process_trajectories(x, t, x_dot)
504+
if x_dot is None:
505+
x, x_dot = self._process_trajectories(x, t, x_dot)
504506

505507
x_dot = concat_sample_axis(x_dot)
506508
x_dot_predict = concat_sample_axis(x_dot_predict)

0 commit comments

Comments
 (0)