Skip to content

Commit 10f009b

Browse files
committed
address @slivingston review comments
1 parent d459569 commit 10f009b

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

control/ctrlplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def _make_legend_labels(labels, ignore_common=False):
103103
common_prefix = common_prefix[:last_space]
104104
prefix_len = len(common_prefix)
105105

106-
# Look for a common suffice (up to a space)
106+
# Look for a common suffix (up to a space)
107107
common_suffix = commonprefix(
108108
[label[::-1] for label in labels])[::-1]
109109
suffix_len = len(common_suffix)

control/nlsys.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ def nlsys(
13171317

13181318

13191319
def input_output_response(
1320-
sysdata, T, U=0., X0=0, params=None, ignore_errors=False,
1320+
sys, T, U=0., X0=0, params=None, ignore_errors=False,
13211321
transpose=False, return_x=False, squeeze=None,
13221322
solve_ivp_kwargs=None, t_eval='T', **kwargs):
13231323
"""Compute the output response of a system to a given input.
@@ -1327,7 +1327,7 @@ def input_output_response(
13271327
13281328
Parameters
13291329
----------
1330-
sysdata : I/O system or list of I/O systems
1330+
sys : NonlinearIOSystem or list of NonlinearIOSystem
13311331
I/O system(s) for which input/output response is simulated.
13321332
13331333
T : array-like
@@ -1449,16 +1449,14 @@ def input_output_response(
14491449
raise TypeError("unrecognized keyword(s): ", str(kwargs))
14501450

14511451
# If passed a list, recursively call individual responses with given T
1452-
if isinstance(sysdata, (list, tuple)):
1453-
responses = []
1452+
if isinstance(sys, (list, tuple)):
1453+
sysdata, responses = sys, []
14541454
for sys in sysdata:
14551455
responses.append(input_output_response(
14561456
sys, T, U=U, X0=X0, params=params, transpose=transpose,
14571457
return_x=return_x, squeeze=squeeze, t_eval=t_eval,
14581458
solve_ivp_kwargs=solve_ivp_kwargs, **kwargs))
14591459
return TimeResponseList(responses)
1460-
else:
1461-
sys = sysdata
14621460

14631461
# Sanity checking on the input
14641462
if not isinstance(sys, NonlinearIOSystem):

doc/conventions.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ response from a non-zero initial condition.
157157
For linear time invariant (LTI) systems, the :func:`impulse_response`,
158158
:func:`initial_response`, and :func:`step_response` functions will
159159
automatically compute the time vector based on the poles and zeros of
160-
system. If a list of systems is passed, a common time vector will be
160+
the system. If a list of systems is passed, a common time vector will be
161161
computed and a list of responses will be returned in the form of a
162-
:class:`TimeResponseList` object. The :func:`force_response` function can
162+
:class:`TimeResponseList` object. The :func:`forced_response` function can
163163
also take a list of systems, to which a single common input is applied.
164164
The :class:`TimeResponseList` object has a `plot()` method that will plot
165-
each of the reponses in turn, using a sequence of different colors with
165+
each of the responses in turn, using a sequence of different colors with
166166
appropriate titles and legends.
167167

168168
In addition the :func:`input_output_response` function, which handles

examples/plot_gallery.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# used to compare what things look like between different versions of the
77
# library. It is mainly intended for uses by developers to make sure there
88
# are no unexpected changes in plot formats, but also has some interest
9-
# examples of htings you can plot.
9+
# examples of things you can plot.
1010

1111
import os
1212
import sys
@@ -21,9 +21,10 @@
2121
savefigs = 'PYCONTROL_TEST_EXAMPLES' not in os.environ
2222
if savefigs:
2323
# Create a pdf file for storing the results
24+
import subprocess
2425
from matplotlib.backends.backend_pdf import PdfPages
2526
from datetime import date
26-
git_info = os.popen('git describe').read().strip()
27+
git_info = subprocess.check_output(['git', 'describe'], text=True).strip()
2728
pdf = PdfPages(
2829
f'plot_gallery-{git_info}-{date.today().isoformat()}.pdf')
2930

0 commit comments

Comments
 (0)