Skip to content

Commit af6e14b

Browse files
committed
small changes to fix pytest warnings on py3.11
1 parent b389b64 commit af6e14b

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

control/flatsys/linflat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ def forward(self, x, u, params):
119119
x = np.reshape(x, (-1, 1))
120120
u = np.reshape(u, (1, -1))
121121
zflag = [np.zeros(self.nstates + 1)]
122-
zflag[0][0] = self.Cf @ x
122+
zflag[0][0] = (self.Cf @ x).item()
123123
H = self.Cf # initial state transformation
124124
for i in range(1, self.nstates + 1):
125-
zflag[0][i] = H @ (self.A @ x + self.B @ u)
125+
zflag[0][i] = (H @ (self.A @ x + self.B @ u)).item()
126126
H = H @ self.A # derivative for next iteration
127127
return zflag
128128

control/freqplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ def bode_plot(
473473
if ax is None:
474474
with plt.rc_context(_freqplot_rcParams):
475475
ax_array = fig.subplots(nrows, ncols, squeeze=False)
476-
fig.set_tight_layout(True)
476+
fig.set_layout_engine('tight')
477477
fig.align_labels()
478478

479479
# Set up default sharing of axis limits if not specified

control/timeplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def time_response_plot(
292292
if ax is None:
293293
with plt.rc_context(timeplot_rcParams):
294294
ax_array = fig.subplots(nrows, ncols, sharex=True, squeeze=False)
295-
fig.set_tight_layout(True)
295+
fig.set_layout_engine('tight')
296296
fig.align_labels()
297297

298298
else:

control/timeresp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ def forced_response(sys, T=None, U=0., X0=0., transpose=False,
10841084
if U.ndim == 1:
10851085
U = U.reshape(1, -1) # pylint: disable=E1103
10861086

1087-
# Algorithm: to integrate from time 0 to time dt, with linear
1087+
# Algorithm: to integrate from time 0 to time dt, with linear
10881088
# interpolation between inputs u(0) = u0 and u(dt) = u1, we solve
10891089
# xdot = A x + B u, x(0) = x0
10901090
# udot = (u1 - u0) / dt, u(0) = u0.

0 commit comments

Comments
 (0)