Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix lint warnings in benchmarks/
  • Loading branch information
roryyorke committed Mar 1, 2025
commit 223c38fa150e58dc6a0a738a2969b74426eeecd0
1 change: 0 additions & 1 deletion benchmarks/flatsys_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import numpy as np
import math
import control as ct
import control.flatsys as flat
import control.optimal as opt

Expand Down
1 change: 0 additions & 1 deletion benchmarks/optestim_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# used for optimization-based estimation.

import numpy as np
import math
import control as ct
import control.optimal as opt

Expand Down
8 changes: 0 additions & 8 deletions benchmarks/optimal_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# performance of the functions used for optimization-base control.

import numpy as np
import math
import control as ct
import control.flatsys as fs
import control.optimal as opt
Expand All @@ -21,7 +20,6 @@
'RK23': ('RK23', {}),
'RK23_sloppy': ('RK23', {'atol': 1e-4, 'rtol': 1e-2}),
'RK45': ('RK45', {}),
'RK45': ('RK45', {}),
'RK45_sloppy': ('RK45', {'atol': 1e-4, 'rtol': 1e-2}),
'LSODA': ('LSODA', {}),
}
Expand Down Expand Up @@ -129,9 +127,6 @@ def time_optimal_lq_methods(integrator_name, minimizer_name, method):
Tf = 10
timepts = np.linspace(0, Tf, 20)

# Create the basis function to use
basis = get_basis('poly', 12, Tf)

res = opt.solve_ocp(
sys, timepts, x0, traj_cost, constraints, terminal_cost=term_cost,
solve_ivp_method=integrator[0], solve_ivp_kwargs=integrator[1],
Expand Down Expand Up @@ -223,8 +218,6 @@ def time_discrete_aircraft_mpc(minimizer_name):
# compute the steady state values for a particular value of the input
ud = np.array([0.8, -0.3])
xd = np.linalg.inv(np.eye(5) - A) @ B @ ud
yd = C @ xd

# provide constraints on the system signals
constraints = [opt.input_range_constraint(sys, [-5, -6], [5, 6])]

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

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

# Get the minimizer parameters to use
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ filterwarnings = [
[tool.ruff]

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

[tool.ruff.lint]
select = [
Expand Down