Update _ssmatrix and _check_shape for consistent usage #1116
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
_ssmatrix
and_check_shape
functions to make their usage more consistent and remove legacy calls that are no longer needed.Changes:
_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._ssmatrix
for uniform processing._ssmatrix
on outputs of functions inmateqn.py
and other places. These calls were used back when we supported the NumPymatrix
class and are no longer required.acker
to use the matrices generated by_ssmatrix
._check_shape
to have a call signature that is more conistent with_ssmatrix
: the matrix and dimensions are first, followed by optional keywords, with aname
keyword for the name of the matrix being checked (for error messages)._check_shape
instatefbk.py
and replaced with a call tomateqn._check_shape
.