From 514c987e89a33b0bf99631bb025316c0eb8ef076 Mon Sep 17 00:00:00 2001 From: Josip Pavlovic Date: Fri, 13 Feb 2026 10:06:27 +0100 Subject: [PATCH] Fix crash due to new Numpy 2.x version --- autotune/system_identification.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/autotune/system_identification.py b/autotune/system_identification.py index 290be14..0b68e1a 100644 --- a/autotune/system_identification.py +++ b/autotune/system_identification.py @@ -63,8 +63,11 @@ def __init__(self, n=2, m=2, d=1, dt=0.0): self.lbda = 1.0 - self.dt / tau def fit(self, u, y): - n_steps = len(u) + u = np.asarray(u).flatten() + y = np.asarray(y).flatten() + n_steps = len(u) + # High-pass filter parameters if self.f_hp > 0.0: tau_hp = 1 / (2 * np.pi * self.f_hp) @@ -112,7 +115,7 @@ def fit(self, u, y): # Update model rls.update(u_lp[k], y_lp[k]) - theta_hat = rls._theta_hat + theta_hat = np.array(rls._theta_hat).flatten() # Save for plotting for i in range(self.n):