Skip to content

Commit d253512

Browse files
author
Matthias Koeppe
committed
src/sage/geometry/polyhedron/backend_polymake.py: Style fixes
1 parent aa36e28 commit d253512

File tree

1 file changed

+28
-23
lines changed

1 file changed

+28
-23
lines changed

src/sage/geometry/polyhedron/backend_polymake.py

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ class Polyhedron_polymake(Polyhedron_base):
9696
9797
Quadratic fields work::
9898
99-
sage: V = polytopes.dodecahedron().vertices_list() # optional - sage.rings.number_field
100-
sage: Polyhedron(vertices=V, backend='polymake') # optional - jupymake # optional - sage.rings.number_field
99+
sage: V = polytopes.dodecahedron().vertices_list() # needs sage.rings.number_field
100+
sage: Polyhedron(vertices=V, backend='polymake') # optional - jupymake, needs sage.rings.number_field
101101
A 3-dimensional polyhedron
102102
in (Number Field in sqrt5 with defining polynomial x^2 - 5
103103
with sqrt5 = 2.236067977499790?)^3
@@ -211,11 +211,12 @@ def __init__(self, parent, Vrep, Hrep, polymake_polytope=None, **kwds):
211211
212212
TESTS:
213213
214-
sage: p = Polyhedron(backend='polymake') # optional - jupymake
215-
sage: TestSuite(p).run() # optional - jupymake
216-
sage: p = Polyhedron(vertices=[(1, 1)], rays=[(0, 1)], # optional - jupymake
214+
sage: # optional - jupymake
215+
sage: p = Polyhedron(backend='polymake')
216+
sage: TestSuite(p).run()
217+
sage: p = Polyhedron(vertices=[(1, 1)], rays=[(0, 1)],
217218
....: backend='polymake')
218-
sage: TestSuite(p).run() # optional - jupymake
219+
sage: TestSuite(p).run()
219220
220221
We skip the Lawrence test because it involves numerically unstable
221222
floating point arithmetic::
@@ -644,31 +645,35 @@ def __setstate__(self, state):
644645
645646
Test that the obtained cone is valid::
646647
647-
sage: from sage.geometry.polyhedron.backend_polymake import Polyhedron_polymake # optional - jupymake
648-
sage: P = polytopes.permutahedron(4, backend='polymake') # optional - jupymake
649-
sage: P1 = loads(dumps(P)) # optional - jupymake
650-
sage: P2 = Polyhedron_polymake(P1.parent(), None, None, P1._polymake_polytope) # optional - jupymake
651-
sage: P._test_polymake_pickling(other=P2) # optional - jupymake
648+
sage: # optional - jupymake
649+
sage: from sage.geometry.polyhedron.backend_polymake import Polyhedron_polymake
650+
sage: P = polytopes.permutahedron(4, backend='polymake')
651+
sage: P1 = loads(dumps(P))
652+
sage: P2 = Polyhedron_polymake(P1.parent(), None, None, P1._polymake_polytope)
653+
sage: P._test_polymake_pickling(other=P2)
652654
653-
sage: P = Polyhedron(lines=[[1,0], [0,1]], backend='polymake') # optional - jupymake
654-
sage: P1 = loads(dumps(P)) # optional - jupymake
655-
sage: P2 = Polyhedron_polymake(P1.parent(), None, None, P1._polymake_polytope) # optional - jupymake
656-
sage: P._test_polymake_pickling(other=P2) # optional - jupymake
655+
sage: # optional - jupymake
656+
sage: P = Polyhedron(lines=[[1,0], [0,1]], backend='polymake')
657+
sage: P1 = loads(dumps(P))
658+
sage: P2 = Polyhedron_polymake(P1.parent(), None, None, P1._polymake_polytope)
659+
sage: P._test_polymake_pickling(other=P2)
657660
658661
sage: P = Polyhedron(backend='polymake') # optional - jupymake
659662
sage: P1 = loads(dumps(P)) # optional - jupymake
660663
sage: P._test_polymake_pickling(other=P1) # optional - jupymake
661664
662-
sage: P = polytopes.permutahedron(4, backend='polymake') * Polyhedron(lines=[[1]], backend='polymake') # optional - jupymake
663-
sage: P1 = loads(dumps(P)) # optional - jupymake
664-
sage: P2 = Polyhedron_polymake(P1.parent(), None, None, P1._polymake_polytope) # optional - jupymake
665-
sage: P._test_polymake_pickling(other=P2) # optional - jupymake
665+
sage: # optional - jupymake
666+
sage: P = polytopes.permutahedron(4, backend='polymake') * Polyhedron(lines=[[1]], backend='polymake')
667+
sage: P1 = loads(dumps(P))
668+
sage: P2 = Polyhedron_polymake(P1.parent(), None, None, P1._polymake_polytope)
669+
sage: P._test_polymake_pickling(other=P2)
666670
667-
sage: print("Possible output"); P = polytopes.dodecahedron(backend='polymake') # optional - jupymake # optional - sage.rings.number_field
671+
sage: # optional - jupymake, needs sage.rings.number_field
672+
sage: print("Possible output"); P = polytopes.dodecahedron(backend='polymake')
668673
Possible output...
669-
sage: P1 = loads(dumps(P)) # optional - jupymake # optional - sage.rings.number_field
670-
sage: P2 = Polyhedron_polymake(P1.parent(), None, None, P1._polymake_polytope) # optional - jupymake # optional - sage.rings.number_field
671-
sage: P._test_polymake_pickling(other=P2) # optional - jupymake # optional - sage.rings.number_field
674+
sage: P1 = loads(dumps(P))
675+
sage: P2 = Polyhedron_polymake(P1.parent(), None, None, P1._polymake_polytope)
676+
sage: P._test_polymake_pickling(other=P2)
672677
"""
673678
if "_pickle_vertices" in state[1]:
674679
vertices = state[1].pop("_pickle_vertices")

0 commit comments

Comments
 (0)