You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gangof4_plot(response) rejects precomputed responses with default options #1264
Title: gangof4_plot(response) rejects precomputed responses with default options
Problem
The documented gangof4_plot(response) call appears to fail when passed a precomputed Gang of Four response.
Minimal reproducer:
importcontrolasctP=ct.tf([1], [1, 1])
C=ct.tf([2], [1])
response=ct.gangof4_response(P, C)
ct.gangof4_plot(response)
Expected: Plot the precomputed 2×2 frequency response.
Problem in current main: The frequency-option check treats the default Hz=False as an invalid override because False is not None evaluates to True. This forces a ValueError even when no frequency options were supplied.
There is also a separate argument-forwarding issue: the same branch calls response.plot(kwargs) instead of response.plot(**kwargs), passing the options dictionary as a positional argument.
Both issues are visible in control/freqplot.py. The control-flow condition has been checked independently; I have not executed the complete unmodified package locally.
Would you consider these bugs in the documented response-first API? If so, I can provide a focused fix and regression tests.
Related: #1261, following the request to discuss the behavior in an issue before submitting a PR.
Activity
slivingston commentedon Oct 28, 2026
@huxiaoyi-ovo Please add the AI disclosure if you used it to write this issue etc.
huxiaoyi-ovo commentedon Oct 29, 2026
AI disclosure: ChatGPT-6 astra ultra assisted with code analysis and drafting this issue.