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 — Update _ssmatrix and _check_shape for consistent usage by murrayrm · Pull Request #1116 · python-control/python-control

Conversation

@murrayrm

@murrayrm murrayrm commented Feb 2, 2025

Copy link
Copy Markdown
Member

Prompted by issue #1100, this PR updates the _ssmatrix and _check_shape functions to make their usage more consistent and remove legacy calls that are no longer needed.

Changes:

  • Updated _ssmatrix to allow checking for square matrices and row/col dimensions, with improved error messages that include the name of the matrix generating the error.
  • Functions that accept state-space matrices now call _ssmatrix for uniform processing.
  • Removed unneeded calls to _ssmatrix on outputs of functions in mateqn.py and other places. These calls were used back when we supported the NumPy matrix class and are no longer required.
  • Fixed acker to use the matrices generated by _ssmatrix.
  • Updated _check_shape to have a call signature that is more conistent with _ssmatrix: the matrix and dimensions are first, followed by optional keywords, with a name keyword for the name of the matrix being checked (for error messages).
  • Removed internal _check_shape in statefbk.py and replaced with a call to mateqn._check_shape.
  • Updated unit tests to reflect the new wording of some error messages.

Sorry, something went wrong.

Uh oh!

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

All reactions
@murrayrm
update _ssmatrix and _check_shape for consistent usage
4fc70f7
@murrayrm murrayrm linked an issue Feb 2, 2025 that may be closed by this pull request
statefbk.acker doesn't use _ssmatrix-converted value of inputs #1100
Closed
@coveralls

coveralls commented Feb 2, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Coverage Status

coverage: 94.661% (+0.002%) from 94.659%
when pulling 4fc70f7 on murrayrm:update_ssmatrix-01Feb2025
into 2cb0520 on python-control:main.

All reactions

Sorry, something went wrong.

Uh oh!

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

roryyorke
roryyorke approved these changes Feb 2, 2025
View reviewed changes
Comment thread control/tests/docstrings_test.py
control.dlqe: '9db995ed95c2214ce97074b0616a3191',
control.dlqr: '896cfa651dbbd80e417635904d13c9d6',
control.lqe: '567bf657538935173f2e50700ba87168',
control.dlqe: 'f2e52e35692cf5ffe911684d41d284c9',

@roryyorke roryyorke Feb 2, 2025

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these hashes are new-ish, just got caught out by them working on adding ruff-pyflakes checks. Is the idea to require the developer changing code to consider implications on the docstring? Or, I suppose, vice versa.

Sorry, something went wrong.

Uh oh!

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

All reactions

@murrayrm murrayrm Feb 2, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that was the idea. However, they will go away when #1094 is merged (I found a better way to handle them).

Sorry, something went wrong.

Uh oh!

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

All reactions
@murrayrm
murrayrm merged commit d2f9a9c into python-control:main Feb 2, 2025
@murrayrm murrayrm added this to the 0.10.2 milestone Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@roryyorke roryyorke roryyorke approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

0.10.2

Development

Successfully merging this pull request may close these issues.

statefbk.acker doesn't use _ssmatrix-converted value of inputs

Uh oh!

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

3 participants

@murrayrm @coveralls @roryyorke
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.