]> gitweb.michael.orlitzky.com - dunshire.git/blobdiff - src/dunshire/games.py
Clean up a bit of the import mess.
[dunshire.git] / src / dunshire / games.py
index 2cf23b25c9827199d7790a944f6ebf9aec76c188..05ab58cd702c5570221184ed47f5bb16289627c0 100644 (file)
@@ -12,11 +12,11 @@ from unittest import TestCase
 
 # These are mostly actually needed.
 from cvxopt import matrix, printing, solvers
-from cones import CartesianProduct, IceCream, NonnegativeOrthant
-from errors import GameUnsolvableException
-from matrices import (append_col, append_row, eigenvalues_re, identity,
-                      inner_product, norm)
-import options
+from .cones import CartesianProduct, IceCream, NonnegativeOrthant
+from .errors import GameUnsolvableException
+from .matrices import (append_col, append_row, eigenvalues_re, identity,
+                       inner_product, norm)
+from . import options
 
 printing.options['dformat'] = options.FLOAT_FORMAT
 solvers.options['show_progress'] = options.VERBOSE
@@ -211,7 +211,6 @@ class SymmetricLinearGame:
     Examples
     --------
 
-        >>> from cones import NonnegativeOrthant
         >>> K = NonnegativeOrthant(3)
         >>> L = [[1,-5,-15],[-1,2,-3],[-12,-15,1]]
         >>> e1 = [1,1,1]
@@ -232,7 +231,6 @@ class SymmetricLinearGame:
 
     Lists can (and probably should) be used for every argument::
 
-        >>> from cones import NonnegativeOrthant
         >>> K = NonnegativeOrthant(2)
         >>> L = [[1,0],[0,1]]
         >>> e1 = [1,1]
@@ -254,7 +252,6 @@ class SymmetricLinearGame:
 
         >>> import cvxopt
         >>> import numpy
-        >>> from cones import NonnegativeOrthant
         >>> K = NonnegativeOrthant(2)
         >>> L = [[1,0],[0,1]]
         >>> e1 = cvxopt.matrix([1,1])
@@ -275,7 +272,6 @@ class SymmetricLinearGame:
     otherwise indexed by columns::
 
         >>> import cvxopt
-        >>> from cones import NonnegativeOrthant
         >>> K = NonnegativeOrthant(2)
         >>> L = [[1,2],[3,4]]
         >>> e1 = [1,1]
@@ -364,7 +360,6 @@ class SymmetricLinearGame:
         This example is computed in Gowda and Ravindran in the section
         "The value of a Z-transformation"::
 
-            >>> from cones import NonnegativeOrthant
             >>> K = NonnegativeOrthant(3)
             >>> L = [[1,-5,-15],[-1,2,-3],[-12,-15,1]]
             >>> e1 = [1,1,1]
@@ -384,7 +379,6 @@ class SymmetricLinearGame:
         The value of the following game can be computed using the fact
         that the identity is invertible::
 
-            >>> from cones import NonnegativeOrthant
             >>> K = NonnegativeOrthant(3)
             >>> L = [[1,0,0],[0,1,0],[0,0,1]]
             >>> e1 = [1,2,3]
@@ -475,7 +469,6 @@ class SymmetricLinearGame:
         Examples
         --------
 
-            >>> from cones import NonnegativeOrthant
             >>> K = NonnegativeOrthant(3)
             >>> L = [[1,-5,-15],[-1,2,-3],[-12,-15,1]]
             >>> e1 = [1,1,1]