Skip to content

FIX: Accept precomputed responses in gangof4_plot - #1261

Closed
huxiaoyi-ovo wants to merge 2 commits into
python-control:mainfrom
huxiaoyi-ovo:fix/gangof4-precomputed-response
Closed

huxiaoyi-ovo wants to merge 2 commits into
python-control:mainfrom
huxiaoyi-ovo:fix/gangof4-precomputed-response

Conversation

@huxiaoyi-ovo

Copy link
Copy Markdown

Summary

Fixes two issues with gangof4_plot(response) when passing a precomputed Gang of Four response.

  • The default Hz=False was incorrectly treated as a frequency override, causing the call to raise ValueError.
  • Plotting options were passed as a positional dictionary instead of keyword arguments.

The fix preserves the existing plant/controller call path and keeps frequency overrides invalid for precomputed responses.

Tests

Added regression tests for:

  • Plotting a precomputed response in the expected 2×2 layout.
  • Forwarding plotting options such as dB=True.
  • Accepting Hz=False while rejecting frequency overrides (omega, omega_limits, omega_num, and Hz=True).

Ruff passed. Additional CI checks are running in [fork PR #2](huxiaoyi-ovo#2).

AI assistance: ChatGPT (GPT-6) helped identify the issue, prepare the fix, and add regression tests.

@huxiaoyi-ovo
huxiaoyi-ovo marked this pull request as ready for review October 27, 2026 09:52
@slivingston

Copy link
Copy Markdown
Member

@huxiaoyi-ovo Can you open an issue first to get agreement that the issues are real? You wrote

ChatGPT (GPT-6) helped identify the issue

so I guess it is not a real issue you encountered but one proposed by a chat bot...
Anyway, open an issue first.

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.

2 participants