Skip to content

Commit 223c38f

Browse files
committed
Fix lint warnings in benchmarks/
1 parent f6799ab commit 223c38f

File tree

4 files changed

+1
-11
lines changed

4 files changed

+1
-11
lines changed

benchmarks/flatsys_bench.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import numpy as np
99
import math
10-
import control as ct
1110
import control.flatsys as flat
1211
import control.optimal as opt
1312

benchmarks/optestim_bench.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# used for optimization-based estimation.
77

88
import numpy as np
9-
import math
109
import control as ct
1110
import control.optimal as opt
1211

benchmarks/optimal_bench.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# performance of the functions used for optimization-base control.
77

88
import numpy as np
9-
import math
109
import control as ct
1110
import control.flatsys as fs
1211
import control.optimal as opt
@@ -21,7 +20,6 @@
2120
'RK23': ('RK23', {}),
2221
'RK23_sloppy': ('RK23', {'atol': 1e-4, 'rtol': 1e-2}),
2322
'RK45': ('RK45', {}),
24-
'RK45': ('RK45', {}),
2523
'RK45_sloppy': ('RK45', {'atol': 1e-4, 'rtol': 1e-2}),
2624
'LSODA': ('LSODA', {}),
2725
}
@@ -129,9 +127,6 @@ def time_optimal_lq_methods(integrator_name, minimizer_name, method):
129127
Tf = 10
130128
timepts = np.linspace(0, Tf, 20)
131129

132-
# Create the basis function to use
133-
basis = get_basis('poly', 12, Tf)
134-
135130
res = opt.solve_ocp(
136131
sys, timepts, x0, traj_cost, constraints, terminal_cost=term_cost,
137132
solve_ivp_method=integrator[0], solve_ivp_kwargs=integrator[1],
@@ -223,8 +218,6 @@ def time_discrete_aircraft_mpc(minimizer_name):
223218
# compute the steady state values for a particular value of the input
224219
ud = np.array([0.8, -0.3])
225220
xd = np.linalg.inv(np.eye(5) - A) @ B @ ud
226-
yd = C @ xd
227-
228221
# provide constraints on the system signals
229222
constraints = [opt.input_range_constraint(sys, [-5, -6], [5, 6])]
230223

@@ -234,7 +227,6 @@ def time_discrete_aircraft_mpc(minimizer_name):
234227
cost = opt.quadratic_cost(model, Q, R, x0=xd, u0=ud)
235228

236229
# Set the time horizon and time points
237-
Tf = 3
238230
timepts = np.arange(0, 6) * 0.2
239231

240232
# Get the minimizer parameters to use

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ filterwarnings = [
6060
[tool.ruff]
6161

6262
# TODO: expand to cover all code
63-
include = ['control/**.py']
63+
include = ['control/**.py', 'benchmarks/*.py']
6464

6565
[tool.ruff.lint]
6666
select = [

0 commit comments

Comments
 (0)