def pack_column_flat(self, value, components=None, offset=False):
        """
        TODO: add documentation
        """
        if components:
            if isinstance(components, str):
                components = [components]
            elif isinstance(components, list):
                components = components
            else:
                raise TypeError("components should be list or string, not {}".format(type(components)))
        elif isinstance(value, dict):
            components = value.keys()
        elif isinstance(value, list):
            components = self._dict.keys()
            value = {c: v for c,v in zip(components, value)}

        if offset:
            values = []
            offsetN = 0
            for c in components:
                values.append(value[c]+offsetN)
                offsetN += len(self[c]['vertices'])

        else:
            values = [value[c] for c in components]

        if len(value[components[0]].shape) > 1:
            return np.vstack(values)
        else:
            return np.hstack(values)
def pack_column_flat ( self , value , components = None , offset = False ) : if components : if isinstance ( components , str ) : components = [ components ] elif isinstance ( components , list ) : components = components else : raise TypeError ( "components should be list or string, not {}" . format ( type ( components ) ) ) elif isinstance ( value , dict ) : components = value . keys ( ) elif isinstance ( value , list ) : components = self . _dict . keys ( ) value = { c : v for c , v in zip ( components , value ) } if offset : values = [ ] offsetN = 0 for c in components : values . append ( value [ c ] + offsetN ) offsetN += len ( self [ c ] [ 'vertices' ] ) else : values = [ value [ c ] for c in components ] if len ( value [ components [ 0 ] ] . shape ) > 1 : return np . vstack ( values ) else : return np . hstack ( values )
TODO: add documentation