Skip to content

Commit 9f4bf4f

Browse files
committed
Rename split and combine to split_tf and combine_tf
1 parent 76d4ee7 commit 9f4bf4f

2 files changed

Lines changed: 17 additions & 25 deletions

File tree

control/bdalg.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
negate
1111
feedback
1212
connect
13-
combine
14-
split
13+
combine_tf
14+
split_tf
1515
1616
"""
1717

@@ -65,16 +65,8 @@
6565
from . import xferfcn as tf
6666
from .iosys import InputOutputSystem
6767

68-
__all__ = [
69-
'series',
70-
'parallel',
71-
'negate',
72-
'feedback',
73-
'append',
74-
'connect',
75-
'combine',
76-
'split',
77-
]
68+
__all__ = ['series', 'parallel', 'negate', 'feedback', 'append', 'connect',
69+
'combine_tf', 'split_tf']
7870

7971

8072
def series(sys1, *sysn, **kwargs):
@@ -519,7 +511,7 @@ def connect(sys, Q, inputv, outputv):
519511

520512
return Ytrim * sys * Utrim
521513

522-
def combine(tf_array):
514+
def combine_tf(tf_array):
523515
"""Combine array-like of transfer functions into MIMO transfer function.
524516
525517
Parameters
@@ -551,7 +543,7 @@ def combine(tf_array):
551543
Combine two transfer functions
552544
553545
>>> s = control.TransferFunction.s
554-
>>> control.combine([
546+
>>> control.combine_tf([
555547
... [1 / (s + 1)],
556548
... [s / (s + 2)],
557549
... ])
@@ -611,7 +603,7 @@ def combine(tf_array):
611603
G_tf = tf.TransferFunction(num, den, dt=dt)
612604
return G_tf
613605

614-
def split(transfer_function):
606+
def split_tf(transfer_function):
615607
"""Split MIMO transfer function into NumPy array of SISO tranfer functions.
616608
617609
Parameters
@@ -638,7 +630,7 @@ def split(transfer_function):
638630
... [[1, 1], [1, 1]],
639631
... ],
640632
... )
641-
>>> control.split(G)
633+
>>> control.split_tf(G)
642634
array([[TransferFunction(array([87.8]), array([1, 1])),
643635
TransferFunction(array([-86.4]), array([1, 1]))],
644636
[TransferFunction(array([108.2]), array([1, 1])),

control/tests/bdalg_test.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ def test_error_ensure(self, arraylike_or_tf, dt, exception):
466466

467467

468468
class TestTfCombineSplit:
469-
"""Test :func:`combine` and :func:`split`."""
469+
"""Test :func:`combine_tf` and :func:`split_tf`."""
470470

471471
@pytest.mark.parametrize(
472472
"tf_array, tf",
@@ -621,9 +621,9 @@ class TestTfCombineSplit:
621621
),
622622
],
623623
)
624-
def test_combine(self, tf_array, tf):
624+
def test_combine_tf(self, tf_array, tf):
625625
"""Test combining transfer functions."""
626-
tf_combined = ctrl.combine(tf_array)
626+
tf_combined = ctrl.combine_tf(tf_array)
627627
assert _tf_close_coeff(tf_combined, tf)
628628

629629
@pytest.mark.parametrize(
@@ -706,9 +706,9 @@ def test_combine(self, tf_array, tf):
706706
),
707707
],
708708
)
709-
def test_split(self, tf_array, tf):
709+
def test_split_tf(self, tf_array, tf):
710710
"""Test splitting transfer functions."""
711-
tf_split = ctrl.split(tf)
711+
tf_split = ctrl.split_tf(tf)
712712
# Test entry-by-entry
713713
for i in range(tf_split.shape[0]):
714714
for j in range(tf_split.shape[1]):
@@ -718,8 +718,8 @@ def test_split(self, tf_array, tf):
718718
)
719719
# Test combined
720720
assert _tf_close_coeff(
721-
ctrl.combine(tf_split),
722-
ctrl.combine(tf_array),
721+
ctrl.combine_tf(tf_split),
722+
ctrl.combine_tf(tf_array),
723723
)
724724

725725
@pytest.mark.parametrize(
@@ -817,10 +817,10 @@ def test_split(self, tf_array, tf):
817817
),
818818
],
819819
)
820-
def test_error_combine(self, tf_array, exception):
820+
def test_error_combine_tf(self, tf_array, exception):
821821
"""Test error cases."""
822822
with pytest.raises(exception):
823-
ctrl.combine(tf_array)
823+
ctrl.combine_tf(tf_array)
824824

825825

826826
def _tf_close_coeff(tf_a, tf_b, rtol=1e-5, atol=1e-8):

0 commit comments

Comments
 (0)