From: Michael Orlitzky Date: Thu, 1 Nov 2018 19:48:46 +0000 (-0400) Subject: mjo/cone/rearrangement.py: fix tests with PYTHONPATH="." X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=79ccdd5a7774973c0905f7cc09271e80300baece;p=sage.d.git mjo/cone/rearrangement.py: fix tests with PYTHONPATH="." --- diff --git a/mjo/cone/rearrangement.py b/mjo/cone/rearrangement.py index 38b5931..b329381 100644 --- a/mjo/cone/rearrangement.py +++ b/mjo/cone/rearrangement.py @@ -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]