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 — Don't fail in step_info() if the rise-time level is never reached by syahra712 · Pull Request #1259 · python-control/python-control

Conversation

@syahra712

@syahra712 syahra712 commented Oct 20, 2026

Copy link
Copy Markdown

step_info() raises IndexError when the response never reaches the rise-time limits within the time vector:

>>> import control as ct
>>> ct.step_info(ct.tf([2.99, -0.0685], [1, 2.83]))
IndexError: index 0 is out of bounds for axis 0 with size 0

This system is stable. The step response starts at 2.99, from the feedthrough, and decays to the DC gain of -0.0242. The default time vector ends at about 2.44 s, where the response is about -0.021. That is only about 87% of the final value, so np.nonzero(...)[0][0] for the 90% level is empty. The same error happens for time-series input whose yfinal is never approached, e.g. ct.step_info(1 - np.exp(-t), t, yfinal=1) with t in [0, 1].

Fix: if either rise-time level is never reached, RiseTime, SettlingMin and SettlingMax stay NaN. SettlingMin and SettlingMax are measured from the rise time onward. The other entries are computed as before. SettlingTime already falls back to NaN when the response doesn't settle. This follows the same idea as the fix for #1014.

Tests: added test_step_info_rise_not_reached to timeresp_test.py.

  • It covers time-series data and the transfer function above.
  • It fails without the fix with the IndexError, and passes with it.
  • Full control/tests result: 3858 passed, 554 skipped (no slycot).
  • ruff check is clean on the changed files.

AI-assisted (Claude): I used it to help read the code and draft the test. I reviewed and ran everything myself.

Sorry, something went wrong.

Uh oh!

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

All reactions
@syahra712
Don't fail in step_info() if the 90% rise level is never reached
10167f9
If the response never reaches the rise time limits (e.g. the default
time vector ends too early for a system with a large feedthrough
transient), np.nonzero(...)[0][0] raised IndexError.  Leave RiseTime,
SettlingMin and SettlingMax as NaN in that case.
@slivingston

slivingston commented Oct 20, 2026

Copy link
Copy Markdown
Member

@syahra712 Can you open an issue first, reporting the supposed bug that you are fixing?

All reactions

Sorry, something went wrong.

Uh oh!

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

@slivingston slivingston closed this Oct 20, 2026
@slivingston

slivingston commented Oct 20, 2026

Copy link
Copy Markdown
Member

@syahra712 Also, can you verify whether this PR was opened automatically by an AI agent?

All reactions

Sorry, something went wrong.

Uh oh!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

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.

2 participants

@syahra712 @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.