GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix CI test and doctest failures with updated NumPy, SciPy, and Matplotlib by murrayrm · Pull Request #1243 · python-control/python-control

Conversation

@murrayrm

@murrayrm murrayrm commented Aug 8, 2026

Copy link
Copy Markdown
Member

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 main once this is merged.

NumPy: unsupported shape assignment

ndarray.shape assignment is no longer supported in these contexts;
replaced with reshape().

  • control/descfcn.py — describing_function()
  • control/statesp.py — StateSpace.__init__(), static-system reshaping

NumPy: 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() takes sqrt(w.real),
    since Wo @ Wc is symmetric positive semidefinite in exact arithmetic
  • control/phaseplot.py — separatrices() uses the real part of the
    eigenvector, avoiding complex initial conditions

Matplotlib: warning no longer emitted

  • control/tests/ctrlplot_test.py — drop the pytest.warns(UserWarning, match="Tight layout not applied") check in
    test_pole_zero_subplots(), which no longer fires

Platform-dependent numerics

  • control/tests/nyquist_test.py — test_nyquist_indent_near_imaginary_axis()
    now constructs the system with ct.zpk(), placing the poles near the
    imaginary 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: +ELLIPSIS with ~14 significant digits. The value comes from
    a scipy.optimize.root_scalar bisection, so the last digit or two of
    the repr varies across SciPy/BLAS builds; the full-precision literals
    passed locally but failed on GitHub runners. +ELLIPSIS keeps the
    examples verified, unlike the +SKIP used elsewhere for
    platform-dependent output, and trim_doctest_flags (on by default)
    strips the flag comment from the rendered HTML.

Testing

make doctest in doc/: 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() doctest
change was written with assistance from Claude Code. I have reviewed it
and take responsibility for its content.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
murrayrm and others added 6 commits August 8, 2026 10:09
@murrayrm
change unsupported "shape =" to reshape() to avoid warnings
ae4915c
@murrayrm
remove unneeded warning check in ctrlplot_test()
3b70cb4
@murrayrm
place near imaginary poles in nyquist_test to fix signs
40860d5
@murrayrm
cast eigenvectors to real to avoid imaginary initial conditions
84b0d0f
@murrayrm
cast singular values to real (fix doctest error)
c4f248c
@murrayrm @claude
use doctest ELLIPSIS for bandwidth() values to avoid ULP failures
65d1d26
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 <[email protected]>
@coveralls

coveralls commented Aug 8, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 94.74% (+0.2%) from 94.579% — murrayrm:update_tests-08Aug2026 into python-control:main

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Aug 9, 2026
docs: clarify lqe and dlqe error covariance wording #1219
Merged
Add dlqe filter-form gain option #1220
Closed
Add scipy fallbacks for generalized Lyapunov and discrete Sylvester equations #1234
Merged
Fix matched c2d/sample returning NaN for a pole or zero at the origin #1241
Merged
@slivingston
slivingston self-requested a review August 9, 2026 05:13
slivingston
slivingston approved these changes Aug 9, 2026
View reviewed changes
@slivingston
slivingston merged commit 8808fe9 into python-control:main Aug 9, 2026
24 checks passed

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Aug 9, 2026
Fix refgain controllers with integral action #1222
Merged
Fix time_response_plot for response lists #1224
Closed
fix(xferfcn): normalize real zpk coefficients #1226
Closed
Stabilize LQE covariance symmetry checks #1227
Closed
Preserve signal names in scalar LTI operations #1228
Closed
Fix forced_response time inference for transposed inputs #1229
Closed
Preserve complex StateSpace matrices #1230
Closed
Fix time_response_plot for response lists #1231
Closed
Use initial root-locus limits when choosing gains #1233
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@slivingston slivingston slivingston approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@murrayrm @coveralls @slivingston
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.