Skip to content

Commit dc36574

Browse files
committed
Adjust naming and docstring conventions
1 parent 9f4bf4f commit dc36574

1 file changed

Lines changed: 17 additions & 19 deletions

File tree

‎control/bdalg.py‎

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -516,17 +516,16 @@ def combine_tf(tf_array):
516516
517517
Parameters
518518
----------
519-
tf_array : List[List[Union[ArrayLike, control.TransferFunction]]]
519+
tf_array : list of list of TransferFunction or array_like
520520
Transfer matrix represented as a two-dimensional array or list-of-lists
521-
containing :class:`TransferFunction` objects. The
522-
:class:`TransferFunction` objects can have multiple outputs and inputs,
523-
as long as the dimensions are compatible.
521+
containing TransferFunction objects. The TransferFunction objects can
522+
have multiple outputs and inputs, as long as the dimensions are
523+
compatible.
524524
525525
Returns
526526
-------
527-
control.TransferFunction
528-
Transfer matrix represented as a single MIMO :class:`TransferFunction`
529-
object.
527+
TransferFunction
528+
Transfer matrix represented as a single MIMO TransferFunction object.
530529
531530
Raises
532531
------
@@ -600,15 +599,14 @@ def combine_tf(tf_array):
600599
raise ValueError(
601600
f"Mismatched number transfer function inputs in row {row_index} of denominator."
602601
)
603-
G_tf = tf.TransferFunction(num, den, dt=dt)
604-
return G_tf
602+
return tf.TransferFunction(num, den, dt=dt)
605603

606604
def split_tf(transfer_function):
607605
"""Split MIMO transfer function into NumPy array of SISO tranfer functions.
608606
609607
Parameters
610608
----------
611-
transfer_function : control.TransferFunction
609+
transfer_function : TransferFunction
612610
MIMO transfer function to split.
613611
614612
Returns
@@ -648,25 +646,25 @@ def split_tf(transfer_function):
648646
)
649647
)
650648
tf_split_lst.append(row)
651-
tf_split = np.array(tf_split_lst, dtype=object)
652-
return tf_split
649+
return np.array(tf_split_lst, dtype=object)
653650

654651
def _ensure_tf(arraylike_or_tf, dt=None):
655652
"""Convert an array-like to a transfer function.
656653
657654
Parameters
658655
----------
659-
arraylike_or_tf : Union[ArrayLike, control.TransferFunction]
656+
arraylike_or_tf : TransferFunction or array_like
660657
Array-like or transfer function.
661-
dt : Union[None, bool, float]
662-
Timestep (s). ``True`` indicates a discrete-time system with
663-
unspecified timestep, ``0`` indicates a continuous-time system, and
664-
``None`` indicates a continuous- or discrete-time system with
665-
unspecified timestep. If ``None``, timestep is not validated.
658+
dt : None, True or float, optional
659+
System timebase. 0 (default) indicates continuous
660+
time, True indicates discrete time with unspecified sampling
661+
time, positive number is discrete time with specified
662+
sampling time, None indicates unspecified timebase (either
663+
continuous or discrete time). If None, timestep is not validated.
666664
667665
Returns
668666
-------
669-
control.TransferFunction
667+
TransferFunction
670668
Transfer function.
671669
672670
Raises

0 commit comments

Comments
 (0)