@@ -308,7 +308,7 @@ def store_bdry(simplex, faces):
308308 new_data [dim ] = []
309309 for x in data :
310310 if not isinstance (x , Simplex ):
311- raise TypeError ("Each key in the data dictionary must be a simplex. " )
311+ raise TypeError ("each key in the data dictionary must be a simplex" )
312312 old_data_by_dim [x .dimension ()].append (x )
313313 old_delayed = {}
314314 for dim in range (dimension , - 1 , - 1 ):
@@ -338,7 +338,7 @@ def store_bdry(simplex, faces):
338338 current [bdry ] = store_bdry (bdry , bdry .faces ())
339339 new_data [dim ].append (current [bdry ])
340340 else :
341- raise ValueError ("In the data dictionary, there is a value which is a simplex not already in the dictionary. This is not allowed. " )
341+ raise ValueError ("in the data dictionary, there is a value which is a simplex not already in the dictionary" )
342342 elif isinstance (bdry , (list , tuple )):
343343 # case 2
344344 # boundary is a list or tuple
@@ -367,8 +367,8 @@ def store_bdry(simplex, faces):
367367 faces = new_data [d - 1 ]
368368 for j in range (d + 1 ):
369369 if not all (faces [s [j ]][i ] == faces [s [i ]][j - 1 ] for i in range (j )):
370- msg = "Simplicial identity d_i d_j = d_{j-1} d_i fails"
371- msg += " for j=%s, in dimension %s" % (j ,d )
370+ msg = "simplicial identity d_i d_j = d_{j-1} d_i fails"
371+ msg += " for j=%s, in dimension %s" % (j , d )
372372 raise ValueError (msg )
373373 # self._cells_dict: dictionary indexed by dimension d: for
374374 # each d, have list or tuple of simplices, and for each
@@ -557,7 +557,7 @@ def cells(self, subcomplex=None):
557557 cells [d ] = [None ]* l # get rid of all cells
558558 return cells
559559 else :
560- raise ValueError ("This is not a subcomplex of self. " )
560+ raise ValueError ("this is not a subcomplex of self" )
561561 else :
562562 subcomplex_cells = subcomplex ._is_subcomplex_of [self ]
563563 for d in range (0 , max (subcomplex_cells .keys ())+ 1 ):
@@ -919,7 +919,7 @@ def suspension(self, n=1):
919919 {0: 0, 1: 0, 2: 0, 3: Z}
920920 """
921921 if n < 0 :
922- raise ValueError ("n must be non-negative. " )
922+ raise ValueError ("n must be non-negative" )
923923 if n == 0 :
924924 return self
925925 if n == 1 :
@@ -1156,7 +1156,7 @@ def connected_sum(self, other):
11561156 Z x Z x C2
11571157 """
11581158 if not self .dimension () == other .dimension ():
1159- raise ValueError ("Complexes are not of the same dimension. " )
1159+ raise ValueError ("complexes are not of the same dimension" )
11601160 dim = self .dimension ()
11611161 # Look at the last simplex in the list of top-dimensional
11621162 # simplices for each complex. If there are identifications on
@@ -1487,9 +1487,9 @@ def barycentric_subdivision(self):
14871487 sage: K.barycentric_subdivision()
14881488 Traceback (most recent call last):
14891489 ...
1490- NotImplementedError: Barycentric subdivisions are not implemented for Delta complexes.
1490+ NotImplementedError: barycentric subdivisions are not implemented for Delta complexes
14911491 """
1492- raise NotImplementedError ("Barycentric subdivisions are not implemented for Delta complexes. " )
1492+ raise NotImplementedError ("barycentric subdivisions are not implemented for Delta complexes" )
14931493
14941494 def n_chains (self , n , base_ring = None , cochains = False ):
14951495 r"""
@@ -1666,7 +1666,8 @@ def Torus(self):
16661666 sage: delta_complexes.Torus().homology(1)
16671667 Z x Z
16681668 """
1669- return DeltaComplex (( ((),), ((0 ,0 ), (0 ,0 ), (0 ,0 )), ((1 ,2 ,0 ), (0 , 2 , 1 ))))
1669+ return DeltaComplex ((((),), ((0 , 0 ), (0 , 0 ), (0 , 0 )),
1670+ ((1 , 2 , 0 ), (0 , 2 , 1 ))))
16701671
16711672 def RealProjectivePlane (self ):
16721673 r"""
@@ -1687,7 +1688,8 @@ def RealProjectivePlane(self):
16871688 sage: P.cohomology(dim=2, base_ring=GF(2))
16881689 Vector space of dimension 1 over Finite Field of size 2
16891690 """
1690- return DeltaComplex (( ((), ()), ((1 ,0 ), (1 ,0 ), (0 ,0 )), ((1 ,0 ,2 ), (0 ,1 ,2 ))))
1691+ return DeltaComplex ((((), ()), ((1 , 0 ), (1 , 0 ), (0 , 0 )),
1692+ ((1 , 0 , 2 ), (0 , 1 , 2 ))))
16911693
16921694 def KleinBottle (self ):
16931695 r"""
@@ -1701,7 +1703,8 @@ def KleinBottle(self):
17011703 sage: delta_complexes.KleinBottle()
17021704 Delta complex with 1 vertex and 7 simplices
17031705 """
1704- return DeltaComplex (( ((),), ((0 ,0 ), (0 ,0 ), (0 ,0 )), ((1 ,2 ,0 ), (0 , 1 , 2 ))))
1706+ return DeltaComplex ((((),), ((0 , 0 ), (0 , 0 ), (0 , 0 )),
1707+ ((1 , 2 , 0 ), (0 , 1 , 2 ))))
17051708
17061709 def Simplex (self , n ):
17071710 r"""
@@ -1770,8 +1773,9 @@ def SurfaceOfGenus(self, g, orientable=True):
17701773 else :
17711774 X = delta_complexes .RealProjectivePlane ()
17721775 S = X
1773- for i in range (g - 1 ):
1776+ for i in range (g - 1 ):
17741777 S = S .connected_sum (X )
17751778 return S
17761779
1780+
17771781delta_complexes = DeltaComplexExamples ()
0 commit comments