]> gitweb.michael.orlitzky.com - dunshire.git/blobdiff - TODO
Overhaul the tests to get more predictable behavior.
[dunshire.git] / TODO
diff --git a/TODO b/TODO
index 76c435875bdae09d370839976c70c749c8cd9025..095818a9623983e2fb36ca2a6582eaad4e0703bb 100644 (file)
--- a/TODO
+++ b/TODO
-1. Add unit testing for crazier things like random invertible matrices.
+1. Make it work on a cartesian product of cones in the correct order.
 
-2. Copy the intro from my thesis into README.rst, and add a section
-   explaining the CVXOPT formulation.
+2. Make it work on a cartesian product of cones in the wrong order
+   (apply a perm utation before/after).
 
-3. Try to eliminate the code in matrices.py.
+3. Make sure we have the dimensions of the PSD cone correct.
 
-4. Make it work on a cartesian product of cones in the correct order.
+4. Come up with a fast heuristic (like making nu huge and taking e1 as
+   our point) that finds a primal feasible point.
 
-5. Make it work on a cartesian product of cones in the wrong order
-   (apply a perm utation before/after).
+5. Fix the solve failures that we get in the translation tests. For example,
 
-6. Rename all of my variables so that they don't conflict with CVXOPT.
-   Maybe x -> xi and y -> gamma in my paper, if that works out.
+  ERROR: test_translation_orthant (test.symmetric_linear_game_test.
+                                   SymmetricLinearGameTest)
+  ----------------------------------------------------------------------
+  Traceback (most recent call last):
+    File "/home/mjo/src/dunshire/test/symmetric_linear_game_test.py",
+    line 374, in test_translation_orthant
+      self.assert_translation_works(L, K, e1, e2)
+    File "/home/mjo/src/dunshire/test/symmetric_linear_game_test.py",
+      line 361, in assert_translation_works
+      value2 = game2.solution().game_value()
+    File "/home/mjo/src/dunshire/dunshire/games.py", line 458, in solution
+      raise GameUnsolvableException(self, soln_dict)
+  dunshire.errors.GameUnsolvableException: Solution failed with result
+  "unknown."
+  The linear game (L, K, e1, e2) where
+    L = [352.0763359 267.0812248 300.8004888 307.8135853]
+       [429.8303135 324.8322824 361.6866231 372.1748983]
+       [390.6592961 286.8039007 320.7409227 330.1854235]
+       [316.0538913 247.7440818 276.9063990 274.9871772],
+    K = Nonnegative orthant in the real 4-space,
+    e1 = [7.7040001]
+        [9.4324457]
+        [8.3882819]
+        [6.8908420],
+    e2 = [8.5054325]
+        [6.4738132]
+        [7.2452437]
+        [7.3307357].
+  CVXOPT returned:
+    dual infeasibility: 0.053819211766446585
+    dual objective: -5.369636805607942
+    dual slack: 2.105806354638527e-17
+    gap: 2.6823510532777825e-16
+    iterations: 11
+    primal infeasibility: 4.71536776301359e-15
+    primal objective: -5.3799616179161
+    primal slack: 1.0328930392495263e-17
+    relative gap: 4.985818196816016e-17
+    residual as dual infeasibility certificate: 0.18587493201993227
+    residual as primal infeasibility certificate: None
+    s:
+      [0.0115539]
+      [0.0000000]
+      [0.0000000]
+      [0.1230066]
+      [0.4837410]
+      [0.0000000]
+      [0.0000000]
+      [0.4044349]
+    status: unknown
+    x:
+      [ 5.3799616]
+      [ 0.0115539]
+      [-0.0000000]
+      [-0.0000000]
+      [ 0.1230066]
+    y:
+      [5.3696368]
+    z:
+      [0.0000000]
+      [0.4176330]
+      [0.6007564]
+      [0.0000000]
+      [0.0000000]
+      [0.0889310]
+      [0.0191076]
+      [0.0000000]
 
-7. Make sure we have the dimensions of the PSD cone correct.
 
-8. Come up with a fast heuristic (like making nu huge and taking e1 as
-   our point) that finds a primal feasible point.
+6. Fix the math domain errors that sometimes pop up:
+
+  ERROR: test_scaling_icecream (test.symmetric_linear_game_test
+                                .SymmetricLinearGameTest)
+  ----------------------------------------------------------------------
+  Traceback (most recent call last):
+    File "/home/mjo/src/dunshire/test/symmetric_linear_game_test.py",
+    line 336, in test_scaling_icecream
+      self.assert_scaling_works(L, K, e1, e2)
+    File "/home/mjo/src/dunshire/test/symmetric_linear_game_test.py",
+    line 317, in assert_scaling_works
+      value2 = game2.solution().game_value()
+    File "/home/mjo/src/dunshire/dunshire/games.py", line 428, in solution
+      soln_dict = solvers.conelp(c, G, h, C.cvxopt_dims(), A, b)
+    File "/usr/lib64/python3.4/site-packages/cvxopt/coneprog.py", line 1395,
+    in conelp
+      misc.update_scaling(W, lmbda, ds, dz)
+    File "/usr/lib64/python3.4/site-packages/cvxopt/misc.py", line 510,
+    in update_scaling
+      ln = jnrm2(lmbda, n = m, offset = ind)
+    File "/usr/lib64/python3.4/site-packages/cvxopt/misc.py", line 856, in jnrm2
+      return math.sqrt(x[offset] - a) * math.sqrt(x[offset] + a)
+  ValueError: math domain error
+
+
+7. Figure out why this happens, too:
+
+  FAIL: test_scaling_icecream (test.symmetric_linear_game_test
+                               .SymmetricLinearGameTest)
+  ----------------------------------------------------------------------
+  Traceback (most recent call last):
+    File "/home/mjo/src/dunshire/test/symmetric_linear_game_test.py",
+    line 336, in test_scaling_icecream
+      self.assert_scaling_works(L, K, e1, e2)
+    File "/home/mjo/src/dunshire/test/symmetric_linear_game_test.py",
+    line 318, in assert_scaling_works
+      self.assert_within_tol(alpha*value1, value2)
+    File "/home/mjo/src/dunshire/test/symmetric_linear_game_test.py",
+    line 254, in assert_within_tol
+      self.assertTrue(abs(first - second) < options.ABS_TOL)
+  AssertionError: False is not true
+
+
+  FAIL: test_translation_orthant (test.symmetric_linear_game_test
+                                  SymmetricLinearGameTest)
+  ----------------------------------------------------------------------
+  Traceback (most recent call last):
+    File "/home/mjo/src/dunshire/test/symmetric_linear_game_test.py",
+    line 374, in test_translation_orthant
+      self.assert_translation_works(L, K, e1, e2)
+    File "/home/mjo/src/dunshire/test/symmetric_linear_game_test.py",
+    line 366, in assert_translation_works
+      self.assert_within_tol(value2, inner_product(M*x_bar, y_bar))
+    File "/home/mjo/src/dunshire/test/symmetric_linear_game_test.py",
+    line 254, in assert_within_tol
+      self.assertTrue(abs(first - second) < options.ABS_TOL)
+  AssertionError: False is not true
+
+
+8. Fix floating point comparisons in the doctest output.
+
+9. Use shebang in the standalone test executable.
+
+10. Sometimes our Lyapunov-like tests over the ice cream cone are
+    failing badly. For example,
+
+  FAIL: test_lyapunov_icecream (test.symmetric_linear_game_test
+                                .SymmetricLinearGameTest)
+  ----------------------------------------------------------------------
+  Traceback (most recent call last):
+    File "/home/mjo/src/dunshire/test/symmetric_linear_game_test.py",
+    line 620, in test_lyapunov_icecream
+      self.assert_lyapunov_works(G)
+    File "/home/mjo/src/dunshire/test/symmetric_linear_game_test.py",
+    line 578, in assert_lyapunov_works
+      self.assertTrue(negative_stable)
+  AssertionError: False is not true
+
 
-9. We only need to include the API docs for dunshire.games in the
-   "user manual;" everything else can go in an appendix.
+    We should have a matrix L that is negative stable, but its eigenvalues
+    are actually,
 
-10. The ice cream cone tests sometimes fail with "unknown" solution.
+      [0.8991268260361707,
+       0.8991268260361707,
+       -1.4648148562918966,
+       3.2630685083642352,
+       0.8991268260361712]