-
Notifications
You must be signed in to change notification settings - Fork 438
fixes to unit tests so that they pass when the default array type is ndarray #433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixes to unit tests so that they pass when the default array type is ndarray #433
Conversation
…y instead of matrix. two failing unit tests to fix still
I made a test merge in bnavigator#1 and reactivated TravisCI for my fork. Tests look good so far, there were merge conflicts in both merges, because the edits were in lines next to each other. Please check, if I resolved correctly. |
Regarding the actual PR: Could you add a CI job that runs the tests with default |
control/statesp.py
Outdated
'statesp.use_numpy_matrix': True, | ||
'statesp.use_numpy_matrix': False, |
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.
Shouldn't we only change defaults in a major release?
How about keeping the default, but adding a CI job as proposed to maintain ndarray compatibility until the default is changed for good? At the time of the default change, keep a CI job that tests for compatibility with matrix as long as it is supported.
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.
indeed. I don't know what the release plans are for big changes (wasn't sure this would go into the next release), but let me push a commit that reverses this for now, but that way we can still have unit test fixes.
Looks good to me -- I think! |
Could you possibly point me to where I might configure that? |
I was a about to create a PR into yours, but your repo does not show up, when I try to select the Base Repository? Please pull the commit yourself: bnavigator@eda91ca
|
Ok sure. Kids just got home so I will have to do it when I have a moment at
the computer later this evening.
On Thu, Jul 23, 2020 at 3:57 PM Ben Greiner ***@***.***> wrote:
I was a about to create a PR into yours, but your repo does not show up,
when I try to select the Base Repository? Please pull the commit yourself:
***@***.***
<bnavigator@eda91ca>
git remote add bnavigator https://github.com/bnavigator/python-control.git
git fetch --all
git merge bnavigator/pr433
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#433 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN74SSO3KI2ZUSKN2O4BWCTR5C54HANCNFSM4PFCUGCA>
.
--
Sawyer Fuller
Assistant Professor of Mechanical Engineering
University of Washington
http://faculty.washington.edu/~minster/
(Typed with my thumbs)
|
... and it found three more matrix/ndarray mismatches:
Matrix to ndarray conversion produced the wrong dimension.
Same as above. |
Should I do a git push upstream now that it's merged? |
As for the errors you're seeing, I don't see them. To run tests locally, I've been running |
That one is deprecated.
Not upstream but into your origin. I saw you did. And you see the failure in Travis CI here, too. |
OK I think I got those three bugs squashed. waiting on Travis to confirm. |
BTW, I am working on the overall matrix/array testing. https://github.com/bnavigator/python-control/tree/array-matrix-tests |
In my opinion, this PR should go into 0.8.4. The patch release will still have |
Since this is mainly a developer-facing change (right?), seems OK to push it into master sooner rather than later (and hence have it be part of 0.8.4). |
The user facing changes are in
Now a user can use arrays. |
Sounds backwards compatible, so seems fine for 0.8.4. |
instead of deprecated
matrix
class. Changes entailed:A
is amatrix
,A[:, 1]
is still a 2D matrix, but ifA
is anndarray
, that slice results in a 1D vector. To fix, this was changed to e.g. A[:, 1:2], which perserves that the array is 2D after slicing.statesp.__init__
attempts to determine whether they should be row or column vectors.I checked on my computer and unit tests also pass when the default array type is
matrix
.