Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion control/rlocus.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ def root_locus_plot(
from .pzmap import pole_zero_plot

# Legacy parameters
gains = config._process_legacy_keyword(kwargs, 'kvect', 'gains', gains)
for oldkey in ['kvect', 'k']:
gains = config._process_legacy_keyword(kwargs, oldkey, 'gains', gains)

# Set default parameters
grid = config._get_param('rlocus', 'grid', grid, _rlocus_defaults)
Expand Down
7 changes: 4 additions & 3 deletions control/tests/rlocus_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,11 @@ def test_root_locus_plots(sys, grid, xlim, ylim, interactive):


# Test deprecated keywords
def test_root_locus_legacy():
@pytest.mark.parametrize("keyword", ["kvect", "k"])
def test_root_locus_legacy(keyword):
sys = ct.rss(2, 1, 1)
with pytest.warns(DeprecationWarning, match="'kvect' is deprecated"):
ct.root_locus_plot(sys, kvect=[0, 1, 2])
with pytest.warns(DeprecationWarning, match=f"'{keyword}' is deprecated"):
ct.root_locus_plot(sys, **{keyword: [0, 1, 2]})


# Generate plots used in documentation
Expand Down