]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
mjo/cone/rearrangement.py: fix tests with PYTHONPATH="."
authorMichael Orlitzky <michael@orlitzky.com>
Thu, 1 Nov 2018 19:48:46 +0000 (15:48 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Thu, 1 Nov 2018 19:48:46 +0000 (15:48 -0400)
mjo/cone/rearrangement.py

index 38b5931d6b6f48ea6ed5517e01d255b8626e03b5..b32938117bbf176450d7aeefe246cbb5e6731361 100644 (file)
@@ -28,6 +28,10 @@ def rearrangement_cone(p,n):
     A polyhedral closed convex cone object representing a rearrangement
     cone of order ``p`` in ``n`` dimensions.
 
+    SETUP::
+
+        sage: from mjo.cone.rearrangement import rearrangement_cone
+
     EXAMPLES:
 
     The rearrangement cones of order one are nonnegative orthants::
@@ -119,6 +123,11 @@ def has_rearrangement_property(v, p):
     components sum to a nonnegative number), ``True`` is returned. Otherwise
     ``False`` is returned.
 
+    SETUP::
+
+        sage: from mjo.cone.rearrangement import (has_rearrangement_property,
+        ....:                                     rearrangement_cone)
+
     EXAMPLES:
 
     Every element of a rearrangement cone should have the property::
@@ -127,7 +136,8 @@ def has_rearrangement_property(v, p):
         ....:     for p in range(1, n-1):
         ....:         K = rearrangement_cone(p,n)
         ....:         v = K.random_element()
-        ....:         if not has_rearrangement_property(v,p): print v
+        ....:         if not has_rearrangement_property(v,p):
+        ....:             print(v)
 
     """
     components = sorted(v)[0:p]