Update _ssmatrix and _check_shape for consistent usage#1116
Merged
murrayrm merged 1 commit intopython-control:mainfrom Feb 2, 2025
Merged
Update _ssmatrix and _check_shape for consistent usage#1116murrayrm merged 1 commit intopython-control:mainfrom
murrayrm merged 1 commit intopython-control:mainfrom
Conversation
roryyorke
approved these changes
Feb 2, 2025
| control.dlqe: '9db995ed95c2214ce97074b0616a3191', | ||
| control.dlqr: '896cfa651dbbd80e417635904d13c9d6', | ||
| control.lqe: '567bf657538935173f2e50700ba87168', | ||
| control.dlqe: 'f2e52e35692cf5ffe911684d41d284c9', |
Contributor
There was a problem hiding this comment.
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.
Member
Author
There was a problem hiding this comment.
Yes, that was the idea. However, they will go away when #1094 is merged (I found a better way to handle them).
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.
Prompted by issue #1100, this PR updates the
_ssmatrixand_check_shapefunctions to make their usage more consistent and remove legacy calls that are no longer needed.Changes:
_ssmatrixto allow checking for square matrices and row/col dimensions, with improved error messages that include the name of the matrix generating the error._ssmatrixfor uniform processing._ssmatrixon outputs of functions inmateqn.pyand other places. These calls were used back when we supported the NumPymatrixclass and are no longer required.ackerto use the matrices generated by_ssmatrix._check_shapeto have a call signature that is more conistent with_ssmatrix: the matrix and dimensions are first, followed by optional keywords, with anamekeyword for the name of the matrix being checked (for error messages)._check_shapeinstatefbk.pyand replaced with a call tomateqn._check_shape.