============================= test session starts ==============================
platform linux -- Python 3.8.3, pytest-5.4.3, py-1.8.1, pluggy-0.13.1
rootdir: /build/osqp-0.6.1
collected 49 items / 1 deselected / 48 selected
module/tests/basic_test.py ........... [ 22%]
module/tests/codegen_matrices_test.py ......... [ 41%]
module/tests/codegen_vectors_test.py ..... [ 52%]
module/tests/dual_infeasibility_test.py ... [ 58%]
module/tests/feasibility_test.py . [ 60%]
module/tests/non_convex_test.py ... [ 66%]
module/tests/polishing_test.py ... [ 72%]
module/tests/primal_infeasibility_test.py .. [ 77%]
module/tests/unconstrained_test.py . [ 79%]
module/tests/update_matrices_test.py FFFFFFFFF [ 97%]
module/tests/warm_start_test.py . [100%]
=================================== FAILURES ===================================
_______________________ update_matrices_tests.test_solve _______________________
self = <module.tests.update_matrices_test.update_matrices_tests testMethod=test_solve>
def test_solve(self):
# Solve problem
res = self.model.solve()
# Assert close
> nptest.assert_array_almost_equal(res.x,
np.array([0.85459329, 0.73472366, 0.06156, -0.06095794, -0.96167612]))
E AssertionError:
E Arrays are not almost equal to 6 decimals
E
E Mismatched elements: 5 / 5 (100%)
E Max absolute difference: 1.99022911
E Max relative difference: 22.44656972
E x: array([-1.135636, -0.471212, 0.214947, 1.307339, 0.176622])
E y: array([ 0.854593, 0.734724, 0.06156 , -0.060958, -0.961676])
module/tests/update_matrices_test.py:46: AssertionError
_____________________ update_matrices_tests.test_update_A ______________________
self = <module.tests.update_matrices_test.update_matrices_tests testMethod=test_update_A>
def test_update_A(self):
# Update matrix A
Ax = self.A_new.data
Ax_idx = np.arange(self.A_new.nnz)
self.model.update(Ax=Ax, Ax_idx=Ax_idx)
res = self.model.solve()
# Assert close
> nptest.assert_array_almost_equal(res.x,
np.array([0.44557958, 0.11209195, 0.22051994, -0.78051077, -0.01697192]))
E AssertionError:
E Arrays are not almost equal to 6 decimals
E
E Mismatched elements: 5 / 5 (100%)
E Max absolute difference: 0.90386561
E Max relative difference: 4.83483723
E x: array([-0.128437, 0.200391, 0.01928 , 0.123355, 0.065085])
E y: array([ 0.44558 , 0.112092, 0.22052 , -0.780511, -0.016972])
module/tests/update_matrices_test.py:87: AssertionError
__________________ update_matrices_tests.test_update_A_allind __________________
self = <module.tests.update_matrices_test.update_matrices_tests testMethod=test_update_A_allind>
def test_update_A_allind(self):
# Update matrix A
Ax = self.A_new.data
self.model.update(Ax=Ax)
res = self.model.solve()
# Assert close
> nptest.assert_array_almost_equal(res.x,
np.array([0.44557958, 0.11209195, 0.22051994, -0.78051077, -0.01697192]))
E AssertionError:
E Arrays are not almost equal to 6 decimals
E
E Mismatched elements: 5 / 5 (100%)
E Max absolute difference: 0.90386561
E Max relative difference: 4.83483723
E x: array([-0.128437, 0.200391, 0.01928 , 0.123355, 0.065085])
E y: array([ 0.44558 , 0.112092, 0.22052 , -0.780511, -0.016972])
module/tests/update_matrices_test.py:100: AssertionError
_____________________ update_matrices_tests.test_update_P ______________________
self = <module.tests.update_matrices_test.update_matrices_tests testMethod=test_update_P>
def test_update_P(self):
# Update matrix P
Px = self.P_new.data
Px_idx = np.arange(self.P_new.nnz)
self.model.update(Px=Px, Px_idx=Px_idx)
res = self.model.solve()
# Assert close
> nptest.assert_array_almost_equal(res.x,
np.array([0.79105808, 0.68008954, -0.00974931, -0.00569589, -0.92142316]))
E AssertionError:
E Arrays are not almost equal to 6 decimals
E
E Mismatched elements: 5 / 5 (100%)
E Max absolute difference: 2.03442876
E Max relative difference: 251.98743999
E x: array([-1.243371, -0.525746, 0.247115, 1.429597, 0.191722])
E y: array([ 0.791058, 0.68009 , -0.009749, -0.005696, -0.921423])
module/tests/update_matrices_test.py:60: AssertionError
_________________ update_matrices_tests.test_update_P_A_allind _________________
self = <module.tests.update_matrices_test.update_matrices_tests testMethod=test_update_P_A_allind>
def test_update_P_A_allind(self):
# Update matrices P and A
Px = self.P_new.data
Ax = self.A_new.data
self.model.update(Px=Px, Ax=Ax)
res = self.model.solve()
# Assert close
> nptest.assert_array_almost_equal(res.x,
np.array([0.45599336, 0.11471169, 0.22567378, -0.80654725, -0.01778191]))
E AssertionError:
E Arrays are not almost equal to 6 decimals
E
E Mismatched elements: 5 / 5 (100%)
E Max absolute difference: 0.95140325
E Max relative difference: 5.29813175
E x: array([-0.150824, 0.23532 , 0.02264 , 0.144856, 0.076429])
E y: array([ 0.455993, 0.114712, 0.225674, -0.806547, -0.017782])
module/tests/update_matrices_test.py:160: AssertionError
__________________ update_matrices_tests.test_update_P_A_indA __________________
self = <module.tests.update_matrices_test.update_matrices_tests testMethod=test_update_P_A_indA>
def test_update_P_A_indA(self):
# Update matrices P and A
Px = self.P_new.data
Ax = self.A_new.data
Ax_idx = np.arange(self.A_new.nnz)
self.model.update(Px=Px, Ax=Ax, Ax_idx=Ax_idx)
res = self.model.solve()
# Assert close
> nptest.assert_array_almost_equal(res.x,
np.array([0.45599336, 0.11471169, 0.22567378, -0.80654725, -0.01778191]))
E AssertionError:
E Arrays are not almost equal to 6 decimals
E
E Mismatched elements: 5 / 5 (100%)
E Max absolute difference: 0.95140325
E Max relative difference: 5.29813175
E x: array([-0.150824, 0.23532 , 0.02264 , 0.144856, 0.076429])
E y: array([ 0.455993, 0.114712, 0.225674, -0.806547, -0.017782])
module/tests/update_matrices_test.py:146: AssertionError
__________________ update_matrices_tests.test_update_P_A_indP __________________
self = <module.tests.update_matrices_test.update_matrices_tests testMethod=test_update_P_A_indP>
def test_update_P_A_indP(self):
# Update matrices P and A
Px = self.P_new.data
Px_idx = np.arange(self.P_new.nnz)
Ax = self.A_new.data
self.model.update(Px=Px, Px_idx=Px_idx, Ax=Ax)
res = self.model.solve()
# Assert close
> nptest.assert_array_almost_equal(res.x,
np.array([0.45599336, 0.11471169, 0.22567378, -0.80654725, -0.01778191]))
E AssertionError:
E Arrays are not almost equal to 6 decimals
E
E Mismatched elements: 5 / 5 (100%)
E Max absolute difference: 0.95140325
E Max relative difference: 5.29813175
E x: array([-0.150824, 0.23532 , 0.02264 , 0.144856, 0.076429])
E y: array([ 0.455993, 0.114712, 0.225674, -0.806547, -0.017782])
module/tests/update_matrices_test.py:131: AssertionError
_______________ update_matrices_tests.test_update_P_A_indP_indA ________________
self = <module.tests.update_matrices_test.update_matrices_tests testMethod=test_update_P_A_indP_indA>
def test_update_P_A_indP_indA(self):
# Update matrices P and A
Px = self.P_new.data
Px_idx = np.arange(self.P_new.nnz)
Ax = self.A_new.data
Ax_idx = np.arange(self.A_new.nnz)
self.model.update(Px=Px, Px_idx=Px_idx, Ax=Ax, Ax_idx=Ax_idx)
res = self.model.solve()
# Assert close
> nptest.assert_array_almost_equal(res.x,
np.array([0.45599336, 0.11471169, 0.22567378, -0.80654725, -0.01778191]))
E AssertionError:
E Arrays are not almost equal to 6 decimals
E
E Mismatched elements: 5 / 5 (100%)
E Max absolute difference: 0.95140325
E Max relative difference: 5.29813175
E x: array([-0.150824, 0.23532 , 0.02264 , 0.144856, 0.076429])
E y: array([ 0.455993, 0.114712, 0.225674, -0.806547, -0.017782])
module/tests/update_matrices_test.py:116: AssertionError
__________________ update_matrices_tests.test_update_P_allind __________________
self = <module.tests.update_matrices_test.update_matrices_tests testMethod=test_update_P_allind>
def test_update_P_allind(self):
# Update matrix P
Px = self.P_new.data
self.model.update(Px=Px)
res = self.model.solve()
# Assert close
> nptest.assert_array_almost_equal(res.x,
np.array([0.79105808, 0.68008954, -0.00974931, -0.00569589, -0.92142316]))
E AssertionError:
E Arrays are not almost equal to 6 decimals
E
E Mismatched elements: 5 / 5 (100%)
E Max absolute difference: 2.03442876
E Max relative difference: 251.98743999
E x: array([-1.243371, -0.525746, 0.247115, 1.429597, 0.191722])
E y: array([ 0.791058, 0.68009 , -0.009749, -0.005696, -0.921423])
module/tests/update_matrices_test.py:73: AssertionError
=============================== warnings summary ===============================
module/tests/polishing_test.py::polish_tests::test_polish_random
/build/osqp-0.6.1/module/tests/polishing_test.py:91: DeprecationWarning: scipy.randn is deprecated and will be removed in SciPy 2.0.0, use numpy.random.randn instead
Pt = sp.randn(self.n, self.n)
module/tests/polishing_test.py::polish_tests::test_polish_random
/build/osqp-0.6.1/module/tests/polishing_test.py:93: DeprecationWarning: scipy.randn is deprecated and will be removed in SciPy 2.0.0, use numpy.random.randn instead
self.q = sp.randn(self.n)
module/tests/polishing_test.py::polish_tests::test_polish_random
/build/osqp-0.6.1/module/tests/polishing_test.py:94: DeprecationWarning: scipy.randn is deprecated and will be removed in SciPy 2.0.0, use numpy.random.randn instead
self.A = sparse.csc_matrix(sp.randn(self.m, self.n))
module/tests/polishing_test.py::polish_tests::test_polish_random
/build/osqp-0.6.1/module/tests/polishing_test.py:95: DeprecationWarning: scipy.randn is deprecated and will be removed in SciPy 2.0.0, use numpy.random.randn instead
self.l = -3 + sp.randn(self.m)
module/tests/polishing_test.py::polish_tests::test_polish_random
/build/osqp-0.6.1/module/tests/polishing_test.py:96: DeprecationWarning: scipy.randn is deprecated and will be removed in SciPy 2.0.0, use numpy.random.randn instead
self.u = 3 + sp.randn(self.m)
module/tests/primal_infeasibility_test.py::primal_infeasibility_tests::test_primal_infeasible_problem
/build/osqp-0.6.1/module/tests/primal_infeasibility_test.py:38: DeprecationWarning: scipy.randn is deprecated and will be removed in SciPy 2.0.0, use numpy.random.randn instead
self.q = sp.randn(self.n)
module/tests/primal_infeasibility_test.py::primal_infeasibility_tests::test_primal_infeasible_problem
/build/osqp-0.6.1/module/tests/primal_infeasibility_test.py:40: DeprecationWarning: scipy.randn is deprecated and will be removed in SciPy 2.0.0, use numpy.random.randn instead
self.u = 3 + sp.randn(self.m)
module/tests/primal_infeasibility_test.py::primal_infeasibility_tests::test_primal_infeasible_problem
/build/osqp-0.6.1/module/tests/primal_infeasibility_test.py:41: DeprecationWarning: scipy.randn is deprecated and will be removed in SciPy 2.0.0, use numpy.random.randn instead
self.l = -3 + sp.randn(self.m)
module/tests/primal_infeasibility_test.py::primal_infeasibility_tests::test_primal_infeasible_problem
/build/osqp-0.6.1/module/tests/primal_infeasibility_test.py:45: DeprecationWarning: scipy.rand is deprecated and will be removed in SciPy 2.0.0, use numpy.random.rand instead
self.l[int(self.n/2)] = self.u[int(self.n/2)+1] + 10 * sp.rand()
module/tests/warm_start_test.py::warm_start_tests::test_warm_start
/build/osqp-0.6.1/module/tests/warm_start_test.py:32: DeprecationWarning: scipy.rand is deprecated and will be removed in SciPy 2.0.0, use numpy.random.rand instead
self.l = -sp.rand(self.m) * 2.
module/tests/warm_start_test.py::warm_start_tests::test_warm_start
/build/osqp-0.6.1/module/tests/warm_start_test.py:33: DeprecationWarning: scipy.rand is deprecated and will be removed in SciPy 2.0.0, use numpy.random.rand instead
self.u = sp.rand(self.m) * 2.
module/tests/warm_start_test.py::warm_start_tests::test_warm_start
/build/osqp-0.6.1/module/tests/warm_start_test.py:37: DeprecationWarning: scipy.randn is deprecated and will be removed in SciPy 2.0.0, use numpy.random.randn instead
self.q = sp.randn(self.n)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED module/tests/update_matrices_test.py::update_matrices_tests::test_solve
FAILED module/tests/update_matrices_test.py::update_matrices_tests::test_update_A
FAILED module/tests/update_matrices_test.py::update_matrices_tests::test_update_A_allind
FAILED module/tests/update_matrices_test.py::update_matrices_tests::test_update_P
FAILED module/tests/update_matrices_test.py::update_matrices_tests::test_update_P_A_allind
FAILED module/tests/update_matrices_test.py::update_matrices_tests::test_update_P_A_indA
FAILED module/tests/update_matrices_test.py::update_matrices_tests::test_update_P_A_indP
FAILED module/tests/update_matrices_test.py::update_matrices_tests::test_update_P_A_indP_indA
FAILED module/tests/update_matrices_test.py::update_matrices_tests::test_update_P_allind
=========== 9 failed, 39 passed, 1 deselected, 12 warnings in 5.75s ============