def to_type_blocks(self) -> TypeBlocks: ''' Provide a correctly typed TypeBlocks representation. ''' depth_count = self.depth if depth_count == 0: return TypeBlocks.from_zero_size_shape() return TypeBlocks.from_blocks( self.values_at_depth(d) for d in range(depth_count))
def to_type_blocks(self) -> TypeBlocks: ''' Provide a correctly typed TypeBlocks representation. ''' try: depth_count = self.depth except StopIteration: # assume we have no depth or length return TypeBlocks.from_zero_size_shape() return TypeBlocks.from_blocks( self.values_at_depth(d) for d in range(depth_count))