Skip to content

Commit 36742d6

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

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

autotune/system_identification.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +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+
u = np.asarray(u).flatten()
67+
y = np.asarray(y).flatten()
68+
6669
n_steps = len(u)
70+
6771

6872
# High-pass filter parameters
6973
if self.f_hp > 0.0:
@@ -113,6 +117,7 @@ def fit(self, u, y):
113117
rls.update(u_lp[k], y_lp[k])
114118

115119
theta_hat = rls._theta_hat
120+
theta_hat = np.array(theta_hat).flatten()
116121

117122
# Save for plotting
118123
for i in range(self.n):

0 commit comments

Comments
 (0)