Created
August 3, 2017 19:39
-
-
Save nicain/65dd4758590641af1f612827a4b467a2 to your computer and use it in GitHub Desktop.
extension_module_dataset_example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pynwb import NWBNamespaceBuilder, NWBDatasetSpec, NWBAttributeSpec | |
import numpy as np | |
from pynwb import get_class, load_namespaces | |
from datetime import datetime | |
from pynwb import NWBFile | |
from form.backends.hdf5 import HDF5IO | |
from pynwb import get_build_manager | |
ns_path = "mylab.namespace.yaml" | |
ext_source = "mylab.extensions.yaml" | |
nwb_as = NWBAttributeSpec('data', 'int', 'gid') | |
ns_builder = NWBNamespaceBuilder('Extension for use in my Lab', "mylab") | |
ext = NWBDatasetSpec('A custom TimeSeries for my lab', | |
attributes=[nwb_as], | |
dtype='float', | |
neurodata_type_inc='TimeSeries', | |
neurodata_type_def='PopulationSpikeTrain') | |
ns_builder.add_spec(ext_source, ext) | |
ns_builder.export(ns_path) | |
ns_path = "mylab.namespace.yaml" | |
load_namespaces(ns_path) |
Author
nicain
commented
Aug 3, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment