You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Remove unused and outdated convert.rst from the docs Fix#1378
* Fix extra numbered footnote reference in ophys tutorial
* Change code block highlighting from c to bash to avoid build warning
* Fix duplicate target here warning in 3_spec_api.rst
* Fix missing section label for crossreferencing between the extension tutorial and gallery
* Updated Changelog
Copy file name to clipboardExpand all lines: docs/source/extensions_tutorial/3_spec_api.rst
+18-15Lines changed: 18 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,8 +34,8 @@ within it Datasets, Attributes, Links, and/or other Groups. Groups are specified
34
34
35
35
- ``neurodata_type_def`` declares the name of the neurodata type.
36
36
- ``neurodata_type_inc`` indicates what data type you are extending (Groups must extend Groups, and Datasets must extend Datasets).
37
-
- To define a new neurodata type that does not extend an existing type, use
38
-
``neurodata_type_inc=NWBContainer`` for a group or ``neurodata_type_inc=NWBData`` for a dataset.
37
+
- To define a new neurodata type that does not extend an existing type, use
38
+
``neurodata_type_inc=NWBContainer`` for a group or ``neurodata_type_inc=NWBData`` for a dataset.
39
39
``NWBContainer`` and ``NWBData`` are base types for NWB.
40
40
- To use a type that has already been defined, use ``neurodata_type_inc`` and not ``neurodata_type_def``.
41
41
- You can define a group that is not a neurodata type by omitting both ``neurodata_type_def`` and ``neurodata_type_inc``.
@@ -79,17 +79,20 @@ All larger blocks of numeric or text data should be stored in Datasets. Specifyi
79
79
``neurodata_type_def``, ``neurodata_type_inc``, ``doc``, ``name``, ``default_name``, ``linkable``, ``quantity``, and
80
80
``attributes`` all work the same as they do in :py:class:`~pynwb.spec.NWBGroupSpec`, described in the previous section.
81
81
82
-
``dtype`` defines the type of the data, which can be a basic type, compound type, or reference type.
83
-
See a list of options `here <https://schema-language.readthedocs.io/en/latest/description.html#dtype>`_.
84
-
Basic types can be defined as string objects and more complex types via :py:class:`~pynwb.spec.NWBDtypeSpec` and `RefSpec <https://hdmf.readthedocs.io/en/latest/hdmf.spec.spec.html#hdmf.spec.spec.RefSpec>`_.
82
+
``dtype`` defines the type of the data, which can be a basic type, compound type, or reference type.
83
+
See a list of `dtype options <https://schema-language.readthedocs.io/en/latest/description.html#dtype>`_
84
+
as part of the specification language docs. Basic types can be defined as string objects and more complex
85
+
types via :py:class:`~pynwb.spec.NWBDtypeSpec` and
as part of the specification language docs. ``None`` is mapped to ``null``. Is no shape is provided, it is
92
+
assumed that the dataset is only a single element.
90
93
91
-
If the dataset is a single element (scalar) that represents meta-data, consider using an Attribute (see
92
-
below) to store the data more efficiently instead. However, note that a Dataset can have Attributes,
94
+
If the dataset is a single element (scalar) that represents meta-data, consider using an Attribute (see
95
+
below) to store the data more efficiently instead. However, note that a Dataset can have Attributes,
93
96
whereas an Attribute cannot have Attributes of its own.
94
97
``dims`` provides labels for each dimension of ``shape``.
95
98
@@ -139,16 +142,16 @@ defined in the ``attributes`` field of a :py:class:`~pynwb.spec.NWBGroupSpec` or
139
142
neurodata type, i.e., the ``neurodata_type_def`` and ``neurodata_type_inc`` keys are not allowed. The only way to match an object with a spec is through the name of the attribute so ``name`` is
140
143
required. You cannot have multiple attributes on a single group/dataset that correspond to the same
141
144
:py:class:`~pynwb.spec.NWBAttributeSpec`, since these would have to have the same name. Therefore, instead of
142
-
specifying number of ``quantity``, you have a ``required`` field which takes a boolean value. Another
145
+
specifying number of ``quantity``, you have a ``required`` field which takes a boolean value. Another
143
146
key difference between datasets and attributes is that attributes cannot have attributes of their own.
144
147
145
148
.. tip::
146
149
Dataset or Attribute? It is often possible to store data as either a Dataset or an Attribute. Our best advice is
147
-
to keep Attributes small. In HDF5 the typical size limit for attributes is 64Kbytes. If an attribute is going to
148
-
store more than 64Kbyte, then make it a Dataset. Attributes are also more efficient for storing very
149
-
small data, such as scalars. However, attributes cannot have attributes of their own, and in HDF5,
150
+
to keep Attributes small. In HDF5 the typical size limit for attributes is 64Kbytes. If an attribute is going to
151
+
store more than 64Kbyte, then make it a Dataset. Attributes are also more efficient for storing very
152
+
small data, such as scalars. However, attributes cannot have attributes of their own, and in HDF5,
150
153
I/O filters, such as compression and chunking, cannot apply to attributes.
0 commit comments