pynwb.spec module¶
-
class
pynwb.spec.
NWBRefSpec
(target_type, reftype)[source]¶ Bases:
hdmf.spec.spec.RefSpec
Parameters:
-
class
pynwb.spec.
NWBAttributeSpec
(name, doc, dtype, shape=None, dims=None, required=True, parent=None, value=None, default_value=None)[source]¶ Bases:
hdmf.spec.spec.AttributeSpec
Parameters: - name (
str
) – The name of this attribute - doc (
str
) – a description about what this specification represents - dtype (
str
orRefSpec
) – The data type of this attribute - shape (
list
ortuple
) – the shape of this dataset - dims (
list
ortuple
) – the dimensions of this dataset - required (
bool
) – whether or not this attribute is required. ignored when “value” is specified - parent (BaseStorageSpec) – the parent of this spec
- value (None) – a constant value for this attribute
- default_value (None) – a default value for this attribute
- name (
-
class
pynwb.spec.
NWBLinkSpec
(doc, target_type, quantity=1, name=None)[source]¶ Bases:
hdmf.spec.spec.LinkSpec
Parameters: -
neurodata_type_inc
¶ The neurodata type of target specification
-
-
class
pynwb.spec.
BaseStorageOverride
[source]¶ Bases:
object
This class is used for the purpose of overriding BaseStorageSpec classmethods, without creating diamond inheritance hierarchies.
-
neurodata_type_inc
¶
-
neurodata_type_def
¶
-
-
class
pynwb.spec.
NWBDtypeSpec
(name, doc, dtype)[source]¶ Bases:
hdmf.spec.spec.DtypeSpec
Parameters:
-
class
pynwb.spec.
NWBDatasetSpec
(doc, dtype=None, name=None, default_name=None, shape=None, dims=None, attributes=[], linkable=True, quantity=1, default_value=None, neurodata_type_def=None, neurodata_type_inc=None)[source]¶ Bases:
pynwb.spec.BaseStorageOverride
,hdmf.spec.spec.DatasetSpec
The Spec class to use for NWB specifications
Parameters: - doc (
str
) – a description about what this specification represents - dtype (
str
orlist
orRefSpec
) – The data type of this attribute. Use a list of DtypeSpecs to specify a compound data type. - name (
str
) – The name of this dataset - default_name (
str
) – The default name of this dataset - shape (
list
ortuple
) – the shape of this dataset - dims (
list
ortuple
) – the dimensions of this dataset - attributes (
list
) – the attributes on this group - linkable (
bool
) – whether or not this group can be linked - quantity (
str
orint
) – the required number of allowed instance - default_value (None) – a default value for this dataset
- neurodata_type_def (
str
) – the NWB data type this spec defines - neurodata_type_inc (NWBDatasetSpec or
str
) – the NWB data type this spec includes
- doc (
-
class
pynwb.spec.
NWBGroupSpec
(doc, name=None, default_name=None, groups=[], datasets=[], attributes=[], links=[], linkable=True, quantity=1, neurodata_type_def=None, neurodata_type_inc=None)[source]¶ Bases:
pynwb.spec.BaseStorageOverride
,hdmf.spec.spec.GroupSpec
The Spec class to use for NWB specifications
Parameters: - doc (
str
) – a description about what this specification represents - name (
str
) – the name of this group - default_name (
str
) – The default name of this group - groups (
list
) – the subgroups in this group - datasets (
list
) – the datasets in this group - attributes (
list
) – the attributes on this group - links (
list
) – the links in this group - linkable (
bool
) – whether or not this group can be linked - quantity (
str
orint
) – the required number of allowed instance - neurodata_type_def (
str
) – the NWB data type this spec defines - neurodata_type_inc (NWBGroupSpec or
str
) – the NWB data type this spec includes
-
classmethod
dataset_spec_cls
()[source]¶ The class to use when constructing DatasetSpec objects
Override this if extending to use a class other than DatasetSpec to build dataset specifications
-
get_neurodata_type
(neurodata_type)[source]¶ Get a specification by “data_type”
Parameters: neurodata_type ( str
) – the neurodata_type to retrieve
-
add_group
(doc, name=None, default_name=None, groups=[], datasets=[], attributes=[], links=[], linkable=True, quantity=1, neurodata_type_def=None, neurodata_type_inc=None)[source]¶ Add a new specification for a subgroup to this group specification
Parameters: - doc (
str
) – a description about what this specification represents - name (
str
) – the name of this group - default_name (
str
) – The default name of this group - groups (
list
) – the subgroups in this group - datasets (
list
) – the datasets in this group - attributes (
list
) – the attributes on this group - links (
list
) – the links in this group - linkable (
bool
) – whether or not this group can be linked - quantity (
str
orint
) – the required number of allowed instance - neurodata_type_def (
str
) – the NWB data type this spec defines - neurodata_type_inc (NWBGroupSpec or
str
) – the NWB data type this spec includes
- doc (
-
add_dataset
(doc, dtype=None, name=None, default_name=None, shape=None, dims=None, attributes=[], linkable=True, quantity=1, default_value=None, neurodata_type_def=None, neurodata_type_inc=None)[source]¶ Add a new specification for a subgroup to this group specification
Parameters: - doc (
str
) – a description about what this specification represents - dtype (
str
orlist
orRefSpec
) – The data type of this attribute. Use a list of DtypeSpecs to specify a compound data type. - name (
str
) – The name of this dataset - default_name (
str
) – The default name of this dataset - shape (
list
ortuple
) – the shape of this dataset - dims (
list
ortuple
) – the dimensions of this dataset - attributes (
list
) – the attributes on this group - linkable (
bool
) – whether or not this group can be linked - quantity (
str
orint
) – the required number of allowed instance - default_value (None) – a default value for this dataset
- neurodata_type_def (
str
) – the NWB data type this spec defines - neurodata_type_inc (NWBDatasetSpec or
str
) – the NWB data type this spec includes
- doc (
- doc (
-
class
pynwb.spec.
NWBNamespace
(doc, name, schema, full_name=None, version=None, date=None, author=None, contact=None, catalog=None)[source]¶ Bases:
hdmf.spec.namespace.SpecNamespace
A Namespace class for NWB
Parameters: - doc (
str
) – a description about what this namespace represents - name (
str
) – the name of this namespace - schema (
list
) – location of schema specification files or other Namespaces - full_name (
str
) – extended full name of this namespace - version (
str
ortuple
orlist
) – Version number of the namespace - date (
datetime
orstr
) – Date last modified or released. Formatting is %Y-%m-%d %H:%M:%S, e.g, 2017-04-25 17:14:13 - author (
str
orlist
) – Author or list of authors. - contact (
str
orlist
) – List of emails. Ordering should be the same as for author - catalog (
SpecCatalog
) – The SpecCatalog object for this SpecNamespace
- doc (
-
class
pynwb.spec.
NWBNamespaceBuilder
(doc, name, full_name=None, version=None, author=None, contact=None)[source]¶ Bases:
hdmf.spec.write.NamespaceBuilder
A class for writing namespace and spec files for extensions of types in the NWB core namespace
Create a NWBNamespaceBuilder
Parameters: - doc (
str
) – a description about what this namespace represents - name (
str
) – the name of this namespace - full_name (
str
) – extended full name of this namespace - version (
str
ortuple
orlist
) – Version number of the namespace - author (
str
orlist
) – Author or list of authors. - contact (
str
orlist
) – List of emails. Ordering should be the same as for author
- doc (