Skip to content

Commit ded1602

Browse files
committed
some cosmetics
1 parent d57488e commit ded1602

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/sage/geometry/polyhedron/parent.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def Polyhedra(ambient_space_or_base_ring=None, ambient_dim=None, backend=None, *
193193
return Polyhedra_field(base_ring.fraction_field(), ambient_dim, backend)
194194
else:
195195
raise ValueError('No such backend (=' + str(backend) +
196-
') implemented for given basering (=' + str(base_ring)+').')
196+
') implemented for given basering (=' + str(base_ring) + ').')
197197

198198

199199
class Polyhedra_base(UniqueRepresentation, Parent):
@@ -400,7 +400,7 @@ def some_elements(self):
400400
points = []
401401
R = self.base_ring()
402402
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())])
404404
return [
405405
self.element_class(self, [points[0:self.ambient_dim() + 1], [], []], None),
406406
self.element_class(self, [points[0:1], points[1:self.ambient_dim() + 1], []], None),
@@ -421,7 +421,7 @@ def zero(self):
421421
sage: p + p == p
422422
True
423423
"""
424-
Vrep = [[[self.base_ring().zero()]*self.ambient_dim()], [], []]
424+
Vrep = [[[self.base_ring().zero()] * self.ambient_dim()], [], []]
425425
return self.element_class(self, Vrep, None)
426426

427427
def empty(self):
@@ -454,7 +454,7 @@ def universe(self):
454454
True
455455
"""
456456
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)
458458

459459
@cached_method
460460
def Vrepresentation_space(self):
@@ -502,10 +502,9 @@ def Hrepresentation_space(self):
502502
"""
503503
if self.base_ring() in Fields():
504504
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)
509508

510509
def _repr_base_ring(self):
511510
"""
@@ -574,7 +573,7 @@ def _repr_(self):
574573
sage: Polyhedra(QQ, 3)._repr_()
575574
'Polyhedra in QQ^3'
576575
"""
577-
return 'Polyhedra in '+self._repr_ambient_module()
576+
return 'Polyhedra in ' + self._repr_ambient_module()
578577

579578
def _element_constructor_(self, *args, **kwds):
580579
"""
@@ -675,7 +674,7 @@ def convert_base_ring_Hrep(lstlst):
675674
if m == 0:
676675
newlstlst.append(lst)
677676
else:
678-
newlstlst.append([q/m for q in lst])
677+
newlstlst.append([q / m for q in lst])
679678
else:
680679
newlstlst.append(lst)
681680
return convert_base_ring(newlstlst)
@@ -900,14 +899,14 @@ def _coerce_base_ring(self, other):
900899
except TypeError:
901900
pass
902901
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.')
904903

905904
if not other_ring.is_exact():
906905
other_ring = RDF # the only supported floating-point numbers for now
907906

908907
cm_map, cm_ring = get_coercion_model().analyse(self.base_ring(), other_ring)
909908
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.')
911910
return cm_ring
912911

913912
def _coerce_map_from_(self, X):

0 commit comments

Comments
 (0)