8000 change check_kwargs to _check_kwargs and disable docstring check · NickThomasMain/python-control@b767e52 · GitHub
[go: up one dir, main page]

Skip to content

Commit b767e52

Browse files
committed
change check_kwargs to _check_kwargs and disable docstring check
1 parent 4838bbf commit b767e52

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

control/descfcn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def __len__(self):
271271
# Compute the describing function response + intersections
272272
def describing_function_response(
273273
H, F, A, omega=None, refine=True, warn_nyquist=None,
274-
plot=False, check_kwargs=True, **kwargs):
274+
plot=False, _check_kwargs=True, **kwargs):
275275
"""Compute the describing function response of a system.
276276
277277
This function uses describing function analysis to analyze a closed
@@ -328,7 +328,7 @@ def describing_function_response(
328328
# Start by drawing a Nyquist curve
329329
response = nyquist_response(
330330
H, omega, warn_encirclements=warn_nyquist, warn_nyquist=warn_nyquist,
331-
check_kwargs=check_kwargs, **kwargs)
331+
_check_kwargs=_check_kwargs, **kwargs)
332332
H_omega, H_vals = response.contour.imag, H(response.contour)
333333

334334
# Compute the describing function

control/freqplot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ def plot(self, *args, **kwargs):
11451145
def nyquist_response(
11461146
sysdata, omega=None, plot=None, omega_limits=None, omega_num=None,
11471147
return_contour=False, warn_encirclements=True, warn_nyquist=True,
1148-
check_kwargs=True, **kwargs):
1148+
_check_kwargs=True, **kwargs):
11491149
"""Nyquist response for a system.
11501150
11511151
Computes a Nyquist contour for the system over a (optional) frequency
@@ -1260,7 +1260,7 @@ def nyquist_response(
12601260
indent_points = config._get_param(
12611261
'nyquist', 'indent_points', kwargs, _nyquist_defaults, pop=True)
12621262

1263-
if check_kwargs and kwargs:
1263+
if _check_kwargs and kwargs:
12641264
raise TypeError("unrecognized keywords: ", str(kwargs))
12651265

12661266
# Convert the first argument to a list
@@ -1769,7 +1769,7 @@ def _parse_linestyle(style_name, allow_false=False):
17691769
warn_encirclements=kwargs.pop('warn_encirclements', True),
17701770
warn_nyquist=kwargs.pop('warn_nyquist', True),
17711771
indent_radius=kwargs.pop('indent_radius', None),
1772-
check_kwargs=False, **kwargs)
1772+
_check_kwargs=False, **kwargs)
17731773
else:
17741774
nyquist_responses = data
17751775

control/phaseplot.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def _create_kwargs(global_kwargs, local_kwargs, **other_kwargs):
172172
kwargs, plot_streamlines, gridspec=gridspec, gridtype=gridtype,
173173
ax=ax)
174174
out[0] += streamlines(
175-
sys, pointdata, timedata, check_kwargs=False,
175+
sys, pointdata, timedata, _check_kwargs=False,
176176
suppress_warnings=suppress_warnings, **kwargs_local)
177177

178178
# Get rid of keyword arguments handled by streamlines
@@ -188,7 +188,7 @@ def _create_kwargs(global_kwargs, local_kwargs, **other_kwargs):
188188
kwargs_local = _create_kwargs(
189189
kwargs, plot_separatrices, gridspec=gridspec, ax=ax)
190190
out[0] += separatrices(
191-
sys, pointdata, check_kwargs=False, **kwargs_local)
191+
sys, pointdata, _check_kwargs=False, **kwargs_local)
192192

193193
# Get rid of keyword arguments handled by separatrices
194194
for kw in ['arrows', 'arrow_size', 'arrow_style', 'params']:
@@ -198,7 +198,7 @@ def _create_kwargs(global_kwargs, local_kwargs, **other_kwargs):
198198
kwargs_local = _create_kwargs(
199199
kwargs, plot_vectorfield, gridspec=gridspec, ax=ax)
200200
out[1] = vectorfield(
201-
sys, pointdata, check_kwargs=False, **kwargs_local)
201+
sys, pointdata, _check_kwargs=False, **kwargs_local)
202202

203203
# Get rid of keyword arguments handled by vectorfield
204204
for kw in ['color', 'params']:
@@ -208,7 +208,7 @@ def _create_kwargs(global_kwargs, local_kwargs, **other_kwargs):
208208
kwargs_local = _create_kwargs(
209209
kwargs, plot_equilpoints, gridspec=gridspec, ax=ax)
210210
out[2] = equilpoints(
211-
sys, pointdata, check_kwargs=False, **kwargs_local)
211+
sys, pointdata, _check_kwargs=False, **kwargs_local)
212212

213213
# Get rid of keyword arguments handled by equilpoints
214214
for kw in ['params']:
@@ -231,7 +231,7 @@ def _create_kwargs(global_kwargs, local_kwargs, **other_kwargs):
231231

232232
def vectorfield(
233233
sys, pointdata, gridspec=None, ax=None, suppress_warnings=False,
234-
check_kwargs=True, **kwargs):
234+
_check_kwargs=True, **kwargs):
235235
"""Plot a vector field in the phase plane.
236236
237237
This function plots a vector field for a two-dimensional state
@@ -301,7 +301,7 @@ def vectorfield(
301301
color = _get_color(kwargs, ax=ax)
302302

303303
# Make sure all keyword arguments were processed
304-
if check_kwargs and kwargs:
304+
if _check_kwargs and kwargs:
305305
raise TypeError("unrecognized keywords: ", str(kwargs))
306306

307307
# Generate phase plane (quiver) data
@@ -321,7 +321,7 @@ def vectorfield(
321321

322322
def streamlines(
323323
sys, pointdata, timedata=1, gridspec=None, gridtype=None, dir=None,
324-
ax=None, check_kwargs=True, suppress_warnings=False, **kwargs):
324+
ax=None, _check_kwargs=True, suppress_warnings=False, **kwargs):
325325
"""Plot stream lines in the phase plane.
326326
327327
This function plots stream lines for a two-dimensional state space
@@ -399,7 +399,7 @@ def streamlines(
399399
color = _get_color(kwargs, ax=ax)
400400

401401
# Make sure all keyword arguments were processed
402-
if check_kwargs and kwargs:
402+
if _check_kwargs and kwargs:
403403
raise TypeError("unrecognized keywords: ", str(kwargs))
404404

405405
# Create reverse time system, if needed
@@ -433,7 +433,7 @@ def streamlines(
433433

434434

435435
def equilpoints(
436-
sys, pointdata, gridspec=None, color='k', ax=None, check_kwargs=True,
436+
sys, pointdata, gridspec=None, color='k', ax=None, _check_kwargs=True,
437437
**kwargs):
438438
"""Plot equilibrium points in the phase plane.
439439
@@ -496,7 +496,7 @@ def equilpoints(
496496
points, _ = _make_points(pointdata, gridspec, 'meshgrid')
497497

498498
# Make sure all keyword arguments were processed
499-
if check_kwargs and kwargs:
499+
if _check_kwargs and kwargs:
500500
raise TypeError("unrecognized keywords: ", str(kwargs))
501501

502502
# Search for equilibrium points
@@ -513,7 +513,7 @@ def equilpoints(
513513

514514
def separatrices(
515515
sys, pointdata, timedata=None, gridspec=None, ax=None,
516-
check_kwargs=True, suppress_warnings=False, **kwargs):
516+
_check_kwargs=True, suppress_warnings=False, **kwargs):
517517
"""Plot separatrices in the phase plane.
518518
519519
This function plots separatrices for a two-dimensional state space
@@ -606,7 +606,7 @@ def separatrices(
606606
stable_color = unstable_color = color
607607

608608
# Make sure all keyword arguments were processed
609-
if check_kwargs and kwargs:
609+
if _check_kwargs and kwargs:
610610
raise TypeError("unrecognized keywords: ", str(kwargs))
611611

612612
# Create a "reverse time" system to use for simulation

control/tests/docstrings_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_docstrings(module, prefix):
5858

5959
# Go through each parameter and make sure it is in the docstring
6060
for argname, par in sig.parameters.items():
61-
if argname == 'self':
61+
if argname == 'self' or argname[0] == '_':
6262
continue
6363

6464
if par.kind == inspect.Parameter.VAR_KEYWORD:

0 commit comments

Comments
 (0)
0