src/pydap/handlers/pytables/__init__.py
def build_dataset(target, fp, node):
    """Recursively build a dataset, mapping groups to structures."""
    for node in fp.list_nodes(node):
        if isinstance(node, tables.Group):
            attrs = {k: node._v_attrs[k] for k in node._v_attrs._v_attrnames}
            target[node._v_name] = StructureType(node._v_name, attributes=get_attrs(node)
                    )
            build_dataset(target[node._v_name], fp, node,)
        elif isinstance(node, tables.Array):
            target[node._v_name] = BaseType(
                node._v_name, node, None, attributes=get_attrs(node))

        elif isinstance(node, tables.Table):
            table = node
            table_attrs = {k: v for k, v in get_attrs(node).items() if not _col_match_re.match(k)}
            sequence = target[node._v_name] = SequenceType(node._v_name, attributes=table_attrs)

            for name in table.colnames:
                col_attrs = dict(getattr(table.cols, name).attrs)
                sequence[name] = BaseType(name, table.coldtypes[name], attributes=col_attrs)
            sequence.data = node.read()
Recursively build a dataset, mapping groups to structures.
Recursively build a dataset, mapping groups to structures.
Recursively build a dataset mapping groups to structures .
def build_dataset(target, fp, node):
    for node in fp.list_nodes(node):
        if isinstance(node, tables.Group):
            attrs = {k: node._v_attrs[k] for k in node._v_attrs._v_attrnames}
            target[node._v_name] = StructureType(node._v_name, attributes=get_attrs(node)
                    )
            build_dataset(target[node._v_name], fp, node,)
        elif isinstance(node, tables.Array):
            target[node._v_name] = BaseType(
                node._v_name, node, None, attributes=get_attrs(node))
        elif isinstance(node, tables.Table):
            table = node
            table_attrs = {k: v for k, v in get_attrs(node).items() if not _col_match_re.match(k)}
            sequence = target[node._v_name] = SequenceType(node._v_name, attributes=table_attrs)
            for name in table.colnames:
                col_attrs = dict(getattr(table.cols, name).attrs)
                sequence[name] = BaseType(name, table.coldtypes[name], attributes=col_attrs)
            sequence.data = node.read()
def build_dataset ( target , fp , node ) : for node in fp . list_nodes ( node ) : if isinstance ( node , tables . Group ) : attrs = { k : node . _v_attrs [ k ] for k in node . _v_attrs . _v_attrnames } target [ node . _v_name ] = StructureType ( node . _v_name , attributes = get_attrs ( node ) ) build_dataset ( target [ node . _v_name ] , fp , node , ) elif isinstance ( node , tables . Array ) : target [ node . _v_name ] = BaseType ( node . _v_name , node , None , attributes = get_attrs ( node ) ) elif isinstance ( node , tables . Table ) : table = node table_attrs = { k : v for k , v in get_attrs ( node ) . items ( ) if not _col_match_re . match ( k ) } sequence = target [ node . _v_name ] = SequenceType ( node . _v_name , attributes = table_attrs ) for name in table . colnames : col_attrs = dict ( getattr ( table . cols , name ) . attrs ) sequence [ name ] = BaseType ( name , table . coldtypes [ name ] , attributes = col_attrs ) sequence . data = node . read ( )
Recursively build a dataset, mapping groups to structures.
Recursively build a dataset mapping groups to structures .
"""Recursively build a dataset, mapping groups to structures."""
target
fp
node