Skip to content

Commit 71ea2d7

Browse files
committed
Fix various ruff unknown symbol warnings
1 parent f9c5b3b commit 71ea2d7

4 files changed

Lines changed: 5 additions & 4 deletions

File tree

control/freqplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2219,7 +2219,7 @@ def gangof4_plot(
22192219
See :class:`ControlPlot` for more detailed information.
22202220
22212221
"""
2222-
if len(args) == 1 and isinstance(arg, FrequencyResponseData):
2222+
if len(args) == 1 and isinstance(args[0], FrequencyResponseData):
22232223
if any([kw is not None
22242224
for kw in [omega, omega_limits, omega_num, Hz]]):
22252225
raise ValueError(

control/nichols.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def nichols_plot(
136136

137137
# Decide on the system name and label
138138
sysname = response.sysname if response.sysname is not None \
139-
else f"Unknown-{idx_sys}"
139+
else f"Unknown-sys_{idx}"
140140
label_ = sysname if label is None else label[idx]
141141

142142
# Generate the plot

control/optimal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def __init__(
162162
if trajectory_method is None:
163163
trajectory_method = 'collocation' if sys.isctime() else 'shooting'
164164
elif trajectory_method not in _optimal_trajectory_methods:
165-
raise NotImplementedError(f"Unkown method {method}")
165+
raise NotImplementedError(f"Unknown method {trajectory_method}")
166166

167167
self.shooting = trajectory_method in {'shooting'}
168168
self.collocation = trajectory_method in {'collocation'}
@@ -1105,7 +1105,7 @@ def solve_ocp(
11051105
# Process (legacy) method keyword
11061106
if kwargs.get('method'):
11071107
method = kwargs.pop('method')
1108-
if method not in optimal_methods:
1108+
if method not in _optimal_trajectory_methods:
11091109
if kwargs.get('minimize_method'):
11101110
raise ValueError("'minimize_method' specified more than once")
11111111
warnings.warn(

control/phaseplot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
from . import config
3939
from .ctrlplot import ControlPlot, _add_arrows_to_line2D, _get_color, \
4040
_process_ax_keyword, _update_plot_title
41+
from .exception import ControlArgument
4142
from .nlsys import NonlinearIOSystem, find_operating_point, \
4243
input_output_response
4344

0 commit comments

Comments
 (0)