8000 deprecate relabel keyword in time_response_plot · toaster-code/python-control@fc09a85 · GitHub
[go: up one dir, main page]

Skip to content

Commit fc09a85

Browse files
committed
deprecate relabel keyword in time_response_plot
1 parent 8abb618 commit fc09a85

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

control/tests/timeplot_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,9 @@ def test_relabel():
530530
ct.step_response(sys1).plot()
531531

532532
# Generate a new plt, without relabeling
533-
cplt = ct.step_response(sys2).plot(relabel=False)
534-
assert cplt.axes[0, 0].get_ylabel() == 'y'
533+
with pytest.warns(FutureWarning, match="deprecated"):
534+
cplt = ct.step_response(sys2).plot(relabel=False)
535+
assert cplt.axes[0, 0].get_ylabel() == 'y'
535536

536537

537538
def test_errors():

control/timeplot.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,9 @@ def time_response_plot(
131131
List of line properties to use when plotting combined outputs. The
132132
default values are set by config.defaults['timeplot.output_props'].
133133
relabel : bool, optional
134-
By default, existing figures and axes are relabeled when new data
135-
are added. If set to `False`, just plot new data on existing axes.
134+
[deprecated] By default, existing figures and axes are relabeled
135+
when new data are added. If set to `False`, just plot new data on
136+
existing axes.
136137
show_legend : bool, optional
137138
Force legend to be shown if ``True`` or hidden if ``False``. If
138139
``None``, then show legend when there is more than one line on an
@@ -456,6 +457,7 @@ def _make_line_label(signal_index, signal_labels, trace_index):
456457

457458
# Stop here if the user wants to control everything
458459
if not relabel:
460+
warn("relabel keyword is deprecated", FutureWarning)
459461
return ControlPlot(out, ax_array, fig)
460462

461463
#

0 commit comments

Comments
 (0)
0