Skip to content

Commit 624439a

Browse files
committed
add numpydoc style testing + corrections
1 parent e31ce00 commit 624439a

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

control/freqplot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2172,7 +2172,8 @@ def gangof4_response(
21722172
def gangof4_plot(
21732173
*args, omega=None, omega_limits=None, omega_num=None,
21742174
Hz=False, **kwargs):
2175-
"""gangof4_plot(response) | gangof4_plot(P, C, omega)
2175+
"""gangof4_plot(response) \
2176+
gangof4_plot(P, C, omega)
21762177
21772178
Plot response of "Gang of 4" transfer functions.
21782179

control/robust.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ def mixsyn(g, w1=None, w2=None, w3=None):
400400
401401
info : tuple
402402
Two-tuple `(gamma, rcond)` containing additional information:
403-
403+
404404
* gamma (scalar): H-infinity norm of cl.
405405
* rcond (array): Estimates of reciprocal condition numbers computed
406406
during synthesis. See hinfsyn for details.

control/tests/docstrings_test.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def test_parameter_docs(module, prefix):
103103
if inspect.getmodule(obj) is not None and \
104104
not inspect.getmodule(obj).__name__.startswith('control'):
105105
# Skip anything that isn't part of the control package
106-
_info(f"member '{name}' is outside `control` module", 5)
106+
_info(f"member '{objname}' is outside `control` module", 5)
107107
continue
108108

109109
# Skip non-top-level functions without parameter lists
@@ -285,7 +285,7 @@ def test_deprecated_functions(module, prefix):
285285

286286
# Get the docstring (skip w/ warning if there isn't one)
287287
if obj.__doc__ is None:
288-
_warn(f"{module.__name__}.{name} is missing docstring")
288+
_warn(f"{objname} is missing docstring")
289289
continue
290290
else:
291291
docstring = inspect.getdoc(obj)
@@ -296,12 +296,14 @@ def test_deprecated_functions(module, prefix):
296296
if ".. deprecated::" in doc_extended:
297297
# Make sure a FutureWarning is issued
298298
if not re.search("FutureWarning", source):
299-
_fail(f"{name} deprecated but does not issue FutureWarning")
299+
_fail(f"{objname} deprecated but does not issue "
300+
"FutureWarning")
300301
else:
301302
if re.search(name + r"(\(\))? is deprecated", docstring) or \
302303
re.search(name + r"(\(\))? is deprecated", source):
303304
_fail(
304-
f"{name} deprecated but w/ non-standard docs/warnings")
305+
f"{objname} deprecated but with non-standard "
306+
"docs/warnings")
305307

306308
#
307309
# Tests for I/O system classes
@@ -721,6 +723,7 @@ def _replace_var_positional_with_docstring(sig, doc):
721723
# Return the new signature
722724
return sig.replace(parameters=parameter_list)
723725

726+
724727
# Utility function to warn with verbose output
725728
def _info(str, level):
726729
if verbose > level:

0 commit comments

Comments
 (0)