Fix CI test and doctest failures with updated NumPy, SciPy, and Matplotlib - #1243
Merged
Merged
Conversation
bandwidth() gets its value from a scipy.optimize.root_scalar bisection, so the last digit or two of the repr differs across scipy/BLAS builds. The full-precision literals matched locally but failed on GitHub. Truncate to ~14 significant digits with # doctest: +ELLIPSIS. This keeps the examples verified (unlike +SKIP, used elsewhere in the repo for platform-dependent output), and trim_doctest_flags (on by default) strips the flag comment from the rendered HTML. Also applied to the G1*G2 example, which has the same origin and had not failed yet. Verified with "make doctest" in doc/: 728 tests, 0 failures. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 9, 2026
slivingston
self-requested a review
August 9, 2026 05:13
slivingston
approved these changes
Aug 9, 2026
This was referenced Aug 9, 2026
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.
A collection of small, independent fixes for test and doctest failures
appearing in CI. No functional changes to the library API. Open PRs
with failing CI tests should rebase onto
mainonce this is merged.NumPy: unsupported
shapeassignmentndarray.shapeassignment is no longer supported in these contexts;replaced with
reshape().control/descfcn.py—describing_function()control/statesp.py—StateSpace.__init__(), static-system reshapingNumPy: complex-to-real casts
Discard the (numerically zero) imaginary parts explicitly rather than
letting NumPy warn on the implicit cast.
control/modelsimp.py—hankel_singular_values()takessqrt(w.real),since
Wo @ Wcis symmetric positive semidefinite in exact arithmeticcontrol/phaseplot.py—separatrices()uses the real part of theeigenvector, avoiding complex initial conditions
Matplotlib: warning no longer emitted
control/tests/ctrlplot_test.py— drop thepytest.warns(UserWarning, match="Tight layout not applied")check intest_pole_zero_subplots(), which no longer firesPlatform-dependent numerics
control/tests/nyquist_test.py—test_nyquist_indent_near_imaginary_axis()now constructs the system with
ct.zpk(), placing the poles near theimaginary axis explicitly instead of relying on the roots of a
polynomial, which gave inconsistent indent signs
control/lti.py,doc/intro.rst—bandwidth()doctests use# doctest: +ELLIPSISwith ~14 significant digits. The value comes froma
scipy.optimize.root_scalarbisection, so the last digit or two ofthe repr varies across SciPy/BLAS builds; the full-precision literals
passed locally but failed on GitHub runners.
+ELLIPSISkeeps theexamples verified, unlike the
+SKIPused elsewhere forplatform-dependent output, and
trim_doctest_flags(on by default)strips the flag comment from the rendered HTML.
Testing
make doctestindoc/: 728 tests, 0 failures(Python 3.14.6, NumPy 2.5.1, SciPy 1.18.0).
AI disclosure
Per the AI policy referenced in README.rst: the
bandwidth()doctestchange was written with assistance from Claude Code. I have reviewed it
and take responsibility for its content.