@@ -193,7 +193,7 @@ def Polyhedra(ambient_space_or_base_ring=None, ambient_dim=None, backend=None, *
193
193
return Polyhedra_field (base_ring .fraction_field (), ambient_dim , backend )
194
194
else :
195
195
raise ValueError ('No such backend (=' + str (backend ) +
196
- ') implemented for given basering (=' + str (base_ring )+ ').' )
196
+ ') implemented for given basering (=' + str (base_ring ) + ').' )
197
197
198
198
199
199
class Polyhedra_base (UniqueRepresentation , Parent ):
@@ -400,7 +400,7 @@ def some_elements(self):
400
400
points = []
401
401
R = self .base_ring ()
402
402
for i in range (self .ambient_dim () + 5 ):
403
- points .append ([R (i * j ^ 2 ) for j in range (self .ambient_dim ())])
403
+ points .append ([R (i * j ^ 2 ) for j in range (self .ambient_dim ())])
404
404
return [
405
405
self .element_class (self , [points [0 :self .ambient_dim () + 1 ], [], []], None ),
406
406
self .element_class (self , [points [0 :1 ], points [1 :self .ambient_dim () + 1 ], []], None ),
@@ -421,7 +421,7 @@ def zero(self):
421
421
sage: p + p == p
422
422
True
423
423
"""
424
- Vrep = [[[self .base_ring ().zero ()]* self .ambient_dim ()], [], []]
424
+ Vrep = [[[self .base_ring ().zero ()] * self .ambient_dim ()], [], []]
425
425
return self .element_class (self , Vrep , None )
426
426
427
427
def empty (self ):
@@ -454,7 +454,7 @@ def universe(self):
454
454
True
455
455
"""
456
456
R = self .base_ring ()
457
- return self (None , [[[R .one ()]+ [R .zero ()]* self .ambient_dim ()], []], convert = True )
457
+ return self (None , [[[R .one ()] + [R .zero ()] * self .ambient_dim ()], []], convert = True )
458
458
459
459
@cached_method
460
460
def Vrepresentation_space (self ):
@@ -502,10 +502,9 @@ def Hrepresentation_space(self):
502
502
"""
503
503
if self .base_ring () in Fields ():
504
504
from sage .modules .free_module import VectorSpace
505
- return VectorSpace (self .base_ring (), self .ambient_dim ()+ 1 )
506
- else :
507
- from sage .modules .free_module import FreeModule
508
- return FreeModule (self .base_ring (), self .ambient_dim ()+ 1 )
505
+ return VectorSpace (self .base_ring (), self .ambient_dim () + 1 )
506
+ from sage .modules .free_module import FreeModule
507
+ return FreeModule (self .base_ring (), self .ambient_dim () + 1 )
509
508
510
509
def _repr_base_ring (self ):
511
510
"""
@@ -574,7 +573,7 @@ def _repr_(self):
574
573
sage: Polyhedra(QQ, 3)._repr_()
575
574
'Polyhedra in QQ^3'
576
575
"""
577
- return 'Polyhedra in ' + self ._repr_ambient_module ()
576
+ return 'Polyhedra in ' + self ._repr_ambient_module ()
578
577
579
578
def _element_constructor_ (self , * args , ** kwds ):
580
579
"""
@@ -675,7 +674,7 @@ def convert_base_ring_Hrep(lstlst):
675
674
if m == 0 :
676
675
newlstlst .append (lst )
677
676
else :
678
- newlstlst .append ([q / m for q in lst ])
677
+ newlstlst .append ([q / m for q in lst ])
679
678
else :
680
679
newlstlst .append (lst )
681
680
return convert_base_ring (newlstlst )
@@ -900,14 +899,14 @@ def _coerce_base_ring(self, other):
900
899
except TypeError :
901
900
pass
902
901
if other_ring is None :
903
- raise TypeError ('Could not coerce ' + str ( other ) + ' into ZZ, QQ, or RDF.' )
902
+ raise TypeError (f 'Could not coerce { other } into ZZ, QQ, or RDF.' )
904
903
905
904
if not other_ring .is_exact ():
906
905
other_ring = RDF # the only supported floating-point numbers for now
907
906
908
907
cm_map , cm_ring = get_coercion_model ().analyse (self .base_ring (), other_ring )
909
908
if cm_ring is None :
910
- raise TypeError ('Could not coerce type ' + str ( other ) + ' into ZZ, QQ, or RDF.' )
909
+ raise TypeError (f 'Could not coerce type { other } into ZZ, QQ, or RDF.' )
911
910
return cm_ring
912
911
913
912
def _coerce_map_from_ (self , X ):
0 commit comments