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

Commit

Permalink
Fix doctests for changed embedded numberfield repr
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Jun 19, 2019
1 parent 3d46bb2 commit 4258704
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/sage/geometry/polyhedron/backend_normaliz.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class Polyhedron_normaliz(Polyhedron_base):
sage: P = polytopes.icosahedron(exact=True, backend='normaliz') # optional - pynormaliz
sage: P # optional - pynormaliz
A 3-dimensional polyhedron in (Number Field in sqrt5 with defining polynomial x^2 - 5)^3 defined as the convex hull of 12 vertices
A 3-dimensional polyhedron in (Number Field in sqrt5 with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?)^3 defined as the convex hull of 12 vertices
sage: x = polygen(ZZ); P = Polyhedron(vertices=[[sqrt(2)], [AA.polynomial_root(x^3-2, RIF(0,3))]], backend='normaliz', verbose=True) # optional - pynormaliz
# ----8<---- Equivalent Normaliz input file ----8<----
Expand Down Expand Up @@ -651,7 +651,8 @@ def _compute_nmz_data_lists_and_field(self, data_lists, convert_QQ, convert_NF):
(([[1000]], [[500]]), Rational Field)
sage: p._compute_nmz_data_lists_and_field([[[AA(sqrt(2))]], [[1/2]]], # optional - pynormaliz
....: convert_QQ, convert_NF)
([[[a]], [[1/2]]], Number Field in a with defining polynomial y^2 - 2)
([[[a]], [[1/2]]],
Number Field in a with defining polynomial y^2 - 2 with a = 1.414213562373095?)
TESTS::
Expand Down
14 changes: 7 additions & 7 deletions src/sage/geometry/polyhedron/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ def buckyball(self, exact=True, base_ring=None, backend=None):
sage: bb.f_vector() # optional - pynormaliz
(1, 60, 90, 32, 1)
sage: bb.base_ring() # optional - pynormaliz
Number Field in sqrt5 with defining polynomial x^2 - 5
Number Field in sqrt5 with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?
"""
return self.icosahedron(exact=exact, base_ring=base_ring, backend=backend).truncation()
Expand Down Expand Up @@ -1151,7 +1151,7 @@ def icosidodecahedron(self, exact=True, backend=None):
sage: id.f_vector() # optional - pynormaliz
(1, 30, 60, 32, 1)
sage: id.base_ring() # optional - pynormaliz
Number Field in sqrt5 with defining polynomial x^2 - 5
Number Field in sqrt5 with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?
"""
from sage.rings.number_field.number_field import QuadraticField
from itertools import product
Expand Down Expand Up @@ -1223,7 +1223,7 @@ def icosidodecahedron_V2(self, exact=True, base_ring=None, backend=None):
sage: id.f_vector() # optional - pynormaliz
(1, 30, 60, 32, 1)
sage: id.base_ring() # optional - pynormaliz
Number Field in sqrt5 with defining polynomial x^2 - 5
Number Field in sqrt5 with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?
"""
if base_ring is None and exact:
Expand Down Expand Up @@ -1301,7 +1301,7 @@ def truncated_dodecahedron(self, exact=True, base_ring=None, backend=None):
sage: td.f_vector() # optional - pynormaliz
(1, 60, 90, 32, 1)
sage: td.base_ring() # optional - pynormaliz
Number Field in sqrt5 with defining polynomial x^2 - 5
Number Field in sqrt5 with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?
"""
if base_ring is None and exact:
Expand Down Expand Up @@ -1461,7 +1461,7 @@ def rhombicosidodecahedron(self, exact=True, base_ring=None, backend=None):
sage: rid.f_vector() # optional - pynormaliz
(1, 60, 120, 62, 1)
sage: rid.base_ring() # optional - pynormaliz
Number Field in sqrt5 with defining polynomial x^2 - 5
Number Field in sqrt5 with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?
"""
if base_ring is None and exact:
Expand Down Expand Up @@ -1538,7 +1538,7 @@ def truncated_icosidodecahedron(self, exact=True, base_ring=None, backend=None):
sage: ti.f_vector() # optional - pynormaliz
(1, 120, 180, 62, 1)
sage: ti.base_ring() # optional - pynormaliz
Number Field in sqrt5 with defining polynomial x^2 - 5
Number Field in sqrt5 with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?
"""
if base_ring is None and exact:
Expand Down Expand Up @@ -1785,7 +1785,7 @@ def grand_antiprism(self, exact=True, backend=None, verbose=False):
sage: gap = polytopes.grand_antiprism(exact=True, backend='normaliz') # optional - pynormaliz
sage: gap # optional - pynormaliz
A 4-dimensional polyhedron in (Number Field in sqrt5 with defining polynomial x^2 - 5)^4 defined as the convex hull of 100 vertices
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 100 vertices
"""
from itertools import product

Expand Down
2 changes: 1 addition & 1 deletion src/sage/geometry/polyhedron/parent.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def Polyhedra(base_ring, ambient_dim, backend=None):
sage: Polyhedra(QQ[I], 2)
Traceback (most recent call last):
...
ValueError: invalid base ring: Number Field in I with defining polynomial x^2 + 1 cannot be coerced to a real field
ValueError: invalid base ring: Number Field in I with defining polynomial x^2 + 1 with I = 1*I cannot be coerced to a real field
"""
if backend is None:
Expand Down

0 comments on commit 4258704

Please sign in to comment.