Skip to content
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

Fix test sg03ad #82

Closed

Conversation

bnavigator
Copy link
Collaborator

This test fails on some architectures while building for openSUSE. Replacing range() which returns an int generator with arange() fixes this.

Plus some whitespace (pep8) fixes.

@bnavigator
Copy link
Collaborator Author

Hmm, the build service now reports failure again even with the patch applied. Seems there are more issues with powerpc left.

[  429s] ======================================================================
[  429s] FAIL: test_sg03ad_a (slycot.tests.test_sg03ad.test_sg03ad)
[  429s] ----------------------------------------------------------------------
[  429s] Traceback (most recent call last):
[  429s]   File "/home/abuild/rpmbuild/BUILDROOT/python-slycot-0.3.5.0-18.1.ppc64/usr/lib64/python3.7/site-packages/slycot/tests/test_sg03ad.py", line 32, in test_sg03ad_a
[  429s]     assert_almost_equal(Xref, X)
[  429s]   File "/usr/lib64/python3.7/site-packages/numpy/testing/_private/utils.py", line 584, in assert_almost_equal
[  429s]     return assert_array_almost_equal(actual, desired, decimal, err_msg)
[  429s]   File "/usr/lib64/python3.7/site-packages/numpy/testing/_private/utils.py", line 1029, in assert_array_almost_equal
[  429s]     precision=decimal)
[  429s]   File "/usr/lib64/python3.7/site-packages/numpy/testing/_private/utils.py", line 841, in assert_array_compare
[  429s]     raise AssertionError(msg)
[  429s] AssertionError: 
[  429s] Arrays are not almost equal to 7 decimals
[  429s] 
[  429s] Mismatch: 58.6%
[  429s] Max absolute difference: 0.65333008
[  429s] Max relative difference: 1.31888793
[  429s]  x: array([[1., 1., 1., ..., 1., 1., 1.],
[  429s]        [1., 1., 1., ..., 1., 1., 1.],
[  429s]        [1., 1., 1., ..., 1., 1., 1.],...
[  429s]  y: array([[1.       , 1.       , 1.       , ..., 1.6032463, 1.5698183,
[  429s]         1.5585347],
[  429s]        [1.       , 1.       , 1.       , ..., 1.5900677, 1.557722 ,...
[  429s] 

@bnavigator bnavigator changed the title Fix test sg03ad static Fix test sg03ad Nov 15, 2019
@bnavigator
Copy link
Collaborator Author

Back in business! The calculation of matrix A did not fit the definition of the paper. I added the discrete time case from the paper as well.

@roryyorke
Copy link
Collaborator

Just for my info: how important is the range to np.arange change? It looks like np.diag(range(n)) works OK.

I'm going to try to push a rebase onto lastest master.

@bnavigator
Copy link
Collaborator Author

Just for my info: how important is the range to np.arange change? It looks like np.diag(range(n)) works OK.

I think I did that to avoid having an array of integers. Some Python version back then introduced precision problems because of the implicit conversion. Not sure anymore if it is really needed. Numpy on Python 3.8 however frequently produce DeprecationWarnings when an array needs to be casted to float implicitly. So better keep the np.arange?

@roryyorke
Copy link
Collaborator

On range/arange: I was just curious.

I can't push to this branch - are you willing (and do you have the know-how---I don't think I do!) to make it editable by other Slycot devs? I want to push the rebase (see https://github.com/roryyorke/Slycot/tree/fix_test_sg03ad_static)

@roryyorke
Copy link
Collaborator

Merged via 9d2bfe3

@roryyorke roryyorke closed this Apr 10, 2020
@bnavigator
Copy link
Collaborator Author

This PR was missing the

  • Allow edits from maintainers.

checkbox. All the other remaining PR's do have it.

@roryyorke
Copy link
Collaborator

FWIW I just tried pushing a rebased branch for #83, it also failed. When I try to push it asks for a username (assume it tries my normal SSH credentials first, and fails).

@bnavigator
Copy link
Collaborator Author

Did you add the remote as https:// or git@github...?

@roryyorke
Copy link
Collaborator

Ah-ha, thank you! Had it as https. Now pushed.

I'll be offline for an hour or two now.

@bnavigator bnavigator deleted the fix_test_sg03ad_static branch December 31, 2020 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants