Fix time_response_plot for response lists#1231
Open
marko1olo wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
Local verification on The only local warning was pytest being unable to write |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes
time_response_plot()when called directly with a list ofTimeResponseDataobjects, as shown in #1171.The function now combines response lists into a multi-trace response before calculating plot layout, so callers do not hit
AttributeErroron list attributes such asplot_inputsorninputs.Checks
ct.time_response_plot([resp1, resp2])failed withAttributeError: 'list' object has no attribute 'plot_inputs'.ct.time_response_plot([resp1, resp2], plot_inputs=True)failed withAttributeError: 'list' object has no attribute 'ninputs'.MPLBACKEND=Agg python -m pytest control/tests/timeplot_test.py::test_time_response_plot_response_list control/tests/timeplot_test.py::test_list_responses -qpassed: 6 passed.MPLBACKEND=Agg python -m pytest control/tests/timeplot_test.py -qpassed: 74 passed, 3 skipped.MPLBACKEND=Agg python -m pytest control/tests/timeresp_test.py control/tests/trdata_test.py -qpassed: 276 passed, 46 skipped.python -m ruff check control/timeplot.py control/tests/timeplot_test.pypassed.python -m compileall -q control/timeplot.py control/tests/timeplot_test.pypassed.git diff --check HEAD~1..HEADpassed.