Update _ssmatrix and _check_shape for consistent usage by murrayrm · Pull Request #1116 · python-control/python-control
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
_ssmatrixto 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
_ssmatrixfor uniform processing. - Removed unneeded calls to
_ssmatrixon outputs of functions inmateqn.pyand other places. These calls were used back when we supported the NumPymatrixclass and are no longer required. - Fixed
ackerto use the matrices generated by_ssmatrix. - Updated
_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). - Removed internal
_check_shapeinstatefbk.pyand replaced with a call tomateqn._check_shape. - Updated unit tests to reflect the new wording of some error messages.
| control.dlqe: '9db995ed95c2214ce97074b0616a3191', | ||
| control.dlqr: '896cfa651dbbd80e417635904d13c9d6', | ||
| control.lqe: '567bf657538935173f2e50700ba87168', | ||
| control.dlqe: 'f2e52e35692cf5ffe911684d41d284c9', |
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.
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).
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