Skip to content

Instantly share code, notes, and snippets.

@nicain
Created August 1, 2017 15:22
Show Gist options
  • Save nicain/cab4598c89738ac129d449c9bcb92bcc to your computer and use it in GitHub Desktop.
Save nicain/cab4598c89738ac129d449c9bcb92bcc to your computer and use it in GitHub Desktop.
Table Extension model Sandbox (debug)
from pynwb import NWBNamespaceBuilder, NWBGroupSpec, NWBAttributeSpec
from pynwb import get_class, load_namespaces
ns_path = "table.namespace.yaml"
ext_source = "table.extensions.yaml"
ns_builder = NWBNamespaceBuilder('A table namespace', "table")
ext = NWBGroupSpec('A table group',
neurodata_type_def='Table')
ns_builder.add_spec(ext_source, ext)
ns_builder.export(ns_path)
ns_path = "table.namespace.yaml"
load_namespaces(ns_path)
Table = get_class('Table', 'table')
@nicain
Copy link
Author

nicain commented Aug 1, 2017

Traceback (most recent call last):
  File "/Users/nicholasc/PycharmProjects/Sandbox/janelia_sandbox.py", line 17, in <module>
['table', 'core']
    Table = get_class('Table', 'table')
  File "/Users/nicholasc/Janelia_NWB_Hackathon/pynwb/src/form/utils.py", line 267, in func_call
    return func(**parsed['args'])
  File "/Users/nicholasc/Janelia_NWB_Hackathon/pynwb/src/pynwb/__init__.py", line 112, in get_class
    return __TYPE_MAP.create_container_cls(namespace, neurodata_type)
  File "/Users/nicholasc/Janelia_NWB_Hackathon/pynwb/src/form/utils.py", line 260, in func_call
    return func(self, **parsed['args'])
  File "/Users/nicholasc/Janelia_NWB_Hackathon/pynwb/src/form/build/map.py", line 672, in create_container_cls
    raise ValueError('No Container class found for parents of %s:%s %s' % (namespace, data_type, dt_hier))
ValueError: No Container class found for parents of table:Table ('Table',)```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment