Skip to content

Commit 8732039

Browse files
klapomtezzele
authored andcommitted
Check data size and catch funcitional constraints
1 parent 1b71f6f commit 8732039

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pydmd/costs.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,10 @@ def fit(
459459
self._window_length = window_length
460460
self._step_size = step_size
461461
self._n_time_steps, self._n_data_vars = self._data_shape(data)
462+
463+
if not self._n_time_steps == time.size:
464+
raise ValueError("Data and time dimensions do not align.")
465+
462466
self._n_slides = self._build_windows(
463467
data,
464468
self._window_length,
@@ -1560,6 +1564,8 @@ def _xarray_sanitize(value):
15601564
value = "None"
15611565
elif isinstance(value, set):
15621566
value = list(value)
1567+
elif callable(value):
1568+
value = f"Custom function {value.__name__}"
15631569
return value
15641570

15651571
@staticmethod

0 commit comments

Comments
 (0)