@@ -285,7 +285,7 @@ def ehrhart_polynomial(self,engine=None,variable='t',verbose=False,
285285 EXAMPLES:
286286
287287 To start, we find the Ehrhart polynomial of a three-dimensional
288- ``simplex``, first using ``engine`` ='latte'. Leaving the engine
288+ ``simplex``, first using ``engine='latte'`` . Leaving the engine
289289 unspecified sets the ``engine`` to 'latte' by default::
290290
291291 sage: simplex = Polyhedron(vertices=[(0,0,0),(3,3,3),(-3,2,1),(1,-1,-2)])
@@ -355,7 +355,7 @@ def ehrhart_polynomial(self,engine=None,variable='t',verbose=False,
355355 if engine is None :
356356 # set default engine to latte
357357 engine = 'latte'
358- if engine is 'latte' :
358+ if engine == 'latte' :
359359 poly = self ._ehrhart_polynomial_latte (verbose , dual ,
360360 irrational_primal , irrational_all_primal , maxdet ,
361361 no_decomposition , compute_vertex_cones , smith_form ,
@@ -365,7 +365,7 @@ def ehrhart_polynomial(self,engine=None,variable='t',verbose=False,
365365 # TO DO: replace this change of variable by creating the appropriate
366366 # polynomial ring in the latte interface.
367367
368- elif engine is 'normaliz' :
368+ elif engine == 'normaliz' :
369369 return self ._ehrhart_polynomial_normaliz (variable )
370370 else :
371371 raise ValueError ("engine must be 'latte' or 'normaliz'" )
@@ -462,12 +462,13 @@ def ehrhart_quasipolynomial(self, variable='t', engine=None, verbose=False,
462462 3 dimensional permutahedron fixed by the reflection
463463 across the hyperplane `x_1 = x_4`::
464464
465- sage: subpoly = Polyhedron(vertices = [[3/2, 3, 4, 3/2],
465+ sage: verts = [[3/2, 3, 4, 3/2],
466466 ....: [3/2, 4, 3, 3/2],
467467 ....: [5/2, 1, 4, 5/2],
468468 ....: [5/2, 4, 1, 5/2],
469469 ....: [7/2, 1, 2, 7/2],
470- ....: [7/2, 2, 1, 7/2]], backend = 'normaliz') # optional - pynormaliz
470+ ....: [7/2, 2, 1, 7/2]]
471+ sage: subpoly = Polyhedron(vertices=verts, backend='normaliz') # optional - pynormaliz
471472 sage: eq = subpoly.ehrhart_quasipolynomial() # optional - pynormaliz
472473 sage: eq # optional - pynormaliz
473474 (4*t^2 + 3*t + 1, 4*t^2 + 2*t)
@@ -526,9 +527,9 @@ def ehrhart_quasipolynomial(self, variable='t', engine=None, verbose=False,
526527 if engine is None :
527528 # setting the default to 'normaliz'
528529 engine = 'normaliz'
529- if engine is 'normaliz' :
530+ if engine == 'normaliz' :
530531 return self ._ehrhart_quasipolynomial_normaliz (variable )
531- if engine is 'latte' :
532+ if engine == 'latte' :
532533 if any (not v .is_integral () for v in self .vertex_generator ()):
533534 raise TypeError ("the polytope has nonintegral vertices, the engine and backend of self should be 'normaliz'" )
534535 poly = self ._ehrhart_polynomial_latte (verbose , dual ,
@@ -562,12 +563,13 @@ def _ehrhart_quasipolynomial_normaliz(self, variable='t'):
562563 The subpolytope of the 3 dimensional permutahedron fixed by the
563564 reflection across the hyperplane `x_1 = x_4`::
564565
565- sage: subpoly = Polyhedron(vertices = [[3/2, 3, 4, 3/2],
566+ sage: verts = [[3/2, 3, 4, 3/2],
566567 ....: [3/2, 4, 3, 3/2],
567568 ....: [5/2, 1, 4, 5/2],
568569 ....: [5/2, 4, 1, 5/2],
569570 ....: [7/2, 1, 2, 7/2],
570- ....: [7/2, 2, 1, 7/2]], backend = 'normaliz') # optional - pynormaliz
571+ ....: [7/2, 2, 1, 7/2]]
572+ sage: subpoly = Polyhedron(vertices=verts, backend='normaliz') # optional - pynormaliz
571573 sage: eq = subpoly._ehrhart_quasipolynomial_normaliz() # optional - pynormaliz
572574 sage: eq # optional - pynormaliz
573575 (4*t^2 + 3*t + 1, 4*t^2 + 2*t)
0 commit comments