Skip to content

Commit ee7866e

Browse files
committed
CLN: Remove SINDy.differentiate()
1 parent 38868a8 commit ee7866e

File tree

2 files changed

+0
-48
lines changed

2 files changed

+0
-48
lines changed

pysindy/pysindy.py

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -547,45 +547,6 @@ def _process_trajectories(self, x, t, x_dot):
547547
)
548548
return x, x_dot
549549

550-
def differentiate(self, x, t):
551-
"""
552-
Apply the model's differentiation method
553-
(:code:`self.differentiation_method`) to data.
554-
555-
Parameters
556-
----------
557-
x: array-like or list of array-like, shape (n_samples, n_input_features)
558-
Data to be differentiated.
559-
560-
t: int, numpy array of shape (n_samples,), or list of numpy arrays
561-
Time step between samples or array of collection times.
562-
563-
Returns
564-
-------
565-
x_dot: array-like or list of array-like, shape (n_samples, n_input_features)
566-
Time derivatives computed by using the model's differentiation
567-
method
568-
"""
569-
warnings.warn(
570-
"SINDy.differentiate is deprecated. "
571-
"Call the differentiation_method parameter"
572-
)
573-
574-
if self.discrete_time:
575-
raise RuntimeError("No differentiation implemented for discrete time model")
576-
if not _check_multiple_trajectories(x, None, None):
577-
x, t, _, _ = _adapt_to_multiple_trajectories(x, t, None, None)
578-
multiple_trajectories = False
579-
else:
580-
multiple_trajectories = True
581-
x, _, _ = _comprehend_and_validate_inputs(
582-
x, t, None, None, self.feature_library
583-
)
584-
result = self._process_trajectories(x, t, None)[1]
585-
if not multiple_trajectories:
586-
return result[0]
587-
return result
588-
589550
def simulate(
590551
self,
591552
x0,

test/test_pysindy.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,6 @@ def test_bad_t(data):
139139
model.fit(x, t_new)
140140

141141

142-
@pytest.mark.parametrize(
143-
"data", [pytest.lazy_fixture("data_1d"), pytest.lazy_fixture("data_lorenz")]
144-
)
145-
def test_differentiate_returns_compatible_data_type(data):
146-
x, t = data
147-
x_dot = SINDy().differentiate(x, t)
148-
assert isinstance(x_dot, type(x))
149-
150-
151142
@pytest.mark.parametrize(
152143
"data", [pytest.lazy_fixture("data_1d"), pytest.lazy_fixture("data_lorenz")]
153144
)

0 commit comments

Comments
 (0)