Skip to content

Commit 514c987

Browse files
committed
Fix crash due to new Numpy 2.x version
1 parent a35330c commit 514c987

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

autotune/system_identification.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,11 @@ def __init__(self, n=2, m=2, d=1, dt=0.0):
6363
self.lbda = 1.0 - self.dt / tau
6464

6565
def fit(self, u, y):
66-
n_steps = len(u)
66+
u = np.asarray(u).flatten()
67+
y = np.asarray(y).flatten()
6768

69+
n_steps = len(u)
70+
6871
# High-pass filter parameters
6972
if self.f_hp > 0.0:
7073
tau_hp = 1 / (2 * np.pi * self.f_hp)
@@ -112,7 +115,7 @@ def fit(self, u, y):
112115
# Update model
113116
rls.update(u_lp[k], y_lp[k])
114117

115-
theta_hat = rls._theta_hat
118+
theta_hat = np.array(rls._theta_hat).flatten()
116119

117120
# Save for plotting
118121
for i in range(self.n):

0 commit comments

Comments
 (0)