Skip to content

Commit a3c20be

Browse files
author
Matthias Koeppe
committed
sage.geometry: Use more block tags
1 parent 6770922 commit a3c20be

File tree

5 files changed

+46
-43
lines changed

5 files changed

+46
-43
lines changed

src/sage/geometry/cone.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2752,17 +2752,17 @@ def faces(self, dim=None, codim=None):
27522752
We also ensure that a call to this function does not break
27532753
:meth:`facets` method (see :trac:`9780`)::
27542754
2755-
sage: # needs palp
2756-
sage: cone = toric_varieties.dP8().fan().generating_cone(0); cone # needs sage.graphs
2755+
sage: # needs palp sage.graphs
2756+
sage: cone = toric_varieties.dP8().fan().generating_cone(0); cone
27572757
2-d cone of Rational polyhedral fan in 2-d lattice N
2758-
sage: for f in cone.facets(): print(f.rays()) # needs sage.graphs
2758+
sage: for f in cone.facets(): print(f.rays())
27592759
N(1, 1)
27602760
in 2-d lattice N
27612761
N(0, 1)
27622762
in 2-d lattice N
2763-
sage: len(cone.faces()) # needs sage.graphs
2763+
sage: len(cone.faces())
27642764
3
2765-
sage: for f in cone.facets(): print(f.rays()) # needs sage.graphs
2765+
sage: for f in cone.facets(): print(f.rays())
27662766
N(1, 1)
27672767
in 2-d lattice N
27682768
N(0, 1)

src/sage/geometry/integral_points.pxi

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -488,15 +488,16 @@ cpdef rectangular_box_points(list box_min, list box_max,
488488
489489
Using a PPL polyhedron::
490490
491-
sage: from ppl import Variable, Generator_System, C_Polyhedron, point # needs pplpy
492-
sage: gs = Generator_System() # needs pplpy
493-
sage: x = Variable(0); y = Variable(1); z = Variable(2) # needs pplpy
494-
sage: gs.insert(point(0*x + 1*y + 0*z)) # needs pplpy
495-
sage: gs.insert(point(0*x + 1*y + 3*z)) # needs pplpy
496-
sage: gs.insert(point(3*x + 1*y + 0*z)) # needs pplpy
497-
sage: gs.insert(point(3*x + 1*y + 3*z)) # needs pplpy
498-
sage: poly = C_Polyhedron(gs) # needs pplpy
499-
sage: rectangular_box_points([0]*3, [3]*3, poly) # needs pplpy
491+
sage: # needs pplpy
492+
sage: from ppl import Variable, Generator_System, C_Polyhedron, point
493+
sage: gs = Generator_System()
494+
sage: x = Variable(0); y = Variable(1); z = Variable(2)
495+
sage: gs.insert(point(0*x + 1*y + 0*z))
496+
sage: gs.insert(point(0*x + 1*y + 3*z))
497+
sage: gs.insert(point(3*x + 1*y + 0*z))
498+
sage: gs.insert(point(3*x + 1*y + 3*z))
499+
sage: poly = C_Polyhedron(gs)
500+
sage: rectangular_box_points([0]*3, [3]*3, poly)
500501
((0, 1, 0), (0, 1, 1), (0, 1, 2), (0, 1, 3), (1, 1, 0), (1, 1, 1), (1, 1, 2), (1, 1, 3),
501502
(2, 1, 0), (2, 1, 1), (2, 1, 2), (2, 1, 3), (3, 1, 0), (3, 1, 1), (3, 1, 2), (3, 1, 3))
502503
@@ -1131,16 +1132,17 @@ cdef class InequalityCollection:
11311132

11321133
EXAMPLES::
11331134

1134-
sage: from ppl import Variable, Generator_System, C_Polyhedron, point # needs pplpy
1135-
sage: gs = Generator_System() # needs pplpy
1136-
sage: x = Variable(0); y = Variable(1); z = Variable(2) # needs pplpy
1137-
sage: gs.insert(point(0*x + 0*y + 1*z)) # needs pplpy
1138-
sage: gs.insert(point(0*x + 3*y + 1*z)) # needs pplpy
1139-
sage: gs.insert(point(3*x + 0*y + 1*z)) # needs pplpy
1140-
sage: gs.insert(point(3*x + 3*y + 1*z)) # needs pplpy
1141-
sage: poly = C_Polyhedron(gs) # needs pplpy
1142-
sage: from sage.geometry.integral_points import InequalityCollection # needs pplpy
1143-
sage: InequalityCollection(poly, [0,2,1], [0]*3, [3]*3 ) # needs pplpy
1135+
sage: # needs pplpy
1136+
sage: from ppl import Variable, Generator_System, C_Polyhedron, point
1137+
sage: gs = Generator_System()
1138+
sage: x = Variable(0); y = Variable(1); z = Variable(2)
1139+
sage: gs.insert(point(0*x + 0*y + 1*z))
1140+
sage: gs.insert(point(0*x + 3*y + 1*z))
1141+
sage: gs.insert(point(3*x + 0*y + 1*z))
1142+
sage: gs.insert(point(3*x + 3*y + 1*z))
1143+
sage: poly = C_Polyhedron(gs)
1144+
sage: from sage.geometry.integral_points import InequalityCollection
1145+
sage: InequalityCollection(poly, [0,2,1], [0]*3, [3]*3 )
11441146
The collection of inequalities
11451147
integer: (0, 1, 0) x + -1 >= 0
11461148
integer: (0, -1, 0) x + 1 >= 0

src/sage/geometry/lattice_polytope.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3165,18 +3165,18 @@ def _palp_PM_max(self, check=False):
31653165
True
31663166
sage: P2 = ReflexivePolytope(2, 0)
31673167
sage: PM_max, permutations = P2._palp_PM_max(check=True) # needs sage.groups
3168-
sage: PM_max
3168+
sage: PM_max # needs sage.graphs
31693169
[3 0 0]
31703170
[0 3 0]
31713171
[0 0 3]
3172-
sage: list(permutations.values())
3172+
sage: list(permutations.values()) # needs sage.groups
31733173
[[(1,2,3), (1,2,3)],
31743174
[(1,3,2), (1,3,2)],
31753175
[(1,3), (1,3)],
31763176
[(1,2), (1,2)],
31773177
[(), ()],
31783178
[(2,3), (2,3)]]
3179-
sage: PM_max.automorphisms_of_rows_and_columns()
3179+
sage: PM_max.automorphisms_of_rows_and_columns() # needs sage.graphs
31803180
[((), ()),
31813181
((1,2,3), (1,2,3)),
31823182
((1,3,2), (1,3,2)),

src/sage/geometry/polyhedron/library.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1480,7 +1480,7 @@ def icosidodecahedron(self, exact=True, backend=None):
14801480
14811481
sage: id = polytopes.icosidodecahedron(exact=False); id # needs sage.groups sage.rings.number_field
14821482
A 3-dimensional polyhedron in RDF^3 defined as the convex hull of 30 vertices
1483-
sage: TestSuite(id).run(skip=["_test_is_combinatorially_isomorphic",
1483+
sage: TestSuite(id).run(skip=["_test_is_combinatorially_isomorphic", # needs sage.groups sage.rings.number_field
14841484
....: "_test_product",
14851485
....: "_test_pyramid",
14861486
....: "_test_lawrence"])

src/sage/geometry/toric_plotter.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
In most cases, this module is used indirectly, e.g. ::
1616
1717
sage: fan = toric_varieties.dP6().fan() # needs palp sage.graphs
18-
sage: fan.plot() # needs palp sage.plot
18+
sage: fan.plot() # needs palp sage.graphs sage.plot
1919
Graphics object consisting of 31 graphics primitives
2020
2121
You may change default plotting options as follows::
@@ -25,12 +25,12 @@
2525
sage: toric_plotter.options(show_rays=False)
2626
sage: toric_plotter.options("show_rays")
2727
False
28-
sage: fan.plot() # needs palp sage.plot
28+
sage: fan.plot() # needs palp sage.graphs sage.plot
2929
Graphics object consisting of 19 graphics primitives
3030
sage: toric_plotter.reset_options()
3131
sage: toric_plotter.options("show_rays")
3232
True
33-
sage: fan.plot() # needs palp sage.plot
33+
sage: fan.plot() # needs palp sage.graphs sage.plot
3434
Graphics object consisting of 31 graphics primitives
3535
"""
3636

@@ -135,9 +135,9 @@ class ToricPlotter(SageObject):
135135
plot, e.g. ::
136136
137137
sage: fan = toric_varieties.dP6().fan() # needs palp sage.graphs
138-
sage: fan.plot() # needs palp sage.plot
138+
sage: fan.plot() # needs palp sage.graphs sage.plot
139139
Graphics object consisting of 31 graphics primitives
140-
sage: print(fan.plot()) # needs palp sage.plot
140+
sage: print(fan.plot()) # needs palp sage.graphs sage.plot
141141
Graphics object consisting of 31 graphics primitives
142142
143143
If you do want to create your own plotting function for some toric
@@ -163,24 +163,25 @@ class ToricPlotter(SageObject):
163163
For example, the plot from the previous example can be obtained as
164164
follows::
165165
166+
sage: # needs palp sage.graphs sage.plot
166167
sage: from sage.geometry.toric_plotter import ToricPlotter
167168
sage: options = dict() # use default for everything
168-
sage: tp = ToricPlotter(options, fan.lattice().degree()) # needs palp
169-
sage: tp.include_points(fan.rays()) # needs palp
170-
sage: tp.adjust_options() # needs palp
171-
sage: tp.set_rays(fan.rays()) # needs palp
172-
sage: result = tp.plot_lattice() # needs palp sage.plot
173-
sage: result += tp.plot_rays() # needs palp sage.plot
174-
sage: result += tp.plot_generators() # needs palp sage.plot
175-
sage: result += tp.plot_walls(fan(2)) # needs palp sage.plot
176-
sage: result # needs palp sage.plot
169+
sage: tp = ToricPlotter(options, fan.lattice().degree())
170+
sage: tp.include_points(fan.rays())
171+
sage: tp.adjust_options()
172+
sage: tp.set_rays(fan.rays())
173+
sage: result = tp.plot_lattice()
174+
sage: result += tp.plot_rays()
175+
sage: result += tp.plot_generators()
176+
sage: result += tp.plot_walls(fan(2))
177+
sage: result
177178
Graphics object consisting of 31 graphics primitives
178179
179180
In most situations it is only necessary to include generators of rays, in
180181
this case they can be passed to the constructor as an optional argument.
181182
In the example above, the toric plotter can be completely set up using ::
182183
183-
sage: tp = ToricPlotter(options, fan.lattice().degree(), fan.rays()) # needs palp
184+
sage: tp = ToricPlotter(options, fan.lattice().degree(), fan.rays()) # needs palp sage.graphs sage.plot
184185
185186
All options are exposed as attributes of toric plotters and can be modified
186187
after constructions, however you will have to manually call

0 commit comments

Comments
 (0)