How to use the pynwb.core.getargs function in pynwb

To help you get started, we’ve selected a few pynwb 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 NeurodataWithoutBorders / pynwb / src / pynwb / io / build / builders.py View on Github external
def set_link(self, **kwargs):
        """
        Add a link to this group
        """
        name, builder = getargs('name', 'builder', kwargs)
        self.__set_builder(name, builder, GroupBuilder.__link)
github NeurodataWithoutBorders / pynwb / src / pynwb / io / spec.py View on Github external
def get_attribute(self, **kwargs):
        name = getargs('name', kwargs)
        return self.__attributes.get(name)
github NeurodataWithoutBorders / pynwb / src / pynwb / ui / timeseries / feature.py View on Github external
def __init__(self, **kwargs):
        
        name, source, data = getargs('name', 'source', 'data', kwargs)
        super(AbstractFeatureSeries, self).__init__(name, source, data, "see 'feature_units'", **kwargs)
        self.features = getargs('features', kwargs)
        self.feature_units = getargs('feature_units', kwargs)
github NeurodataWithoutBorders / pynwb / src / pynwb / io / build / builders.py View on Github external
def set_attribute(self, **kwargs):
        """
        Set an attribute for this group.
        """
        name, value = getargs('name', 'value', kwargs)
        super().__getitem__(GroupBuilder.__attribute)[name] = value
        self.obj_type[name] = GroupBuilder.__attribute
github NeurodataWithoutBorders / pynwb / src / pynwb / io / build / builders.py View on Github external
def add_link(self, **kwargs):
        """
        Create a soft link and add it to this group.
        """
        name, path = getargs('name', 'path', kwargs)
        builder = LinkBuilder(path)
        self.set_link(name, builder)
        return builder
github NeurodataWithoutBorders / pynwb / src / pynwb / io / build / builders.py View on Github external
def set_dataset(self, **kwargs):
        """
        Add a dataset to this group
        """
        name, builder, = getargs('name', 'builder', kwargs)
        self.__set_builder(name, builder, GroupBuilder.__dataset)
github NeurodataWithoutBorders / pynwb / src / pynwb / io / build / builders.py View on Github external
def set_group(self, **kwargs):
        """
        Add a subgroup to this group
        """
        name, builder, = getargs('name', 'builder', kwargs)
        self.__set_builder(name, builder, GroupBuilder.__group)
github NeurodataWithoutBorders / pynwb / src / pynwb / io / spec.py View on Github external
def register_spec(cls, **kwargs):
        '''
        Associate a specified object type with an HDF5 specification
        '''
        obj_type, spec = getargs('obj_type', 'spec', kwargs)
        type_name = obj_type.__name__ if isinstance(obj_type, type) else obj_type
        if type_name in cls.__specs:
            raise ValueError("'%s' - cannot overwrite existing specification" % type_name)
        cls.__specs[type_name] = spec
github NeurodataWithoutBorders / pynwb / src / pynwb / io / spec.py View on Github external
def __init__(self, **kwargs):
        name, doc, parent, required, attributes, linkable, neurodata_type_def, neurodata_type = getargs('name', 'doc', 'parent', 'required', 'attributes', 'linkable', 'neurodata_type_def', 'neurodata_type', kwargs)
        if name == NAME_WILDCARD and neurodata_type_def is None and neurodata_type is None:
            raise ValueError("Cannot create Group or Dataset spec with wildcard name without specifying 'neurodata_type_def' and/or 'neurodata_type'")
        super().__init__(doc, name=name, required=required, parent=parent)
        self.__attributes = dict()
        if not linkable:
            self['linkable'] = linkable
        if neurodata_type is not None:
            self['neurodata_type'] = neurodata_type
        if neurodata_type_def is not None:
            self.pop('required', None)
            self['neurodata_type_def'] = neurodata_type_def
        for attribute in attributes:
            self.set_attribute(attribute)