@@ -358,7 +358,7 @@ def __init__(self, *cells: Cell):
358
358
if not isinstance (self ._tdim , numbers .Integral ):
359
359
raise ValueError ("Expecting integer topological_dimension." )
360
360
361
- def sub_cells (self ) -> typing .List [AbstractCell ]:
361
+ def sub_cells (self ) -> typing .Tuple [AbstractCell , ... ]:
362
362
"""Return list of cell factors."""
363
363
return self ._cells
364
364
@@ -398,21 +398,21 @@ def num_sub_entities(self, dim: int) -> int:
398
398
def sub_entities (self , dim : int ) -> typing .Tuple [AbstractCell , ...]:
399
399
"""Get the sub-entities of the given dimension."""
400
400
if dim < 0 or dim > self ._tdim :
401
- return []
401
+ return ()
402
402
if dim == 0 :
403
- return [ Cell ("vertex" ) for i in range (self .num_sub_entities (0 ))]
403
+ return tuple ( Cell ("vertex" ) for i in range (self .num_sub_entities (0 )))
404
404
if dim == self ._tdim :
405
- return [ self ]
405
+ return ( self ,)
406
406
raise NotImplementedError (f"TensorProductCell.sub_entities({ dim } ) is not implemented." )
407
407
408
408
def sub_entity_types (self , dim : int ) -> typing .Tuple [AbstractCell , ...]:
409
409
"""Get the unique sub-entity types of the given dimension."""
410
410
if dim < 0 or dim > self ._tdim :
411
- return []
411
+ return ()
412
412
if dim == 0 :
413
- return [ Cell ("vertex" )]
413
+ return ( Cell ("vertex" ),)
414
414
if dim == self ._tdim :
415
- return [ self ]
415
+ return ( self ,)
416
416
raise NotImplementedError (f"TensorProductCell.sub_entities({ dim } ) is not implemented." )
417
417
418
418
def _lt (self , other ) -> bool :
@@ -434,7 +434,7 @@ def _ufl_hash_data_(self) -> typing.Hashable:
434
434
"""UFL hash data."""
435
435
return tuple (c ._ufl_hash_data_ () for c in self ._cells )
436
436
437
- def reconstruct (self , ** kwargs : typing .Any ) -> Cell :
437
+ def reconstruct (self , ** kwargs : typing .Any ) -> Cell | TensorProductCell :
438
438
"""Reconstruct this cell, overwriting properties by those in kwargs."""
439
439
for key , value in kwargs .items ():
440
440
raise TypeError (f"reconstruct() got unexpected keyword argument '{ key } '" )
0 commit comments