-
Notifications
You must be signed in to change notification settings - Fork 411
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
xferfcn_test test_pole_mimo fails on arm and powerpc #343
Comments
Ignore my last question about slycot. It is not even used in |
Assuming that the problem comes down to a difference in precision between architectures, what is the best way to fix this? One possibility would be to introduce a configuration variable for the error tolerance that get used as a default and then this could be set in the test scripts for different architectures (?). |
Have look at this one: def test_pole_mimo(self):
"""Test for correct MIMO poles."""
sys = TransferFunction([[[1.], [1.]], [[1.], [1.]]],
[[[1., 2.], [1., 3.]], [[1., 4., 4.], [1., 9., 14.]]])
p = sys.pole()
try:
np.testing.assert_array_almost_equal(p, [-2., -2., -7., -3., -2.])
except AssertionError as e:
print("EPS: {}".format(np.finfo(float).eps))
for i in [0, 1]:
for j in [0, 1]:
print("Roots of sys.den[{}][{}]:".format(i, j))
print(np.roots(sys.den[i][j]))
numc, denc, denorderc = sys._common_den()
print("Common Den:")
print(denc)
raise e
Maybe But I still not fully understand that |
I'm not an expert on this, but my sense is that computing common denominators for MIMO transfer functions is often ill-conditioned. @repagh and @roryyorke are have more expertise here. |
Ok, @repagh, @roryyorke, please have a look at my take in #345. Changing threshold whether we already have the root or not to sqrt(eps) fixes the test failure. I also changed the logic to actually do something with imag_tol. That last warning in the function never would have triggered because |
Fixed in PR #345 |
As a continuation of my efforts to provide packages of python-control and slycot for OpenSUSE ( see python-control/Slycot#82 and python-control/Slycot#83), python-control now starts to build (because python-slycot is avaialble now) but fails on test_pole_mimo in xferfcn_test.py:
_common_den()
strikes again (#194, #206). I see it has the optional argumentimag_tol
, but it is never used within the function except where it is set to 1e-8 by default.Any ideas how to fix this? Is the resulting machine precision on theses arches really worse than the x86 build, where this tests fine? Or is there maybe a problem with the slycot / lapack / (open)blas / numpy environment on those build machines?
The text was updated successfully, but these errors were encountered: