Skip to content

Commit 7ef09a0

Browse files
committed
address initial @slivingston comments
1 parent fba414d commit 7ef09a0

File tree

5 files changed

+16
-14
lines changed

5 files changed

+16
-14
lines changed

control/iosys.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ def __new__(cls, input_array, signal_labels=None, trace_labels=None):
4646

4747
def __array_finalize__(self, obj):
4848
# See https://numpy.org/doc/stable/user/basics.subclassing.html
49-
if obj is None: return
49+
if obj is None:
50+
return
5051
self.signal_labels = getattr(obj, 'signal_labels', None)
5152
self.trace_labels = getattr(obj, 'trace_labels', None)
5253
self.data_shape = getattr(obj, 'data_shape', None)
@@ -1038,14 +1039,15 @@ def _parse_spec(syslist, spec, signame, dictname=None):
10381039
#
10391040
def _process_subsys_index(idx, sys_labels, slice_to_list=False):
10401041
if not isinstance(idx, (slice, list, int)):
1041-
raise TypeError(f"system indices must be integers, slices, or lists")
1042+
raise TypeError("system indices must be integers, slices, or lists")
10421043

10431044
# Convert singleton lists to integers for proper slicing (below)
10441045
if isinstance(idx, (list, tuple)) and len(idx) == 1:
10451046
idx = idx[0]
10461047

10471048
# Convert int to slice so that numpy doesn't drop dimension
1048-
if isinstance(idx, int): idx = slice(idx, idx+1, 1)
1049+
if isinstance(idx, int):
1050+
idx = slice(idx, idx+1, 1)
10491051

10501052
# Get label names (taking care of possibility that we were passed a list)
10511053
labels = [sys_labels[i] for i in idx] if isinstance(idx, list) \

control/tests/lti_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def test_subsys_indexing(fcn, outdx, inpdx, key):
322322
sys = ct.rss(4, 3, 3)
323323
subsys = sys[key]
324324

325-
# Construct the system to be test
325+
# Construct the system to be tested
326326
match fcn:
327327
case ct.frd:
328328
omega = np.logspace(-1, 1)

control/timeresp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ class TimeResponseData:
243243
244244
response(tranpose=True).input
245245
246-
See :meth:`TimeResponseData.__call__` for more information.
246+
See :meth:`TimeResponseData.__call__` for more information.
247247
248248
"""
249249

doc/conventions.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ argument::
9999
mag, phase, omega = response(squeeze=False)
100100

101101
Frequency response objects are also available as named properties of the
102-
`response` object: `response.magnitude`, `response.phase`, and
103-
`response.response` (for the complex response). For MIMO systems, these
102+
``response`` object: ``response.magnitude``, ``response.phase``, and
103+
``response.response`` (for the complex response). For MIMO systems, these
104104
elements of the frequency response can be accessed using the names of the
105105
inputs and outputs::
106106

@@ -109,9 +109,9 @@ inputs and outputs::
109109
where the signal names are based on the system that generated the frequency
110110
response.
111111

112-
Note: The `fresp` data member is stored as a NumPy array and cannot be
113-
accessed with signal names. Use `response.response` to access the complex
114-
frequency response using signal names.
112+
Note: The ``fresp`` data member is stored as a NumPy array and cannot be
113+
accessed with signal names. Use ``response.response`` to access the
114+
complex frequency response using signal names.
115115

116116
Discrete time systems
117117
---------------------
@@ -157,8 +157,8 @@ names::
157157

158158
Signal names for an indexed subsystem are preserved from the original
159159
system and the subsystem name is set according to the values of
160-
`control.config.defaults['iosys.indexed_system_name_prefix']` and
161-
`control.config.defaults['iosys.indexed_system_name_suffix']`. The default
160+
``control.config.defaults['iosys.indexed_system_name_prefix']`` and
161+
``control.config.defaults['iosys.indexed_system_name_suffix']``. The default
162162
subsystem name is the original system name with '$indexed' appended.
163163

164164
Simulating LTI systems
@@ -271,7 +271,7 @@ such as the :func:`step_response` function applied to a MIMO system,
271271
which will compute the step response for each input/output pair. See
272272
:class:`TimeResponseData` for more details.
273273

274-
The input, output, and state elements of the response can be access using
274+
The input, output, and state elements of the response can be accessed using
275275
signal names in place of integer offsets::
276276

277277
plt.plot(response. time, response.states['x[1]']

doc/plotting.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ Frequency response data can also be accessed directly and plotted manually::
292292
Access to frequency response data is available via the attributes
293293
``omega``, ``magnitude``,` `phase``, and ``response``, where ``response``
294294
represents the complex value of the frequency response at each frequency.
295-
The ``magnitude``,` `phase``, and ``response`` arrays can be indexed using
295+
The ``magnitude``, ``phase``, and ``response`` arrays can be indexed using
296296
either input/output indices or signal names, with the first index
297297
corresponding to the output signal and the second input corresponding to
298298
the input signal.

0 commit comments

Comments
 (0)