Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
removed pickling restriction on normaliz tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Kliem committed Dec 2, 2019
1 parent fc4c596 commit f42a4e2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 29 deletions.
21 changes: 9 additions & 12 deletions src/sage/geometry/polyhedron/backend_normaliz.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class Polyhedron_normaliz(Polyhedron_base):
sage: p = Polyhedron(vertices=[(0,0),(1,0),(0,1)], rays=[(1,1)], # optional - pynormaliz
....: lines=[], backend='normaliz')
sage: TestSuite(p).run(skip='_test_pickling') # optional - pynormaliz
sage: TestSuite(p).run() # optional - pynormaliz
Two ways to get the full space::
Expand Down Expand Up @@ -211,19 +211,16 @@ def __init__(self, parent, Vrep, Hrep, normaliz_cone=None, normaliz_data=None, n
See :class:`Polyhedron_normaliz` for a description of the input
data.
TESTS:
We skip the pickling test because pickling is currently
not implemented::
TESTS::
sage: p = Polyhedron(backend='normaliz') # optional - pynormaliz
sage: TestSuite(p).run(skip="_test_pickling") # optional - pynormaliz
sage: p = Polyhedron(vertices=[(1, 1)], rays=[(0, 1)], # optional - pynormaliz
sage: p = Polyhedron(backend='normaliz') # optional - pynormaliz
sage: TestSuite(p).run() # optional - pynormaliz
sage: p = Polyhedron(vertices=[(1, 1)], rays=[(0, 1)], # optional - pynormaliz
....: backend='normaliz')
sage: TestSuite(p).run(skip="_test_pickling") # optional - pynormaliz
sage: TestSuite(p).run() # optional - pynormaliz
sage: p = Polyhedron(vertices=[(-1,-1), (1,0), (1,1), (0,1)], # optional - pynormaliz
....: backend='normaliz')
sage: TestSuite(p).run(skip="_test_pickling") # optional - pynormaliz
s() # optional - pynormaliz
"""
if normaliz_cone:
if Hrep is not None or Vrep is not None or normaliz_data is not None:
Expand Down Expand Up @@ -1330,7 +1327,7 @@ class Polyhedron_QQ_normaliz(Polyhedron_normaliz, Polyhedron_QQ):
sage: p = Polyhedron(vertices=[(0,0),(1,0),(0,1)], # optional - pynormaliz
....: rays=[(1,1)], lines=[],
....: backend='normaliz', base_ring=QQ)
sage: TestSuite(p).run(skip='_test_pickling') # optional - pynormaliz
sage: TestSuite(p).run() # optional - pynormaliz
"""

def ehrhart_series(self, variable='t'):
Expand Down Expand Up @@ -1870,6 +1867,6 @@ class Polyhedron_ZZ_normaliz(Polyhedron_QQ_normaliz, Polyhedron_ZZ):
sage: p = Polyhedron(vertices=[(0,0),(1,0),(0,1)], # optional - pynormaliz
....: rays=[(1,1)], lines=[],
....: backend='normaliz', base_ring=ZZ)
sage: TestSuite(p).run(skip='_test_pickling') # optional - pynormaliz
sage: TestSuite(p).run() # optional - pynormaliz
"""
pass
34 changes: 17 additions & 17 deletions src/sage/geometry/polyhedron/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def Birkhoff_polytope(self, n, backend=None):
TESTS::
sage: b4norm = polytopes.Birkhoff_polytope(4,backend='normaliz') # optional - pynormaliz
sage: TestSuite(b4norm).run(skip='_test_pickling') # optional - pynormaliz
sage: TestSuite(b4norm).run() # optional - pynormaliz
"""
from itertools import permutations
verts = []
Expand Down Expand Up @@ -385,7 +385,7 @@ def simplex(self, dim=3, project=False, base_ring=None, backend=None):
TESTS::
sage: s6norm = polytopes.simplex(6,backend='normaliz') # optional - pynormaliz
sage: TestSuite(s6norm).run(skip='_test_pickling') # optional - pynormaliz
sage: TestSuite(s6norm).run() # optional - pynormaliz
"""
verts = list((ZZ**(dim + 1)).basis())
if project:
Expand Down Expand Up @@ -688,7 +688,7 @@ def rhombic_dodecahedron(self, backend=None):
TESTS::
sage: rd_norm = polytopes.rhombic_dodecahedron(backend='normaliz') # optional - pynormaliz
sage: TestSuite(rd_norm).run(skip='_test_pickling') # optional - pynormaliz
sage: TestSuite(rd_norm).run() # optional - pynormaliz
"""
v = [[2,0,0],[-2,0,0],[0,2,0],[0,-2,0],[0,0,2],[0,0,-2]]
v.extend((itertools.product([1, -1], repeat=3)))
Expand Down Expand Up @@ -735,7 +735,7 @@ def cuboctahedron(self, backend=None):
TESTS::
sage: co_norm = polytopes.cuboctahedron(backend='normaliz') # optional - pynormaliz
sage: TestSuite(co_norm).run(skip='_test_pickling') # optional - pynormaliz
sage: TestSuite(co_norm).run() # optional - pynormaliz
"""
v = [[0, -1, -1], [0, 1, -1], [0, -1, 1], [0, 1, 1],
[-1, -1, 0], [1, -1, 0], [-1, 1, 0], [1, 1, 0],
Expand Down Expand Up @@ -844,7 +844,7 @@ def tetrahedron(self, backend=None):
TESTS::
sage: t_norm = polytopes.tetrahedron(backend='normaliz') # optional - pynormaliz
sage: TestSuite(t_norm).run(skip='_test_pickling') # optional - pynormaliz
sage: TestSuite(t_norm).run() # optional - pynormaliz
"""
v = [[0, 0, 0], [1, 0, 1], [1, 1, 0], [0, 1, 1]]
return Polyhedron(vertices=v, base_ring=ZZ, backend=backend)
Expand Down Expand Up @@ -886,7 +886,7 @@ def truncated_tetrahedron(self, backend=None):
TESTS::
sage: tt_norm = polytopes.truncated_tetrahedron(backend='normaliz') # optional - pynormaliz
sage: TestSuite(tt_norm).run(skip='_test_pickling') # optional - pynormaliz
sage: TestSuite(tt_norm).run() # optional - pynormaliz
"""
v = [(3,1,1), (1,3,1), (1,1,3),
(-3,-1,1), (-1,-3,1), (-1,-1,3),
Expand Down Expand Up @@ -932,7 +932,7 @@ def truncated_octahedron(self, backend=None):
TESTS::
sage: to_norm = polytopes.truncated_octahedron(backend='normaliz') # optional - pynormaliz
sage: TestSuite(to_norm).run(skip='_test_pickling') # optional - pynormaliz
sage: TestSuite(to_norm).run() # optional - pynormaliz
"""
v = [(0, e, f) for e in [-1, 1] for f in [-2, 2]]
v = [(xyz[sigma(1) - 1], xyz[sigma(2) - 1], xyz[sigma(3) - 1])
Expand Down Expand Up @@ -974,7 +974,7 @@ def octahedron(self, backend=None):
TESTS::
sage: o_norm = polytopes.octahedron(backend='normaliz') # optional - pynormaliz
sage: TestSuite(o_norm).run(skip='_test_pickling') # optional - pynormaliz
sage: TestSuite(o_norm).run() # optional - pynormaliz
"""
v = [[0, 0, -1], [0, 0, 1], [1, 0, 0],
[-1, 0, 0], [0, 1, 0], [0, -1, 0]]
Expand Down Expand Up @@ -1424,7 +1424,7 @@ def Kirkman_icosahedron(self, backend=None):
TESTS::
sage: ki_norm = polytopes.Kirkman_icosahedron(backend='normaliz') # optional - pynormaliz
sage: TestSuite(ki_norm).run(skip='_test_pickling') # optional - pynormaliz
sage: TestSuite(ki_norm).run() # optional - pynormaliz
"""
vertices = [[9, 6, 6], [-9, 6, 6], [9, -6, 6], [9, 6, -6],
[-9, -6, 6], [-9, 6, -6], [9, -6, -6], [-9, -6, -6],
Expand Down Expand Up @@ -1697,7 +1697,7 @@ def twenty_four_cell(self, backend=None):
TESTS::
sage: tfcell = polytopes.twenty_four_cell(backend='normaliz') # optional - pynormaliz
sage: TestSuite(tfcell).run(skip='_test_pickling') # optional - pynormaliz
sage: TestSuite(tfcell).run() # optional - pynormaliz
"""
q12 = QQ((1, 2))
verts = list(itertools.product([q12, -q12], repeat=4))
Expand Down Expand Up @@ -2067,7 +2067,7 @@ def Gosset_3_21(self, backend=None):
TESTS::
sage: G321 = polytopes.Gosset_3_21(backend='normaliz') # optional - pynormaliz
sage: TestSuite(G321).run(skip='_test_pickling') # optional - pynormaliz
sage: TestSuite(G321).run() # optional - pynormaliz
"""
from itertools import combinations
verts = []
Expand Down Expand Up @@ -2107,7 +2107,7 @@ def cyclic_polytope(self, dim, n, base_ring=QQ, backend=None):
TESTS::
sage: cp = polytopes.cyclic_polytope(4,10,backend='normaliz') # optional - pynormaliz
sage: TestSuite(cp).run(skip='_test_pickling') # optional - pynormaliz
sage: TestSuite(cp).run() # optional - pynormaliz
"""
verts = [[t**i for i in range(1, dim+1)] for t in range(n)]
return Polyhedron(vertices=verts, base_ring=base_ring, backend=backend)
Expand Down Expand Up @@ -2211,7 +2211,7 @@ def permutahedron(self, n, project=False, backend=None):
TESTS::
sage: p4 = polytopes.permutahedron(4,backend='normaliz') # optional - pynormaliz
sage: TestSuite(p4).run(skip='_test_pickling') # optional - pynormaliz
sage: TestSuite(p4).run() # optional - pynormaliz
"""
verts = list(itertools.permutations(range(1, n + 1)))
if project:
Expand Down Expand Up @@ -2350,7 +2350,7 @@ def generalized_permutahedron(self, coxeter_type, point=None, exact=True, regula
TESTS::
sage: TestSuite(perm_h3).run(skip='_test_pickling') # optional - pynormaliz
sage: TestSuite(perm_h3).run() # optional - pynormaliz
"""
from sage.combinat.root_system.coxeter_group import CoxeterGroup
try:
Expand Down Expand Up @@ -2663,7 +2663,7 @@ def one_hundred_twenty_cell(self, exact=True, backend=None, construction='coxete
The ``'normaliz'`` is faster::
sage: polytopes.one_hundred_twenty_cell(backend='normaliz') # optional - pynormaliz
A 4-dimensional polyhedron in (Number Field in sqrt5 with defining
A 4-dimensional polyhedron in (Number Field in sqrt5 with defining
polynomial x^2 - 5 with sqrt5 = 2.236067977499790?)^4 defined as the convex hull of 600 vertices
It is also possible to realize it using the generalized permutahedron
Expand Down Expand Up @@ -2744,7 +2744,7 @@ def hypercube(self, dim, backend=None):
TESTS::
sage: fc = polytopes.hypercube(4,backend='normaliz') # optional - pynormaliz
sage: TestSuite(fc).run(skip='_test_pickling') # optional - pynormaliz
sage: TestSuite(fc).run() # optional - pynormaliz
"""
return Polyhedron(vertices=list(itertools.product([1, -1], repeat=dim)), base_ring=ZZ, backend=backend)

Expand Down Expand Up @@ -2804,7 +2804,7 @@ def cross_polytope(self, dim, backend=None):
TESTS::
sage: cp = polytopes.cross_polytope(4,backend='normaliz') # optional - pynormaliz
sage: TestSuite(cp).run(skip='_test_pickling') # optional - pynormaliz
sage: TestSuite(cp).run() # optional - pynormaliz
"""
verts = list((ZZ**dim).basis())
verts.extend([-v for v in verts])
Expand Down

0 comments on commit f42a4e2

Please sign in to comment.