How to use the deepdish.io.ls.SimpleNamespaceNode function in deepdish

To help you get started, we’ve selected a few deepdish examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github uchicago-cs / deepdish / deepdish / io / ls.py View on Github external
def _tree_level(level, raw=False, settings={}):
    if isinstance(level, tables.Group):
        if _sns and (level._v_title.startswith('SimpleNamespace:') or
                     DEEPDISH_IO_ROOT_IS_SNS in level._v_attrs):
            node = SimpleNamespaceNode()
        else:
            node = DictNode()

        for grp in level:
            node.add(grp._v_name, _tree_level(grp, raw=raw, settings=settings))

        for name in level._v_attrs._f_list():
            v = level._v_attrs[name]
            if name == DEEPDISH_IO_VERSION_STR:
                node.header['dd_io_version'] = v

            if name == DEEPDISH_IO_UNPACK:
                node.header['dd_io_unpack'] = v

            if name.startswith(DEEPDISH_IO_PREFIX):
                continue