pynwb.spec module¶
- class pynwb.spec.NWBAttributeSpec(name, doc, dtype, shape=None, dims=None, required=True, parent=None, value=None, default_value=None)[source]¶
Bases:
AttributeSpec
- Parameters:
name (
str
) – The name of this attributedoc (
str
) – a description about what this specification representsrequired (
bool
) – whether or not this attribute is required. ignored when “value” is specifiedparent (
BaseStorageSpec
) – the parent of this specvalue (None) – a constant value for this attribute
default_value (None) – a default value for this attribute
- class pynwb.spec.NWBLinkSpec(doc, target_type, quantity=1, name=None)[source]¶
Bases:
LinkSpec
- Parameters:
- property 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.- property neurodata_type_inc¶
- property neurodata_type_def¶
- class pynwb.spec.NWBDatasetSpec(doc, dtype=None, name=None, default_name=None, shape=None, dims=None, attributes=[], linkable=True, quantity=1, default_value=None, value=None, neurodata_type_def=None, neurodata_type_inc=None)[source]¶
Bases:
BaseStorageOverride
,DatasetSpec
The Spec class to use for NWB dataset specifications.
Classes will automatically include NWBData if None is specified.
- Parameters:
doc (
str
) – a description about what this specification representsdtype (
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 datasetdefault_name (
str
) – The default name of this datasetattributes (
list
) – the attributes on this grouplinkable (
bool
) – whether or not this group can be linkedquantity (
str
orint
) – the required number of allowed instancedefault_value (None) – a default value for this dataset
value (None) – a fixed value for this dataset
neurodata_type_def (
str
) – the NWB data type this spec definesneurodata_type_inc (
NWBDatasetSpec
orstr
) – the NWB data type this spec includes
- 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:
BaseStorageOverride
,GroupSpec
The Spec class to use for NWB group specifications.
Classes will automatically include NWBContainer if None is specified.
- Parameters:
doc (
str
) – a description about what this specification representsname (
str
) – the name of the Group that is written to the file. If this argument is omitted, users will be required to enter aname
field when creating instances of this data type in the API. Another option is to specifydefault_name
, in which case this name will be used as the name of the Group if no other name is provided.default_name (
str
) – The default name of this groupgroups (
list
) – the subgroups in this groupdatasets (
list
) – the datasets in this groupattributes (
list
) – the attributes on this grouplinks (
list
) – the links in this grouplinkable (
bool
) – whether or not this group can be linkedquantity (
str
orint
) – the allowable number of instance of this group in a certain location. See table of options here. Note that if youspecifyname
,quantity
cannot be'*'
,'+'
, or an integer greater that 1, because you cannot have more than one group of the same name in the same parent group.neurodata_type_def (
str
) – the NWB data type this spec definesneurodata_type_inc (
NWBGroupSpec
orstr
) – 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 “neurodata_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 representsname (
str
) – the name of the Group that is written to the file. If this argument is omitted, users will be required to enter aname
field when creating instances of this data type in the API. Another option is to specifydefault_name
, in which case this name will be used as the name of the Group if no other name is provided.default_name (
str
) – The default name of this groupgroups (
list
) – the subgroups in this groupdatasets (
list
) – the datasets in this groupattributes (
list
) – the attributes on this grouplinks (
list
) – the links in this grouplinkable (
bool
) – whether or not this group can be linkedthe allowable number of instance of this group in a certain location. See table of options here. Note that if youspecify
name
,quantity
cannot be'*'
,'+'
, or an integer greater that 1, because you cannot have more than one group of the same name in the same parent group.neurodata_type_def (
str
) – the NWB data type this spec definesneurodata_type_inc (
NWBGroupSpec
orstr
) – the NWB data type this spec includes
- add_dataset(doc, dtype=None, name=None, default_name=None, shape=None, dims=None, attributes=[], linkable=True, quantity=1, default_value=None, 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 representsdtype (
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 datasetdefault_name (
str
) – The default name of this datasetattributes (
list
) – the attributes on this grouplinkable (
bool
) – whether or not this group can be linkedquantity (
str
orint
) – the required number of allowed instancedefault_value (None) – a default value for this dataset
value (None) – a fixed value for this dataset
neurodata_type_def (
str
) – the NWB data type this spec definesneurodata_type_inc (
NWBDatasetSpec
orstr
) – the NWB data type this spec includes
- class pynwb.spec.NWBNamespace(doc, name, schema, full_name=None, version=None, date=None, author=None, contact=None, catalog=None)[source]¶
Bases:
SpecNamespace
A Namespace class for NWB
- Parameters:
doc (
str
) – a description about what this namespace representsname (
str
) – the name of this namespaceschema (
list
) – location of schema specification files or other Namespacesfull_name (
str
) – extended full name of this namespaceversion (
str
ortuple
orlist
) – Version number of the namespacedate (
datetime
orstr
) – Date last modified or released. Formatting is %Y-%m-%d %H:%M:%S, e.g, 2017-04-25 17:14:13contact (
str
orlist
) – List of emails. Ordering should be the same as for authorcatalog (
SpecCatalog
) – The SpecCatalog object for this SpecNamespace
- class pynwb.spec.NWBNamespaceBuilder(doc, name, full_name=None, version=None, author=None, contact=None)[source]¶
Bases:
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 representsname (
str
) – the name of this namespacefull_name (
str
) – extended full name of this namespaceversion (
str
ortuple
orlist
) – Version number of the namespacecontact (
str
orlist
) – List of emails. Ordering should be the same as for author