Skip to content

Fix time_response_plot for response lists - #1224

Closed
marko1olo wants to merge 1 commit into
python-control:mainfrom
marko1olo:fix-time-response-list-plot
Closed

Fix time_response_plot for response lists#1224
marko1olo wants to merge 1 commit into
python-control:mainfrom
marko1olo:fix-time-response-list-plot

Conversation

@marko1olo

@marko1olo marko1olo commented Jun 7, 2026

Copy link
Copy Markdown

Fixes #1171.

step_response([sys1, sys2]) and related simulation calls return TimeResponseList. Calling .plot() on that object already worked, but calling the public function directly raised before it could plot:

AttributeError: 'TimeResponseList' object has no attribute 'plot_inputs'

This routes TimeResponseList and plain Python lists of time responses through the existing TimeResponseList.plot() path. The change is scoped to the crash/list-support part of the issue and leaves the color-improvement discussion separate.

Local validation:

  • Red repro before fix: ct.time_response_plot(ct.step_response([sys1, sys2])) raised AttributeError: 'TimeResponseList' object has no attribute 'plot_inputs'.
  • After fix smoke: same call returns a (1, 1) plot with two lines for SISO responses.
  • MPLBACKEND=Agg PYTHONPATH=. python -m pytest control\tests\timeplot_test.py::test_list_responses -q -> 5 passed
  • MPLBACKEND=Agg PYTHONPATH=. python -m pytest control\tests\timeplot_test.py -q -> 73 passed, 3 skipped
  • python -m ruff check control\timeplot.py control\tests\timeplot_test.py
  • python -m compileall -q control\timeplot.py control\tests\timeplot_test.py
  • git diff --check

Authored with assistance from OpenAI Codex.


AI Disclosure: Codex (ChatGPT 5.5) was used during code navigation, initial drafting, and PR text preparation. All logic, code changes, and test cases have been manually reviewed, verified, and tested locally by the author in accordance with the NumPy AI Policy.

@murrayrm

murrayrm commented Aug 9, 2026

Copy link
Copy Markdown
Member

@marko1olo Please rebase off of main to trigger updated CI checks from PR #1243.

@coveralls

coveralls commented Aug 13, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 94.742% (-0.02%) from 94.757% — marko1olo:fix-time-response-list-plot into python-control:main

Route TimeResponseList and plain lists of time responses through the existing TimeResponseList plotting path when calling the public time_response_plot function directly. This keeps response_list.plot() behavior unchanged while fixing the standalone function for list-returning simulation calls.
@marko1olo

Copy link
Copy Markdown
Author

Closing this in favor of #1231 which has the clean rebased branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug in time_response_plot for multiple responses + improvements in input/output colors.

3 participants