Skip to content

Commit 8148cdf

Browse files
committed
reserve new parameter
1 parent b6dc835 commit 8148cdf

2 files changed

Lines changed: 31 additions & 4 deletions

File tree

datafold/appfold/edmd.py

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,7 @@ def fit(
920920
self,
921921
X: TimePredictType,
922922
U: Optional[TimePredictType] = None,
923+
P: Optional[pd.DataFrame] = None,
923924
y: Optional[TSCDataFrame] = None,
924925
**fit_params,
925926
) -> "EDMD":
@@ -941,6 +942,9 @@ def fit(
941942
Time series with control states acting on the system. The states are passed to the
942943
DMD model, at which point the time indices must be identical to the states in `X`.
943944
945+
P
946+
ignored -- reservered for parameters
947+
944948
y
945949
A different set of target values than the original states to map to with
946950
Koopman modes. **This is an experimental feature.**
@@ -1081,6 +1085,7 @@ def predict(
10811085
X: InitialConditionType,
10821086
*,
10831087
U: Optional[InitialConditionType] = None,
1088+
P: Optional[pd.DataFrame] = None,
10841089
time_values: Optional[np.ndarray] = None,
10851090
qois: Optional[Union[pd.Index, list[str]]] = None,
10861091
**predict_params,
@@ -1111,6 +1116,9 @@ def predict(
11111116
the control states over the prediction horizon in `U`. Each time series in `U`
11121117
must have the same time values. The time horizon is taken from `U` (i.e.
11131118
``time_values`` has to be either identical or ``None``).
1119+
1120+
P
1121+
ignored -- reserved for parameters
11141122
11151123
time_values
11161124
The time values to evaluate the model at for each initial condition. The values
@@ -1204,7 +1212,9 @@ def predict(
12041212
def fit_predict(
12051213
self,
12061214
X: TSCDataFrame,
1215+
*,
12071216
U: Optional[TSCDataFrame] = None,
1217+
P: Optional[pd.DataFrame] = None,
12081218
y=None,
12091219
qois: Optional[Union[pd.Index, list[str]]] = None,
12101220
**fit_params,
@@ -1220,9 +1230,11 @@ def fit_predict(
12201230
U
12211231
Control time series passed to the DMD model. At this point the index of `U` must
12221232
be identical to `X_dict`.
1233+
P
1234+
ignored -- reserved for parameters
12231235
1224-
y: None
1225-
ignored
1236+
y
1237+
TODO: update docs
12261238
12271239
qois
12281240
A list of feature names of interest to be included in the returned
@@ -1271,7 +1283,15 @@ def __getitem__(self, ind):
12711283
else:
12721284
return super().__getitem__(ind)
12731285

1274-
def partial_fit(self, X: TimePredictType, U=None, y=None, **fit_params) -> "EDMD":
1286+
def partial_fit(
1287+
self,
1288+
X: TimePredictType,
1289+
*,
1290+
U: Optional[Union[np.ndarray, TSCDataFrame]] = None,
1291+
P: Optional[pd.DataFrame],
1292+
y=None,
1293+
**fit_params,
1294+
) -> "EDMD":
12751295
"""Incremental fit of the model.
12761296
12771297
The partial fit call is forwarded to all transformers in the dictionary and the set
@@ -1286,6 +1306,9 @@ def partial_fit(self, X: TimePredictType, U=None, y=None, **fit_params) -> "EDMD
12861306
Currently, there is no implementation that supports both an online/streaming
12871307
setting with control.
12881308
1309+
P
1310+
ignored -- reserved for parameters
1311+
12891312
y
12901313
ignored
12911314

datafold/dynfold/dmd.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def _read_predict_params(self, predict_params):
156156

157157
@abc.abstractmethod
158158
def fit(
159-
self, X: TimePredictType, *, U: Optional[TSCDataFrame], y=None, **fit_params
159+
self, X: TimePredictType, *, U: Optional[TSCDataFrame], P=None, y=None, **fit_params
160160
) -> "DMDBase":
161161
"""Abstract method to train DMD model.
162162
@@ -169,6 +169,10 @@ def fit(
169169
Control input (set to ``None`` by default if the subclass does not support
170170
control input).
171171
172+
P
173+
ignored
174+
reserved for parameter input
175+
172176
y
173177
ignored
174178
TODO for future devevelopment: This parameter is reserved to specify an

0 commit comments

Comments
 (0)