From b43a75367088883daddc9db90ba7adf414df1508 Mon Sep 17 00:00:00 2001 From: Danylo Tsyban Date: Wed, 15 Apr 2026 16:38:57 +0300 Subject: [PATCH] fix(autotune): flatten u/y arrays in apply_filters to fix ValueError u and y were passed as 2D column vectors (shape (n,1)) from autotune.py, causing "setting an array element with a sequence" when initializing the 1D filter output arrays. Added np.ravel() at the start of apply_filters to normalize inputs to 1D. --- autotune/system_identification.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/autotune/system_identification.py b/autotune/system_identification.py index 781a0bf..8f1f646 100644 --- a/autotune/system_identification.py +++ b/autotune/system_identification.py @@ -45,6 +45,8 @@ def apply_filters(u, y, f_hp, f_lp, dt): + u = np.asarray(u).ravel() + y = np.asarray(y).ravel() n_steps = len(u) if f_hp > 0.0: