Skip to content

Honor explicit Nyquist indent direction near imaginary axis#1223

Merged
murrayrm merged 1 commit into
python-control:mainfrom
marko1olo:fix-nyquist-indent-direction
Jun 8, 2026
Merged

Honor explicit Nyquist indent direction near imaginary axis#1223
murrayrm merged 1 commit into
python-control:mainfrom
marko1olo:fix-nyquist-indent-direction

Conversation

@marko1olo

Copy link
Copy Markdown
Contributor

Fixes #1194.

Summary

  • detect when indent_direction was explicitly supplied
  • honor explicit left/right for poles within indent_radius, even when the pole has a small nonzero real part
  • preserve existing automatic side selection when no direction is passed
  • add a regression test for a near-imaginary-axis pole where explicit right and left must produce opposite real offsets

Tests

  • MPLBACKEND=Agg python -m pytest control\tests\nyquist_test.py::test_nyquist_indent_near_imaginary_axis control\tests\nyquist_test.py::test_nyquist_indent_default control\tests\nyquist_test.py::test_nyquist_indent_dont control\tests\nyquist_test.py::test_nyquist_indent_do control\tests\nyquist_test.py::test_nyquist_indent_left control\tests\nyquist_test.py::test_nyquist_indent_im control\tests\nyquist_test.py::test_no_indent_pole -q
  • MPLBACKEND=Agg python -m pytest control\tests\nyquist_test.py -q (24 passed, 1 existing xpass, 1 warning)
  • python -m ruff check control\freqplot.py control\tests\nyquist_test.py
  • python -m compileall -q control\freqplot.py control\tests\nyquist_test.py
  • git diff --check

Preserve automatic near-axis indentation when no direction is passed, but let explicit left/right override pole-side selection for poles within the indent radius.

Fixes python-control#1194
@coveralls

coveralls commented Jun 7, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 94.73% (-0.006%) from 94.736% — marko1olo:fix-nyquist-indent-direction into python-control:main

@marko1olo

Copy link
Copy Markdown
Contributor Author

I checked the remaining failed check. The test suite itself passed, including the Nyquist tests:

3816 passed, 555 skipped, 11 xfailed, 1 xpassed

The job failed afterward in coverallsapp/github-action@v2 while downloading/verifying the Coveralls binary checksum. The downloaded coveralls-checksums.txt content was a GitHub HTML “Unicorn!” error page, so this looks like an external coverage upload/bootstrap failure rather than a code/test failure in this PR.

@murrayrm murrayrm merged commit 17baf62 into python-control:main Jun 8, 2026
33 of 34 checks passed
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.

nyquist_response ignores indent_direction unless poles have exactly zero real part

3 participants