functional docs build

This commit is contained in:
sneakers-the-rat 2024-07-08 21:37:02 -07:00
parent fdf80666fb
commit 34c8be3a2c
Signed by untrusted user who does not match committer: jonny
GPG key ID: 6DCB96EF1E4D232D
176 changed files with 541 additions and 6091 deletions

View file

@ -27,7 +27,7 @@ extensions = [
'sphinx.ext.graphviz', 'sphinx.ext.graphviz',
'sphinx.ext.napoleon', 'sphinx.ext.napoleon',
'sphinx.ext.autodoc', 'sphinx.ext.autodoc',
'sphinxcontrib.autodoc_pydantic', #'sphinxcontrib.autodoc_pydantic',
'sphinx.ext.intersphinx', 'sphinx.ext.intersphinx',
'sphinx.ext.doctest', 'sphinx.ext.doctest',
"sphinx_design", "sphinx_design",
@ -93,7 +93,8 @@ graphviz_output_format = "svg"
# autodoc # autodoc
autodoc_pydantic_model_show_json_error_strategy = 'coerce' autodoc_pydantic_model_show_json_error_strategy = 'coerce'
autodoc_pydantic_model_show_json = False autodoc_pydantic_model_show_json = False
autodoc_mock_imports = [] #autodoc_mock_imports = ['pydantic', 'curies', 'pydantic_settings']
autodoc_mock_imports = ['curies']
autoclass_content = "both" autoclass_content = "both"
autodoc_member_order='bysource' autodoc_member_order='bysource'
add_module_names = False add_module_names = False
@ -109,16 +110,16 @@ nb_append_css = False
# -------------------------------------------------- # --------------------------------------------------
# doctest # doctest
doctest_global_setup = """ # doctest_global_setup = """
from linkml_runtime.linkml_model import ClassDefinition, SlotDefinition, SchemaDefinition # from linkml_runtime.linkml_model import ClassDefinition, SlotDefinition, SchemaDefinition
from nwb_schema_language import Namespaces, Namespace, Dataset, Group, Schema # from nwb_schema_language import Namespaces, Namespace, Dataset, Group, Schema
from linkml_runtime.dumpers import yaml_dumper # from linkml_runtime.dumpers import yaml_dumper
import yaml # import yaml
from pydantic import BaseModel, Field # from pydantic import BaseModel, Field
import numpy as np # import numpy as np
#
from nwb_linkml.adapters import BuildResult # from nwb_linkml.adapters import BuildResult
""" # """
# -------------------------------------------------- # --------------------------------------------------
# Etc one-off settings # Etc one-off settings

View file

@ -118,7 +118,7 @@ class Adapter(BaseModel):
Generate the corresponding linkML element for this adapter Generate the corresponding linkML element for this adapter
""" """
def walk(self, input: BaseModel | list | dict) -> Generator[BaseModel | Any | None, None, None]: def walk(self, input: Union[BaseModel, dict, list]) -> Generator[Union[BaseModel, Any, None], None, None]:
""" """
Iterate through all items in the given model. Iterate through all items in the given model.
@ -158,7 +158,7 @@ class Adapter(BaseModel):
pass pass
def walk_fields( def walk_fields(
self, input: BaseModel | list | dict, field: str | Tuple[str, ...] self, input: Union[BaseModel, dict, list], field: str | Tuple[str, ...]
) -> Generator[Any, None, None]: ) -> Generator[Any, None, None]:
""" """
Recursively walk input for fields that match ``field`` Recursively walk input for fields that match ``field``
@ -178,7 +178,7 @@ class Adapter(BaseModel):
yield item[1] yield item[1]
def walk_field_values( def walk_field_values(
self, input: BaseModel | list | dict, field: str, value: Optional[Any] = None self, input: Union[BaseModel, dict, list], field: str, value: Optional[Any] = None
) -> Generator[BaseModel, None, None]: ) -> Generator[BaseModel, None, None]:
""" """
Recursively walk input for **models** that contain a ``field`` as a direct child Recursively walk input for **models** that contain a ``field`` as a direct child
@ -202,7 +202,7 @@ class Adapter(BaseModel):
yield item yield item
def walk_types( def walk_types(
self, input: BaseModel | list | dict, get_type: Type[T] | Tuple[Type[T], Type[Unpack[Ts]]] self, input: Union[BaseModel, dict, list], get_type: Type[T] | Tuple[Type[T], Type[Unpack[Ts]]]
) -> Generator[T | Ts, None, None]: ) -> Generator[T | Ts, None, None]:
""" """
Walk a model, yielding items that are the same type as the given type Walk a model, yielding items that are the same type as the given type

View file

@ -67,10 +67,10 @@ from nwb_linkml.maps import flat_to_nptyping
from nwb_linkml.maps.naming import module_case, version_module_case from nwb_linkml.maps.naming import module_case, version_module_case
class LinkML_Meta(BaseModel): # class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute""" # """Extra LinkML Metadata stored as a class attribute"""
#
tree_root: bool = False # tree_root: bool = False
def default_template( def default_template(
@ -112,32 +112,9 @@ from {{ import_module }} import (
metamodel_version = "{{metamodel_version}}" metamodel_version = "{{metamodel_version}}"
version = "{{version if version else None}}" version = "{{version if version else None}}"
""" """
### BASE MODEL ###
if pydantic_ver == "1": # pragma: no cover
template += """
List = BaseList
class WeakRefShimBaseModel(BaseModel):
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = False,
validate_all = True,
underscore_attrs_are_private = True,
extra = {% if allow_extra %}'allow'{% else %}'forbid'{% endif %},
arbitrary_types_allowed = True,
use_enum_values = True):
"""
else:
template += """ template += """
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment = True,
validate_default = True,
extra = {% if allow_extra %}'allow'{% else %}'forbid'{% endif %},
arbitrary_types_allowed = True,
use_enum_values = True
)
""" """
### Injected Fields ### Injected Fields
template += """ template += """
@ -233,23 +210,6 @@ class {{ c.name }}
None None
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
"""
### FWD REFS / REBUILD MODEL ###
if pydantic_ver == "1": # pragma: no cover
template += """
# Update forward refs
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/
{% for c in schema.classes.values() -%}
{{ c.name }}.update_forward_refs()
{% endfor %}
"""
else:
template += """
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
{% for c in schema.classes.values() -%}
{{ c.name }}.model_rebuild()
{% endfor %}
""" """
return template return template
@ -455,18 +415,18 @@ class NWBPydanticGenerator(PydanticGenerator):
if not base_range_subsumes_any_of: if not base_range_subsumes_any_of:
raise ValueError("Slot cannot have both range and any_of defined") raise ValueError("Slot cannot have both range and any_of defined")
def _get_linkml_classvar(self, cls: ClassDefinition) -> SlotDefinition: # def _get_linkml_classvar(self, cls: ClassDefinition) -> SlotDefinition:
"""A class variable that holds additional linkml attrs""" # """A class variable that holds additional linkml attrs"""
slot = SlotDefinition(name="linkml_meta") # slot = SlotDefinition(name="linkml_meta")
slot.annotations["python_range"] = Annotation("python_range", "ClassVar[LinkML_Meta]") # slot.annotations["python_range"] = Annotation("python_range", "ClassVar[LinkML_Meta]")
meta_fields = {k: getattr(cls, k, None) for k in LinkML_Meta.model_fields.keys()} # meta_fields = {k: getattr(cls, k, None) for k in LinkML_Meta.model_fields.keys()}
meta_field_strings = [f"{k}={v}" for k, v in meta_fields.items() if v is not None] # meta_field_strings = [f"{k}={v}" for k, v in meta_fields.items() if v is not None]
meta_field_string = ", ".join(meta_field_strings) # meta_field_string = ", ".join(meta_field_strings)
slot.annotations["fixed_field"] = Annotation( # slot.annotations["fixed_field"] = Annotation(
"fixed_field", f"Field(LinkML_Meta({meta_field_string}), frozen=True)" # "fixed_field", f"Field(LinkML_Meta({meta_field_string}), frozen=True)"
) # )
#
return slot # return slot
def sort_classes( def sort_classes(
self, clist: List[ClassDefinition], imports: Dict[str, List[str]] self, clist: List[ClassDefinition], imports: Dict[str, List[str]]
@ -673,7 +633,7 @@ class NWBPydanticGenerator(PydanticGenerator):
template_obj = Template(template_file.read()) template_obj = Template(template_file.read())
else: else:
template_obj = Template( template_obj = Template(
default_template(self.pydantic_version, extra_classes=[LinkML_Meta]) default_template(self.pydantic_version, extra_classes=[])
) )
sv: SchemaView sv: SchemaView
@ -718,7 +678,7 @@ class NWBPydanticGenerator(PydanticGenerator):
del class_def.attributes[attribute] del class_def.attributes[attribute]
# make class attr that stores extra linkml attrs # make class attr that stores extra linkml attrs
class_def.attributes["linkml_meta"] = self._get_linkml_classvar(class_def) # class_def.attributes["linkml_meta"] = self._get_linkml_classvar(class_def)
class_name = class_original.name class_name = class_original.name
predefined_slot_values[camelcase(class_name)] = {} predefined_slot_values[camelcase(class_name)] = {}

View file

@ -27,7 +27,7 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from ...hdmf_common.v1_1_0.hdmf_common_table import Container, Data, DynamicTable from ...hdmf_common.v1_1_0.hdmf_common_table import Data, Container, DynamicTable
metamodel_version = "None" metamodel_version = "None"
@ -35,13 +35,6 @@ version = "2.2.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class NWBData(Data): class NWBData(Data):
""" """
An abstract data type for a dataset. An abstract data type for a dataset.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -81,7 +67,6 @@ class Image(NWBData):
An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)). An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -103,7 +88,6 @@ class NWBContainer(Container):
An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers. An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -112,7 +96,6 @@ class NWBDataInterface(NWBContainer):
An abstract data type for a generic container storing collections of data, as opposed to metadata. An abstract data type for a generic container storing collections of data, as opposed to metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -121,7 +104,6 @@ class TimeSeries(NWBDataInterface):
General purpose time series. General purpose time series.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of the time series.""" None, description="""Description of the time series."""
@ -161,7 +143,6 @@ class TimeSeriesData(ConfiguredBaseModel):
Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file. Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
conversion: Optional[float] = Field( conversion: Optional[float] = Field(
None, None,
@ -190,7 +171,6 @@ class TimeSeriesStartingTime(ConfiguredBaseModel):
Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute. Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["starting_time"] = Field("starting_time") name: Literal["starting_time"] = Field("starting_time")
rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""") rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""")
unit: Optional[str] = Field( unit: Optional[str] = Field(
@ -205,7 +185,6 @@ class TimeSeriesSync(ConfiguredBaseModel):
Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes. Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["sync"] = Field("sync") name: Literal["sync"] = Field("sync")
@ -214,7 +193,6 @@ class ProcessingModule(NWBContainer):
A collection of processed data. A collection of processed data.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[ children: Optional[
List[Union[BaseModel, DynamicTable, NWBDataInterface]] List[Union[BaseModel, DynamicTable, NWBDataInterface]]
| Union[BaseModel, DynamicTable, NWBDataInterface] | Union[BaseModel, DynamicTable, NWBDataInterface]
@ -227,7 +205,6 @@ class Images(NWBDataInterface):
A collection of images. A collection of images.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("Images") name: str = Field("Images")
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of this collection of images.""" None, description="""Description of this collection of images."""
@ -235,17 +212,3 @@ class Images(NWBDataInterface):
image: List[str] | str = Field( image: List[str] | str = Field(
default_factory=list, description="""Images stored in this collection.""" default_factory=list, description="""Images stored in this collection."""
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
NWBData.model_rebuild()
Image.model_rebuild()
NWBContainer.model_rebuild()
NWBDataInterface.model_rebuild()
TimeSeries.model_rebuild()
TimeSeriesData.model_rebuild()
TimeSeriesStartingTime.model_rebuild()
TimeSeriesSync.model_rebuild()
ProcessingModule.model_rebuild()
Images.model_rebuild()

View file

@ -28,9 +28,9 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesStartingTime, TimeSeriesStartingTime,
NWBDataInterface,
TimeSeriesSync, TimeSeriesSync,
) )
@ -42,13 +42,6 @@ version = "2.2.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -68,18 +61,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class SpatialSeries(TimeSeries): class SpatialSeries(TimeSeries):
""" """
Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values. Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field( data: str = Field(
..., ...,
@ -123,7 +109,6 @@ class SpatialSeriesData(ConfiguredBaseModel):
1-D or 2-D array storing position or direction relative to some reference frame. 1-D or 2-D array storing position or direction relative to some reference frame.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -142,7 +127,6 @@ class BehavioralEpochs(NWBDataInterface):
TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data. TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[IntervalSeries] | IntervalSeries] = Field( children: Optional[List[IntervalSeries] | IntervalSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -154,7 +138,6 @@ class BehavioralEvents(NWBDataInterface):
TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details. TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict) children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -164,7 +147,6 @@ class BehavioralTimeSeries(NWBDataInterface):
TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details. TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict) children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -174,7 +156,6 @@ class PupilTracking(NWBDataInterface):
Eye-tracking data, representing pupil size. Eye-tracking data, representing pupil size.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict) children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -184,7 +165,6 @@ class EyeTracking(NWBDataInterface):
Eye-tracking data, representing direction of gaze. Eye-tracking data, representing direction of gaze.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpatialSeries] | SpatialSeries] = Field( children: Optional[List[SpatialSeries] | SpatialSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -196,7 +176,6 @@ class CompassDirection(NWBDataInterface):
With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees. With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpatialSeries] | SpatialSeries] = Field( children: Optional[List[SpatialSeries] | SpatialSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -208,21 +187,7 @@ class Position(NWBDataInterface):
Position data, whether along the x, x/y or x/y/z axis. Position data, whether along the x, x/y or x/y/z axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpatialSeries] | SpatialSeries] = Field( children: Optional[List[SpatialSeries] | SpatialSeries] = Field(
default_factory=dict default_factory=dict
) )
name: str = Field(...) name: str = Field(...)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
SpatialSeries.model_rebuild()
SpatialSeriesData.model_rebuild()
BehavioralEpochs.model_rebuild()
BehavioralEvents.model_rebuild()
BehavioralTimeSeries.model_rebuild()
PupilTracking.model_rebuild()
EyeTracking.model_rebuild()
CompassDirection.model_rebuild()
Position.model_rebuild()

View file

@ -35,13 +35,6 @@ version = "2.2.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class Device(NWBContainer): class Device(NWBContainer):
""" """
Metadata about a data acquisition device, e.g., recording system, electrode, microscope. Metadata about a data acquisition device, e.g., recording system, electrode, microscope.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, None,
@ -81,8 +67,3 @@ class Device(NWBContainer):
manufacturer: Optional[str] = Field( manufacturer: Optional[str] = Field(
None, description="""The name of the manufacturer of the device.""" None, description="""The name of the manufacturer of the device."""
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
Device.model_rebuild()

View file

@ -27,29 +27,22 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from ...hdmf_common.v1_1_0.hdmf_common_table import DynamicTableRegion, DynamicTable
from .core_nwb_base import ( from .core_nwb_base import (
NWBContainer,
TimeSeriesStartingTime,
NWBDataInterface, NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesStartingTime,
NWBContainer,
TimeSeriesSync, TimeSeriesSync,
) )
from ...hdmf_common.v1_1_0.hdmf_common_table import DynamicTableRegion, DynamicTable
metamodel_version = "None" metamodel_version = "None"
version = "2.2.0" version = "2.2.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -69,18 +62,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class ElectricalSeries(TimeSeries): class ElectricalSeries(TimeSeries):
""" """
A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels. A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Union[ data: Union[
NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times"], float],
@ -129,7 +115,6 @@ class ElectricalSeriesElectrodes(DynamicTableRegion):
DynamicTableRegion pointer to the electrodes that this time series was generated from. DynamicTableRegion pointer to the electrodes that this time series was generated from.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -145,7 +130,6 @@ class SpikeEventSeries(ElectricalSeries):
Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode). Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Union[ data: Union[
NDArray[Shape["* num_events, * num_channels, * num_samples"], float], NDArray[Shape["* num_events, * num_channels, * num_samples"], float],
@ -193,7 +177,6 @@ class FeatureExtraction(NWBDataInterface):
Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("FeatureExtraction") name: str = Field("FeatureExtraction")
description: NDArray[Shape["* num_features"], str] = Field( description: NDArray[Shape["* num_features"], str] = Field(
..., ...,
@ -220,7 +203,6 @@ class FeatureExtractionElectrodes(DynamicTableRegion):
DynamicTableRegion pointer to the electrodes that this time series was generated from. DynamicTableRegion pointer to the electrodes that this time series was generated from.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -236,7 +218,6 @@ class EventDetection(NWBDataInterface):
Detected spike events from voltage trace(s). Detected spike events from voltage trace(s).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("EventDetection") name: str = Field("EventDetection")
detection_method: str = Field( detection_method: str = Field(
..., ...,
@ -256,7 +237,6 @@ class EventWaveform(NWBDataInterface):
Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition. Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpikeEventSeries] | SpikeEventSeries] = Field( children: Optional[List[SpikeEventSeries] | SpikeEventSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -268,7 +248,6 @@ class FilteredEphys(NWBDataInterface):
Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries. Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field( children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -280,7 +259,6 @@ class LFP(NWBDataInterface):
LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries description or comments field. LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries description or comments field.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field( children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -292,7 +270,6 @@ class ElectrodeGroup(NWBContainer):
A physical grouping of electrodes, e.g. a shank of an array. A physical grouping of electrodes, e.g. a shank of an array.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of this electrode group.""" None, description="""Description of this electrode group."""
@ -311,7 +288,6 @@ class ElectrodeGroupPosition(ConfiguredBaseModel):
stereotaxic or common framework coordinates stereotaxic or common framework coordinates
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["position"] = Field("position") name: Literal["position"] = Field("position")
x: Optional[float] = Field(None, description="""x coordinate""") x: Optional[float] = Field(None, description="""x coordinate""")
y: Optional[float] = Field(None, description="""y coordinate""") y: Optional[float] = Field(None, description="""y coordinate""")
@ -323,7 +299,6 @@ class ClusterWaveforms(NWBDataInterface):
DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one. DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("ClusterWaveforms") name: str = Field("ClusterWaveforms")
waveform_filtering: str = Field( waveform_filtering: str = Field(
..., description="""Filtering applied to data before generating mean/sd""" ..., description="""Filtering applied to data before generating mean/sd"""
@ -343,7 +318,6 @@ class Clustering(NWBDataInterface):
DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("Clustering") name: str = Field("Clustering")
description: str = Field( description: str = Field(
..., ...,
@ -360,20 +334,3 @@ class Clustering(NWBDataInterface):
..., ...,
description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""", description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ElectricalSeries.model_rebuild()
ElectricalSeriesElectrodes.model_rebuild()
SpikeEventSeries.model_rebuild()
FeatureExtraction.model_rebuild()
FeatureExtractionElectrodes.model_rebuild()
EventDetection.model_rebuild()
EventWaveform.model_rebuild()
FilteredEphys.model_rebuild()
LFP.model_rebuild()
ElectrodeGroup.model_rebuild()
ElectrodeGroupPosition.model_rebuild()
ClusterWaveforms.model_rebuild()
Clustering.model_rebuild()

View file

@ -27,27 +27,20 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import TimeSeries
from ...hdmf_common.v1_1_0.hdmf_common_table import ( from ...hdmf_common.v1_1_0.hdmf_common_table import (
DynamicTable,
VectorIndex, VectorIndex,
DynamicTable,
VectorData, VectorData,
) )
from .core_nwb_base import TimeSeries
metamodel_version = "None" metamodel_version = "None"
version = "2.2.0" version = "2.2.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -67,18 +60,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class TimeIntervals(DynamicTable): class TimeIntervals(DynamicTable):
""" """
A container for aggregating epoch data and the TimeSeries that each epoch applies to. A container for aggregating epoch data and the TimeSeries that each epoch applies to.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
start_time: Optional[List[float] | float] = Field( start_time: Optional[List[float] | float] = Field(
default_factory=list, description="""Start time of epoch, in seconds.""" default_factory=list, description="""Start time of epoch, in seconds."""
@ -122,7 +108,6 @@ class TimeIntervalsTagsIndex(VectorIndex):
Index for tags. Index for tags.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["tags_index"] = Field("tags_index") name: Literal["tags_index"] = Field("tags_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -135,7 +120,6 @@ class TimeIntervalsTimeseries(VectorData):
An index into a TimeSeries object. An index into a TimeSeries object.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["timeseries"] = Field("timeseries") name: Literal["timeseries"] = Field("timeseries")
idx_start: Optional[int] = Field( idx_start: Optional[int] = Field(
None, None,
@ -158,17 +142,8 @@ class TimeIntervalsTimeseriesIndex(VectorIndex):
Index for timeseries. Index for timeseries.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["timeseries_index"] = Field("timeseries_index") name: Literal["timeseries_index"] = Field("timeseries_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
description="""Reference to the target dataset that this index applies to.""", description="""Reference to the target dataset that this index applies to.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
TimeIntervals.model_rebuild()
TimeIntervalsTagsIndex.model_rebuild()
TimeIntervalsTimeseries.model_rebuild()
TimeIntervalsTimeseriesIndex.model_rebuild()

View file

@ -27,27 +27,27 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_ophys import ImagingPlane from .core_nwb_icephys import SweepTable, IntracellularElectrode
from .core_nwb_base import TimeSeries, NWBDataInterface, ProcessingModule, NWBContainer
from .core_nwb_epoch import TimeIntervals from .core_nwb_epoch import TimeIntervals
from ...hdmf_common.v1_1_0.hdmf_common_table import ( from .core_nwb_ecephys import ElectrodeGroup
DynamicTable,
VectorData,
VectorIndex,
)
from .core_nwb_icephys import IntracellularElectrode, SweepTable from .core_nwb_base import NWBContainer, ProcessingModule, NWBDataInterface, TimeSeries
from .core_nwb_ogen import OptogeneticStimulusSite from .core_nwb_device import Device
from .core_nwb_misc import Units from .core_nwb_misc import Units
from .core_nwb_ecephys import ElectrodeGroup from .core_nwb_ogen import OptogeneticStimulusSite
from .core_nwb_device import Device from ...hdmf_common.v1_1_0.hdmf_common_table import (
VectorIndex,
DynamicTable,
VectorData,
)
from .core_nwb_ophys import ImagingPlane
metamodel_version = "None" metamodel_version = "None"
@ -55,13 +55,6 @@ version = "2.2.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -81,18 +74,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class NWBFile(NWBContainer): class NWBFile(NWBContainer):
""" """
An NWB:N file storing cellular-based neurophysiology data from a single experimental session. An NWB:N file storing cellular-based neurophysiology data from a single experimental session.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: Literal["root"] = Field("root") name: Literal["root"] = Field("root")
nwb_version: Optional[str] = Field( nwb_version: Optional[str] = Field(
None, None,
@ -163,7 +149,6 @@ class NWBFileStimulus(ConfiguredBaseModel):
Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file. Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["stimulus"] = Field("stimulus") name: Literal["stimulus"] = Field("stimulus")
presentation: Optional[List[TimeSeries] | TimeSeries] = Field( presentation: Optional[List[TimeSeries] | TimeSeries] = Field(
default_factory=dict, description="""Stimuli presented during the experiment.""" default_factory=dict, description="""Stimuli presented during the experiment."""
@ -179,7 +164,6 @@ class NWBFileGeneral(ConfiguredBaseModel):
Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them. Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["general"] = Field("general") name: Literal["general"] = Field("general")
data_collection: Optional[str] = Field( data_collection: Optional[str] = Field(
None, description="""Notes about data collection and analysis.""" None, description="""Notes about data collection and analysis."""
@ -269,7 +253,6 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel):
Script file or link to public source code used to create this NWB file. Script file or link to public source code used to create this NWB file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["source_script"] = Field("source_script") name: Literal["source_script"] = Field("source_script")
file_name: Optional[str] = Field(None, description="""Name of script file.""") file_name: Optional[str] = Field(None, description="""Name of script file.""")
value: str = Field(...) value: str = Field(...)
@ -280,7 +263,6 @@ class Subject(NWBContainer):
Information about the animal or person from which the data was measured. Information about the animal or person from which the data was measured.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["subject"] = Field("subject") name: Literal["subject"] = Field("subject")
age: Optional[str] = Field( age: Optional[str] = Field(
None, None,
@ -314,7 +296,6 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel):
Metadata related to extracellular electrophysiology. Metadata related to extracellular electrophysiology.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["extracellular_ephys"] = Field("extracellular_ephys") name: Literal["extracellular_ephys"] = Field("extracellular_ephys")
electrode_group: Optional[List[str] | str] = Field( electrode_group: Optional[List[str] | str] = Field(
default_factory=list, description="""Physical group of electrodes.""" default_factory=list, description="""Physical group of electrodes."""
@ -330,7 +311,6 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
A table of all electrodes (i.e. channels) used for recording. A table of all electrodes (i.e. channels) used for recording.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
x: Optional[List[float] | float] = Field( x: Optional[List[float] | float] = Field(
default_factory=list, default_factory=list,
@ -400,7 +380,6 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel):
Metadata related to intracellular electrophysiology. Metadata related to intracellular electrophysiology.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["intracellular_ephys"] = Field("intracellular_ephys") name: Literal["intracellular_ephys"] = Field("intracellular_ephys")
filtering: Optional[str] = Field( filtering: Optional[str] = Field(
None, None,
@ -413,15 +392,3 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel):
None, None,
description="""The table which groups different PatchClampSeries together.""", description="""The table which groups different PatchClampSeries together.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
NWBFile.model_rebuild()
NWBFileStimulus.model_rebuild()
NWBFileGeneral.model_rebuild()
NWBFileGeneralSourceScript.model_rebuild()
Subject.model_rebuild()
NWBFileGeneralExtracellularEphys.model_rebuild()
NWBFileGeneralExtracellularEphysElectrodes.model_rebuild()
NWBFileGeneralIntracellularEphys.model_rebuild()

View file

@ -28,16 +28,16 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeries, NWBContainer,
TimeSeriesSync, TimeSeriesSync,
TimeSeriesStartingTime, TimeSeriesStartingTime,
NWBContainer, TimeSeries,
) )
from ...hdmf_common.v1_1_0.hdmf_common_table import ( from ...hdmf_common.v1_1_0.hdmf_common_table import (
VectorIndex,
DynamicTable, DynamicTable,
VectorData, VectorData,
VectorIndex,
) )
@ -46,13 +46,6 @@ version = "2.2.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -72,18 +65,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class PatchClampSeries(TimeSeries): class PatchClampSeries(TimeSeries):
""" """
An abstract base class for patch-clamp data - stimulus or response, current or voltage. An abstract base class for patch-clamp data - stimulus or response, current or voltage.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
None, description="""Protocol/stimulus name for this patch-clamp dataset.""" None, description="""Protocol/stimulus name for this patch-clamp dataset."""
@ -131,7 +117,6 @@ class PatchClampSeriesData(ConfiguredBaseModel):
Recorded voltage or current. Recorded voltage or current.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -145,7 +130,6 @@ class CurrentClampSeries(PatchClampSeries):
Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected. Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Recorded voltage.""") data: str = Field(..., description="""Recorded voltage.""")
bias_current: Optional[float] = Field( bias_current: Optional[float] = Field(
@ -202,7 +186,6 @@ class CurrentClampSeriesData(ConfiguredBaseModel):
Recorded voltage. Recorded voltage.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -216,7 +199,6 @@ class IZeroClampSeries(CurrentClampSeries):
Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell. Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
bias_current: float = Field( bias_current: float = Field(
..., description="""Bias current, in amps, fixed to 0.0.""" ..., description="""Bias current, in amps, fixed to 0.0."""
@ -273,7 +255,6 @@ class CurrentClampStimulusSeries(PatchClampSeries):
Stimulus current applied during current clamp recording. Stimulus current applied during current clamp recording.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Stimulus current applied.""") data: str = Field(..., description="""Stimulus current applied.""")
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
@ -321,7 +302,6 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel):
Stimulus current applied. Stimulus current applied.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -335,7 +315,6 @@ class VoltageClampSeries(PatchClampSeries):
Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected. Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Recorded current.""") data: str = Field(..., description="""Recorded current.""")
capacitance_fast: Optional[str] = Field( capacitance_fast: Optional[str] = Field(
@ -404,7 +383,6 @@ class VoltageClampSeriesData(ConfiguredBaseModel):
Recorded current. Recorded current.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -418,7 +396,6 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel):
Fast capacitance, in farads. Fast capacitance, in farads.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["capacitance_fast"] = Field("capacitance_fast") name: Literal["capacitance_fast"] = Field("capacitance_fast")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -432,7 +409,6 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel):
Slow capacitance, in farads. Slow capacitance, in farads.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["capacitance_slow"] = Field("capacitance_slow") name: Literal["capacitance_slow"] = Field("capacitance_slow")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -446,7 +422,6 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel):
Resistance compensation bandwidth, in hertz. Resistance compensation bandwidth, in hertz.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["resistance_comp_bandwidth"] = Field("resistance_comp_bandwidth") name: Literal["resistance_comp_bandwidth"] = Field("resistance_comp_bandwidth")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -460,7 +435,6 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel):
Resistance compensation correction, in percent. Resistance compensation correction, in percent.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["resistance_comp_correction"] = Field("resistance_comp_correction") name: Literal["resistance_comp_correction"] = Field("resistance_comp_correction")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -474,7 +448,6 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel):
Resistance compensation prediction, in percent. Resistance compensation prediction, in percent.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["resistance_comp_prediction"] = Field("resistance_comp_prediction") name: Literal["resistance_comp_prediction"] = Field("resistance_comp_prediction")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -488,7 +461,6 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel):
Whole cell capacitance compensation, in farads. Whole cell capacitance compensation, in farads.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["whole_cell_capacitance_comp"] = Field("whole_cell_capacitance_comp") name: Literal["whole_cell_capacitance_comp"] = Field("whole_cell_capacitance_comp")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -502,7 +474,6 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel):
Whole cell series resistance compensation, in ohms. Whole cell series resistance compensation, in ohms.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["whole_cell_series_resistance_comp"] = Field( name: Literal["whole_cell_series_resistance_comp"] = Field(
"whole_cell_series_resistance_comp" "whole_cell_series_resistance_comp"
) )
@ -518,7 +489,6 @@ class VoltageClampStimulusSeries(PatchClampSeries):
Stimulus voltage applied during a voltage clamp recording. Stimulus voltage applied during a voltage clamp recording.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Stimulus voltage applied.""") data: str = Field(..., description="""Stimulus voltage applied.""")
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
@ -566,7 +536,6 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel):
Stimulus voltage applied. Stimulus voltage applied.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -580,7 +549,6 @@ class IntracellularElectrode(NWBContainer):
An intracellular electrode and its metadata. An intracellular electrode and its metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: str = Field( description: str = Field(
..., ...,
@ -612,7 +580,6 @@ class SweepTable(DynamicTable):
The table which groups different PatchClampSeries together. The table which groups different PatchClampSeries together.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
sweep_number: Optional[List[int] | int] = Field( sweep_number: Optional[List[int] | int] = Field(
default_factory=list, default_factory=list,
@ -648,34 +615,8 @@ class SweepTableSeriesIndex(VectorIndex):
Index for series. Index for series.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["series_index"] = Field("series_index") name: Literal["series_index"] = Field("series_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
description="""Reference to the target dataset that this index applies to.""", description="""Reference to the target dataset that this index applies to.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
PatchClampSeries.model_rebuild()
PatchClampSeriesData.model_rebuild()
CurrentClampSeries.model_rebuild()
CurrentClampSeriesData.model_rebuild()
IZeroClampSeries.model_rebuild()
CurrentClampStimulusSeries.model_rebuild()
CurrentClampStimulusSeriesData.model_rebuild()
VoltageClampSeries.model_rebuild()
VoltageClampSeriesData.model_rebuild()
VoltageClampSeriesCapacitanceFast.model_rebuild()
VoltageClampSeriesCapacitanceSlow.model_rebuild()
VoltageClampSeriesResistanceCompBandwidth.model_rebuild()
VoltageClampSeriesResistanceCompCorrection.model_rebuild()
VoltageClampSeriesResistanceCompPrediction.model_rebuild()
VoltageClampSeriesWholeCellCapacitanceComp.model_rebuild()
VoltageClampSeriesWholeCellSeriesResistanceComp.model_rebuild()
VoltageClampStimulusSeries.model_rebuild()
VoltageClampStimulusSeriesData.model_rebuild()
IntracellularElectrode.model_rebuild()
SweepTable.model_rebuild()
SweepTableSeriesIndex.model_rebuild()

View file

@ -27,7 +27,7 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync from .core_nwb_base import Image, TimeSeriesStartingTime, TimeSeries, TimeSeriesSync
metamodel_version = "None" metamodel_version = "None"
@ -35,13 +35,6 @@ version = "2.2.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class GrayscaleImage(Image): class GrayscaleImage(Image):
""" """
A grayscale image. A grayscale image.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -94,7 +80,6 @@ class RGBImage(Image):
A color image. A color image.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -116,7 +101,6 @@ class RGBAImage(Image):
A color image with transparency. A color image with transparency.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -138,7 +122,6 @@ class ImageSeries(TimeSeries):
General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z]. General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z].
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Optional[ data: Optional[
Union[ Union[
@ -191,7 +174,6 @@ class ImageSeriesExternalFile(ConfiguredBaseModel):
Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file. Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["external_file"] = Field("external_file") name: Literal["external_file"] = Field("external_file")
starting_frame: Optional[int] = Field( starting_frame: Optional[int] = Field(
None, None,
@ -205,7 +187,6 @@ class ImageMaskSeries(ImageSeries):
An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed. An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Optional[ data: Optional[
Union[ Union[
@ -258,7 +239,6 @@ class OpticalSeries(ImageSeries):
Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important. Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
distance: Optional[float] = Field( distance: Optional[float] = Field(
None, description="""Distance from camera/monitor to target/eye.""" None, description="""Distance from camera/monitor to target/eye."""
@ -327,7 +307,6 @@ class IndexSeries(TimeSeries):
Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed. Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], int] = Field( data: NDArray[Shape["* num_times"], int] = Field(
..., description="""Index of the frame in the referenced ImageSeries.""" ..., description="""Index of the frame in the referenced ImageSeries."""
@ -359,15 +338,3 @@ class IndexSeries(TimeSeries):
None, None,
description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""", description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
GrayscaleImage.model_rebuild()
RGBImage.model_rebuild()
RGBAImage.model_rebuild()
ImageSeries.model_rebuild()
ImageSeriesExternalFile.model_rebuild()
ImageMaskSeries.model_rebuild()
OpticalSeries.model_rebuild()
IndexSeries.model_rebuild()

View file

@ -32,13 +32,6 @@ version = "None"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -56,13 +49,3 @@ class ConfiguredBaseModel(BaseModel):
self.array[i] = value self.array[i] = value
else: else:
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model

View file

@ -27,15 +27,15 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync
from ...hdmf_common.v1_1_0.hdmf_common_table import ( from ...hdmf_common.v1_1_0.hdmf_common_table import (
DynamicTableRegion, DynamicTableRegion,
DynamicTable,
VectorIndex, VectorIndex,
DynamicTable,
VectorData, VectorData,
) )
from .core_nwb_base import TimeSeriesStartingTime, TimeSeries, TimeSeriesSync
from .core_nwb_ecephys import ElectrodeGroup from .core_nwb_ecephys import ElectrodeGroup
@ -44,13 +44,6 @@ version = "2.2.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -70,18 +63,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class AbstractFeatureSeries(TimeSeries): class AbstractFeatureSeries(TimeSeries):
""" """
Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical. Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Values of each feature at each time.""") data: str = Field(..., description="""Values of each feature at each time.""")
feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field( feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field(
@ -125,7 +111,6 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel):
Values of each feature at each time. Values of each feature at each time.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -144,7 +129,6 @@ class AnnotationSeries(TimeSeries):
Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way. Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], str] = Field( data: NDArray[Shape["* num_times"], str] = Field(
..., description="""Annotations made during an experiment.""" ..., description="""Annotations made during an experiment."""
@ -183,7 +167,6 @@ class IntervalSeries(TimeSeries):
Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way. Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], int] = Field( data: NDArray[Shape["* num_times"], int] = Field(
..., description="""Use values >0 if interval started, <0 if interval ended.""" ..., description="""Use values >0 if interval started, <0 if interval ended."""
@ -222,7 +205,6 @@ class DecompositionSeries(TimeSeries):
Spectral analysis of a time series, e.g. of an LFP or a speech signal. Spectral analysis of a time series, e.g. of an LFP or a speech signal.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Data decomposed into frequency bands.""") data: str = Field(..., description="""Data decomposed into frequency bands.""")
metric: str = Field( metric: str = Field(
@ -266,7 +248,6 @@ class DecompositionSeriesData(ConfiguredBaseModel):
Data decomposed into frequency bands. Data decomposed into frequency bands.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -282,7 +263,6 @@ class DecompositionSeriesBands(DynamicTable):
Table for describing the bands that this series was generated from. There should be one row in this table for each band. Table for describing the bands that this series was generated from. There should be one row in this table for each band.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["bands"] = Field("bands") name: Literal["bands"] = Field("bands")
band_name: Optional[List[str] | str] = Field( band_name: Optional[List[str] | str] = Field(
default_factory=list, description="""Name of the band, e.g. theta.""" default_factory=list, description="""Name of the band, e.g. theta."""
@ -322,7 +302,6 @@ class Units(DynamicTable):
Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times. Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("Units") name: str = Field("Units")
spike_times_index: Optional[str] = Field( spike_times_index: Optional[str] = Field(
None, description="""Index into the spike_times dataset.""" None, description="""Index into the spike_times dataset."""
@ -386,7 +365,6 @@ class UnitsSpikeTimesIndex(VectorIndex):
Index into the spike_times dataset. Index into the spike_times dataset.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["spike_times_index"] = Field("spike_times_index") name: Literal["spike_times_index"] = Field("spike_times_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -399,7 +377,6 @@ class UnitsSpikeTimes(VectorData):
Spike times for each unit. Spike times for each unit.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["spike_times"] = Field("spike_times") name: Literal["spike_times"] = Field("spike_times")
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, None,
@ -415,7 +392,6 @@ class UnitsObsIntervalsIndex(VectorIndex):
Index into the obs_intervals dataset. Index into the obs_intervals dataset.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["obs_intervals_index"] = Field("obs_intervals_index") name: Literal["obs_intervals_index"] = Field("obs_intervals_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -428,7 +404,6 @@ class UnitsElectrodesIndex(VectorIndex):
Index into electrodes. Index into electrodes.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes_index"] = Field("electrodes_index") name: Literal["electrodes_index"] = Field("electrodes_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -441,7 +416,6 @@ class UnitsElectrodes(DynamicTableRegion):
Electrode that each spike unit came from, specified using a DynamicTableRegion. Electrode that each spike unit came from, specified using a DynamicTableRegion.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -450,20 +424,3 @@ class UnitsElectrodes(DynamicTableRegion):
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of what this table region points to.""" None, description="""Description of what this table region points to."""
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
AbstractFeatureSeries.model_rebuild()
AbstractFeatureSeriesData.model_rebuild()
AnnotationSeries.model_rebuild()
IntervalSeries.model_rebuild()
DecompositionSeries.model_rebuild()
DecompositionSeriesData.model_rebuild()
DecompositionSeriesBands.model_rebuild()
Units.model_rebuild()
UnitsSpikeTimesIndex.model_rebuild()
UnitsSpikeTimes.model_rebuild()
UnitsObsIntervalsIndex.model_rebuild()
UnitsElectrodesIndex.model_rebuild()
UnitsElectrodes.model_rebuild()

View file

@ -29,9 +29,9 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeriesSync, TimeSeriesSync,
TimeSeries,
NWBContainer, NWBContainer,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeries,
) )
@ -40,13 +40,6 @@ version = "2.2.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -66,18 +59,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class OptogeneticSeries(TimeSeries): class OptogeneticSeries(TimeSeries):
""" """
An optogenetic stimulus. An optogenetic stimulus.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], float] = Field( data: NDArray[Shape["* num_times"], float] = Field(
..., description="""Applied power for optogenetic stimulus, in watts.""" ..., description="""Applied power for optogenetic stimulus, in watts."""
@ -116,7 +102,6 @@ class OptogeneticStimulusSite(NWBContainer):
A site of optogenetic stimulation. A site of optogenetic stimulation.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: str = Field(..., description="""Description of stimulation site.""") description: str = Field(..., description="""Description of stimulation site.""")
excitation_lambda: float = Field( excitation_lambda: float = Field(
@ -126,9 +111,3 @@ class OptogeneticStimulusSite(NWBContainer):
..., ...,
description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""", description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
OptogeneticSeries.model_rebuild()
OptogeneticStimulusSite.model_rebuild()

View file

@ -27,31 +27,24 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from ...hdmf_common.v1_1_0.hdmf_common_table import DynamicTable, DynamicTableRegion from ...hdmf_common.v1_1_0.hdmf_common_table import DynamicTableRegion, DynamicTable
from .core_nwb_image import ImageSeriesExternalFile, ImageSeries
from .core_nwb_base import ( from .core_nwb_base import (
NWBDataInterface,
TimeSeriesStartingTime,
TimeSeries,
NWBContainer, NWBContainer,
TimeSeriesStartingTime,
NWBDataInterface,
TimeSeries,
TimeSeriesSync, TimeSeriesSync,
) )
from .core_nwb_image import ImageSeries, ImageSeriesExternalFile
metamodel_version = "None" metamodel_version = "None"
version = "2.2.0" version = "2.2.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -71,18 +64,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class TwoPhotonSeries(ImageSeries): class TwoPhotonSeries(ImageSeries):
""" """
Image stack recorded over time from 2-photon microscope. Image stack recorded over time from 2-photon microscope.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""") pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""")
scan_line_rate: Optional[float] = Field( scan_line_rate: Optional[float] = Field(
@ -149,7 +135,6 @@ class RoiResponseSeries(TimeSeries):
ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Union[ data: Union[
NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times"], float],
@ -193,7 +178,6 @@ class RoiResponseSeriesRois(DynamicTableRegion):
DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries. DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["rois"] = Field("rois") name: Literal["rois"] = Field("rois")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -209,7 +193,6 @@ class DfOverF(NWBDataInterface):
dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes). dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field( children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -221,7 +204,6 @@ class Fluorescence(NWBDataInterface):
Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes). Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field( children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -233,7 +215,6 @@ class ImageSegmentation(NWBDataInterface):
Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them. Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[ children: Optional[
List[Union[BaseModel, DynamicTable]] | Union[BaseModel, DynamicTable] List[Union[BaseModel, DynamicTable]] | Union[BaseModel, DynamicTable]
] = Field(default_factory=dict) ] = Field(default_factory=dict)
@ -245,7 +226,6 @@ class ImagingPlane(NWBContainer):
An imaging plane and its metadata. An imaging plane and its metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of the imaging plane.""" None, description="""Description of the imaging plane."""
@ -287,7 +267,6 @@ class ImagingPlaneManifold(ConfiguredBaseModel):
DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing. DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["manifold"] = Field("manifold") name: Literal["manifold"] = Field("manifold")
conversion: Optional[float] = Field( conversion: Optional[float] = Field(
None, None,
@ -310,7 +289,6 @@ class ImagingPlaneOriginCoords(ConfiguredBaseModel):
Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma). Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["origin_coords"] = Field("origin_coords") name: Literal["origin_coords"] = Field("origin_coords")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -324,7 +302,6 @@ class ImagingPlaneGridSpacing(ConfiguredBaseModel):
Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid. Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["grid_spacing"] = Field("grid_spacing") name: Literal["grid_spacing"] = Field("grid_spacing")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -338,7 +315,6 @@ class OpticalChannel(NWBContainer):
An optical channel used to record from an imaging plane. An optical channel used to record from an imaging plane.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: str = Field(...) name: str = Field(...)
description: str = Field( description: str = Field(
..., description="""Description or other notes about the channel.""" ..., description="""Description or other notes about the channel."""
@ -353,24 +329,7 @@ class MotionCorrection(NWBDataInterface):
An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions). An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[NWBDataInterface] | NWBDataInterface] = Field( children: Optional[List[NWBDataInterface] | NWBDataInterface] = Field(
default_factory=dict default_factory=dict
) )
name: str = Field(...) name: str = Field(...)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
TwoPhotonSeries.model_rebuild()
RoiResponseSeries.model_rebuild()
RoiResponseSeriesRois.model_rebuild()
DfOverF.model_rebuild()
Fluorescence.model_rebuild()
ImageSegmentation.model_rebuild()
ImagingPlane.model_rebuild()
ImagingPlaneManifold.model_rebuild()
ImagingPlaneOriginCoords.model_rebuild()
ImagingPlaneGridSpacing.model_rebuild()
OpticalChannel.model_rebuild()
MotionCorrection.model_rebuild()

View file

@ -27,23 +27,16 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import NWBDataInterface, NWBData
from .core_nwb_image import GrayscaleImage from .core_nwb_image import GrayscaleImage
from .core_nwb_base import NWBData, NWBDataInterface
metamodel_version = "None" metamodel_version = "None"
version = "2.2.0" version = "2.2.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -63,18 +56,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class RetinotopyMap(NWBData): class RetinotopyMap(NWBData):
""" """
Abstract two-dimensional map of responses. Array structure: [num_rows][num_columns] Abstract two-dimensional map of responses. Array structure: [num_rows][num_columns]
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -91,7 +77,6 @@ class AxisMap(RetinotopyMap):
Abstract two-dimensional map of responses to stimuli along a single response axis (e.g. eccentricity) Abstract two-dimensional map of responses to stimuli along a single response axis (e.g. eccentricity)
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, description="""Unit that axis data is stored in (e.g., degrees).""" None, description="""Unit that axis data is stored in (e.g., degrees)."""
@ -111,7 +96,6 @@ class RetinotopyImage(GrayscaleImage):
Gray-scale image related to retinotopic mapping. Array structure: [num_rows][num_columns] Gray-scale image related to retinotopic mapping. Array structure: [num_rows][num_columns]
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
bits_per_pixel: Optional[int] = Field( bits_per_pixel: Optional[int] = Field(
None, None,
@ -147,7 +131,6 @@ class ImagingRetinotopy(NWBDataInterface):
Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. NOTE: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x). Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. NOTE: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("ImagingRetinotopy") name: str = Field("ImagingRetinotopy")
axis_1_phase_map: str = Field( axis_1_phase_map: str = Field(
..., description="""Phase response to stimulus on the first measured axis.""" ..., description="""Phase response to stimulus on the first measured axis."""
@ -185,7 +168,6 @@ class ImagingRetinotopyAxis1PhaseMap(AxisMap):
Phase response to stimulus on the first measured axis. Phase response to stimulus on the first measured axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_1_phase_map"] = Field("axis_1_phase_map") name: Literal["axis_1_phase_map"] = Field("axis_1_phase_map")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, description="""Unit that axis data is stored in (e.g., degrees).""" None, description="""Unit that axis data is stored in (e.g., degrees)."""
@ -205,7 +187,6 @@ class ImagingRetinotopyAxis1PowerMap(AxisMap):
Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_1_power_map"] = Field("axis_1_power_map") name: Literal["axis_1_power_map"] = Field("axis_1_power_map")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, description="""Unit that axis data is stored in (e.g., degrees).""" None, description="""Unit that axis data is stored in (e.g., degrees)."""
@ -225,7 +206,6 @@ class ImagingRetinotopyAxis2PhaseMap(AxisMap):
Phase response to stimulus on the second measured axis. Phase response to stimulus on the second measured axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_2_phase_map"] = Field("axis_2_phase_map") name: Literal["axis_2_phase_map"] = Field("axis_2_phase_map")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, description="""Unit that axis data is stored in (e.g., degrees).""" None, description="""Unit that axis data is stored in (e.g., degrees)."""
@ -245,7 +225,6 @@ class ImagingRetinotopyAxis2PowerMap(AxisMap):
Power response to stimulus on the second measured axis. Power response to stimulus on the second measured axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_2_power_map"] = Field("axis_2_power_map") name: Literal["axis_2_power_map"] = Field("axis_2_power_map")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, description="""Unit that axis data is stored in (e.g., degrees).""" None, description="""Unit that axis data is stored in (e.g., degrees)."""
@ -265,7 +244,6 @@ class ImagingRetinotopySignMap(RetinotopyMap):
Sine of the angle between the direction of the gradient in axis_1 and axis_2. Sine of the angle between the direction of the gradient in axis_1 and axis_2.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["sign_map"] = Field("sign_map") name: Literal["sign_map"] = Field("sign_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -282,7 +260,6 @@ class ImagingRetinotopyFocalDepthImage(RetinotopyImage):
Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns]. Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["focal_depth_image"] = Field("focal_depth_image") name: Literal["focal_depth_image"] = Field("focal_depth_image")
focal_depth: Optional[float] = Field( focal_depth: Optional[float] = Field(
None, description="""Focal depth offset, in meters.""" None, description="""Focal depth offset, in meters."""
@ -321,7 +298,6 @@ class ImagingRetinotopyVasculatureImage(RetinotopyImage):
Gray-scale anatomical image of cortical surface. Array structure: [rows][columns] Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["vasculature_image"] = Field("vasculature_image") name: Literal["vasculature_image"] = Field("vasculature_image")
bits_per_pixel: Optional[int] = Field( bits_per_pixel: Optional[int] = Field(
None, None,
@ -350,18 +326,3 @@ class ImagingRetinotopyVasculatureImage(RetinotopyImage):
NDArray[Shape["* x, * y, 4 r_g_b_a"], float], NDArray[Shape["* x, * y, 4 r_g_b_a"], float],
] ]
] = Field(None) ] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
RetinotopyMap.model_rebuild()
AxisMap.model_rebuild()
RetinotopyImage.model_rebuild()
ImagingRetinotopy.model_rebuild()
ImagingRetinotopyAxis1PhaseMap.model_rebuild()
ImagingRetinotopyAxis1PowerMap.model_rebuild()
ImagingRetinotopyAxis2PhaseMap.model_rebuild()
ImagingRetinotopyAxis2PowerMap.model_rebuild()
ImagingRetinotopySignMap.model_rebuild()
ImagingRetinotopyFocalDepthImage.model_rebuild()
ImagingRetinotopyVasculatureImage.model_rebuild()

View file

@ -194,13 +194,6 @@ version = "2.2.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -218,13 +211,3 @@ class ConfiguredBaseModel(BaseModel):
self.array[i] = value self.array[i] = value
else: else:
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model

View file

@ -27,7 +27,7 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from ...hdmf_common.v1_1_2.hdmf_common_table import Container, Data, DynamicTable from ...hdmf_common.v1_1_2.hdmf_common_table import Data, Container, DynamicTable
metamodel_version = "None" metamodel_version = "None"
@ -35,13 +35,6 @@ version = "2.2.1"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class NWBData(Data): class NWBData(Data):
""" """
An abstract data type for a dataset. An abstract data type for a dataset.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -81,7 +67,6 @@ class Image(NWBData):
An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)). An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -103,7 +88,6 @@ class NWBContainer(Container):
An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers. An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -112,7 +96,6 @@ class NWBDataInterface(NWBContainer):
An abstract data type for a generic container storing collections of data, as opposed to metadata. An abstract data type for a generic container storing collections of data, as opposed to metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -121,7 +104,6 @@ class TimeSeries(NWBDataInterface):
General purpose time series. General purpose time series.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of the time series.""" None, description="""Description of the time series."""
@ -161,7 +143,6 @@ class TimeSeriesData(ConfiguredBaseModel):
Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file. Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
conversion: Optional[float] = Field( conversion: Optional[float] = Field(
None, None,
@ -190,7 +171,6 @@ class TimeSeriesStartingTime(ConfiguredBaseModel):
Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute. Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["starting_time"] = Field("starting_time") name: Literal["starting_time"] = Field("starting_time")
rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""") rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""")
unit: Optional[str] = Field( unit: Optional[str] = Field(
@ -205,7 +185,6 @@ class TimeSeriesSync(ConfiguredBaseModel):
Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes. Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["sync"] = Field("sync") name: Literal["sync"] = Field("sync")
@ -214,7 +193,6 @@ class ProcessingModule(NWBContainer):
A collection of processed data. A collection of processed data.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[ children: Optional[
List[Union[BaseModel, DynamicTable, NWBDataInterface]] List[Union[BaseModel, DynamicTable, NWBDataInterface]]
| Union[BaseModel, DynamicTable, NWBDataInterface] | Union[BaseModel, DynamicTable, NWBDataInterface]
@ -227,7 +205,6 @@ class Images(NWBDataInterface):
A collection of images. A collection of images.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("Images") name: str = Field("Images")
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of this collection of images.""" None, description="""Description of this collection of images."""
@ -235,17 +212,3 @@ class Images(NWBDataInterface):
image: List[str] | str = Field( image: List[str] | str = Field(
default_factory=list, description="""Images stored in this collection.""" default_factory=list, description="""Images stored in this collection."""
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
NWBData.model_rebuild()
Image.model_rebuild()
NWBContainer.model_rebuild()
NWBDataInterface.model_rebuild()
TimeSeries.model_rebuild()
TimeSeriesData.model_rebuild()
TimeSeriesStartingTime.model_rebuild()
TimeSeriesSync.model_rebuild()
ProcessingModule.model_rebuild()
Images.model_rebuild()

View file

@ -28,9 +28,9 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesStartingTime, TimeSeriesStartingTime,
NWBDataInterface,
TimeSeriesSync, TimeSeriesSync,
) )
@ -42,13 +42,6 @@ version = "2.2.1"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -68,18 +61,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class SpatialSeries(TimeSeries): class SpatialSeries(TimeSeries):
""" """
Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values. Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field( data: str = Field(
..., ...,
@ -123,7 +109,6 @@ class SpatialSeriesData(ConfiguredBaseModel):
1-D or 2-D array storing position or direction relative to some reference frame. 1-D or 2-D array storing position or direction relative to some reference frame.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -142,7 +127,6 @@ class BehavioralEpochs(NWBDataInterface):
TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data. TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[IntervalSeries] | IntervalSeries] = Field( children: Optional[List[IntervalSeries] | IntervalSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -154,7 +138,6 @@ class BehavioralEvents(NWBDataInterface):
TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details. TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict) children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -164,7 +147,6 @@ class BehavioralTimeSeries(NWBDataInterface):
TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details. TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict) children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -174,7 +156,6 @@ class PupilTracking(NWBDataInterface):
Eye-tracking data, representing pupil size. Eye-tracking data, representing pupil size.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict) children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -184,7 +165,6 @@ class EyeTracking(NWBDataInterface):
Eye-tracking data, representing direction of gaze. Eye-tracking data, representing direction of gaze.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpatialSeries] | SpatialSeries] = Field( children: Optional[List[SpatialSeries] | SpatialSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -196,7 +176,6 @@ class CompassDirection(NWBDataInterface):
With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees. With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpatialSeries] | SpatialSeries] = Field( children: Optional[List[SpatialSeries] | SpatialSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -208,21 +187,7 @@ class Position(NWBDataInterface):
Position data, whether along the x, x/y or x/y/z axis. Position data, whether along the x, x/y or x/y/z axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpatialSeries] | SpatialSeries] = Field( children: Optional[List[SpatialSeries] | SpatialSeries] = Field(
default_factory=dict default_factory=dict
) )
name: str = Field(...) name: str = Field(...)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
SpatialSeries.model_rebuild()
SpatialSeriesData.model_rebuild()
BehavioralEpochs.model_rebuild()
BehavioralEvents.model_rebuild()
BehavioralTimeSeries.model_rebuild()
PupilTracking.model_rebuild()
EyeTracking.model_rebuild()
CompassDirection.model_rebuild()
Position.model_rebuild()

View file

@ -35,13 +35,6 @@ version = "2.2.1"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class Device(NWBContainer): class Device(NWBContainer):
""" """
Metadata about a data acquisition device, e.g., recording system, electrode, microscope. Metadata about a data acquisition device, e.g., recording system, electrode, microscope.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, None,
@ -81,8 +67,3 @@ class Device(NWBContainer):
manufacturer: Optional[str] = Field( manufacturer: Optional[str] = Field(
None, description="""The name of the manufacturer of the device.""" None, description="""The name of the manufacturer of the device."""
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
Device.model_rebuild()

View file

@ -27,29 +27,22 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from ...hdmf_common.v1_1_2.hdmf_common_table import DynamicTableRegion, DynamicTable
from .core_nwb_base import ( from .core_nwb_base import (
NWBContainer,
TimeSeriesStartingTime,
NWBDataInterface, NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesStartingTime,
NWBContainer,
TimeSeriesSync, TimeSeriesSync,
) )
from ...hdmf_common.v1_1_2.hdmf_common_table import DynamicTableRegion, DynamicTable
metamodel_version = "None" metamodel_version = "None"
version = "2.2.1" version = "2.2.1"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -69,18 +62,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class ElectricalSeries(TimeSeries): class ElectricalSeries(TimeSeries):
""" """
A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels. A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Union[ data: Union[
NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times"], float],
@ -129,7 +115,6 @@ class ElectricalSeriesElectrodes(DynamicTableRegion):
DynamicTableRegion pointer to the electrodes that this time series was generated from. DynamicTableRegion pointer to the electrodes that this time series was generated from.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -145,7 +130,6 @@ class SpikeEventSeries(ElectricalSeries):
Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode). Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Union[ data: Union[
NDArray[Shape["* num_events, * num_channels, * num_samples"], float], NDArray[Shape["* num_events, * num_channels, * num_samples"], float],
@ -193,7 +177,6 @@ class FeatureExtraction(NWBDataInterface):
Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("FeatureExtraction") name: str = Field("FeatureExtraction")
description: NDArray[Shape["* num_features"], str] = Field( description: NDArray[Shape["* num_features"], str] = Field(
..., ...,
@ -220,7 +203,6 @@ class FeatureExtractionElectrodes(DynamicTableRegion):
DynamicTableRegion pointer to the electrodes that this time series was generated from. DynamicTableRegion pointer to the electrodes that this time series was generated from.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -236,7 +218,6 @@ class EventDetection(NWBDataInterface):
Detected spike events from voltage trace(s). Detected spike events from voltage trace(s).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("EventDetection") name: str = Field("EventDetection")
detection_method: str = Field( detection_method: str = Field(
..., ...,
@ -256,7 +237,6 @@ class EventWaveform(NWBDataInterface):
Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition. Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpikeEventSeries] | SpikeEventSeries] = Field( children: Optional[List[SpikeEventSeries] | SpikeEventSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -268,7 +248,6 @@ class FilteredEphys(NWBDataInterface):
Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries. Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field( children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -280,7 +259,6 @@ class LFP(NWBDataInterface):
LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries description or comments field. LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries description or comments field.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field( children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -292,7 +270,6 @@ class ElectrodeGroup(NWBContainer):
A physical grouping of electrodes, e.g. a shank of an array. A physical grouping of electrodes, e.g. a shank of an array.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of this electrode group.""" None, description="""Description of this electrode group."""
@ -311,7 +288,6 @@ class ElectrodeGroupPosition(ConfiguredBaseModel):
stereotaxic or common framework coordinates stereotaxic or common framework coordinates
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["position"] = Field("position") name: Literal["position"] = Field("position")
x: Optional[float] = Field(None, description="""x coordinate""") x: Optional[float] = Field(None, description="""x coordinate""")
y: Optional[float] = Field(None, description="""y coordinate""") y: Optional[float] = Field(None, description="""y coordinate""")
@ -323,7 +299,6 @@ class ClusterWaveforms(NWBDataInterface):
DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one. DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("ClusterWaveforms") name: str = Field("ClusterWaveforms")
waveform_filtering: str = Field( waveform_filtering: str = Field(
..., description="""Filtering applied to data before generating mean/sd""" ..., description="""Filtering applied to data before generating mean/sd"""
@ -343,7 +318,6 @@ class Clustering(NWBDataInterface):
DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("Clustering") name: str = Field("Clustering")
description: str = Field( description: str = Field(
..., ...,
@ -360,20 +334,3 @@ class Clustering(NWBDataInterface):
..., ...,
description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""", description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ElectricalSeries.model_rebuild()
ElectricalSeriesElectrodes.model_rebuild()
SpikeEventSeries.model_rebuild()
FeatureExtraction.model_rebuild()
FeatureExtractionElectrodes.model_rebuild()
EventDetection.model_rebuild()
EventWaveform.model_rebuild()
FilteredEphys.model_rebuild()
LFP.model_rebuild()
ElectrodeGroup.model_rebuild()
ElectrodeGroupPosition.model_rebuild()
ClusterWaveforms.model_rebuild()
Clustering.model_rebuild()

View file

@ -27,27 +27,20 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import TimeSeries
from ...hdmf_common.v1_1_2.hdmf_common_table import ( from ...hdmf_common.v1_1_2.hdmf_common_table import (
DynamicTable,
VectorIndex, VectorIndex,
DynamicTable,
VectorData, VectorData,
) )
from .core_nwb_base import TimeSeries
metamodel_version = "None" metamodel_version = "None"
version = "2.2.1" version = "2.2.1"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -67,18 +60,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class TimeIntervals(DynamicTable): class TimeIntervals(DynamicTable):
""" """
A container for aggregating epoch data and the TimeSeries that each epoch applies to. A container for aggregating epoch data and the TimeSeries that each epoch applies to.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
start_time: Optional[List[float] | float] = Field( start_time: Optional[List[float] | float] = Field(
default_factory=list, description="""Start time of epoch, in seconds.""" default_factory=list, description="""Start time of epoch, in seconds."""
@ -122,7 +108,6 @@ class TimeIntervalsTagsIndex(VectorIndex):
Index for tags. Index for tags.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["tags_index"] = Field("tags_index") name: Literal["tags_index"] = Field("tags_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -135,7 +120,6 @@ class TimeIntervalsTimeseries(VectorData):
An index into a TimeSeries object. An index into a TimeSeries object.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["timeseries"] = Field("timeseries") name: Literal["timeseries"] = Field("timeseries")
idx_start: Optional[int] = Field( idx_start: Optional[int] = Field(
None, None,
@ -158,17 +142,8 @@ class TimeIntervalsTimeseriesIndex(VectorIndex):
Index for timeseries. Index for timeseries.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["timeseries_index"] = Field("timeseries_index") name: Literal["timeseries_index"] = Field("timeseries_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
description="""Reference to the target dataset that this index applies to.""", description="""Reference to the target dataset that this index applies to.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
TimeIntervals.model_rebuild()
TimeIntervalsTagsIndex.model_rebuild()
TimeIntervalsTimeseries.model_rebuild()
TimeIntervalsTimeseriesIndex.model_rebuild()

View file

@ -27,27 +27,27 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_ophys import ImagingPlane from .core_nwb_icephys import SweepTable, IntracellularElectrode
from .core_nwb_base import TimeSeries, NWBDataInterface, ProcessingModule, NWBContainer
from .core_nwb_epoch import TimeIntervals from .core_nwb_epoch import TimeIntervals
from ...hdmf_common.v1_1_2.hdmf_common_table import ( from .core_nwb_ecephys import ElectrodeGroup
DynamicTable,
VectorData,
VectorIndex,
)
from .core_nwb_icephys import IntracellularElectrode, SweepTable from .core_nwb_base import NWBContainer, ProcessingModule, NWBDataInterface, TimeSeries
from .core_nwb_ogen import OptogeneticStimulusSite from .core_nwb_device import Device
from .core_nwb_misc import Units from .core_nwb_misc import Units
from .core_nwb_ecephys import ElectrodeGroup from .core_nwb_ogen import OptogeneticStimulusSite
from .core_nwb_device import Device from ...hdmf_common.v1_1_2.hdmf_common_table import (
VectorIndex,
DynamicTable,
VectorData,
)
from .core_nwb_ophys import ImagingPlane
metamodel_version = "None" metamodel_version = "None"
@ -55,13 +55,6 @@ version = "2.2.1"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -81,18 +74,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class NWBFile(NWBContainer): class NWBFile(NWBContainer):
""" """
An NWB:N file storing cellular-based neurophysiology data from a single experimental session. An NWB:N file storing cellular-based neurophysiology data from a single experimental session.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: Literal["root"] = Field("root") name: Literal["root"] = Field("root")
nwb_version: Optional[str] = Field( nwb_version: Optional[str] = Field(
None, None,
@ -163,7 +149,6 @@ class NWBFileStimulus(ConfiguredBaseModel):
Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file. Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["stimulus"] = Field("stimulus") name: Literal["stimulus"] = Field("stimulus")
presentation: Optional[List[TimeSeries] | TimeSeries] = Field( presentation: Optional[List[TimeSeries] | TimeSeries] = Field(
default_factory=dict, description="""Stimuli presented during the experiment.""" default_factory=dict, description="""Stimuli presented during the experiment."""
@ -179,7 +164,6 @@ class NWBFileGeneral(ConfiguredBaseModel):
Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them. Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["general"] = Field("general") name: Literal["general"] = Field("general")
data_collection: Optional[str] = Field( data_collection: Optional[str] = Field(
None, description="""Notes about data collection and analysis.""" None, description="""Notes about data collection and analysis."""
@ -269,7 +253,6 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel):
Script file or link to public source code used to create this NWB file. Script file or link to public source code used to create this NWB file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["source_script"] = Field("source_script") name: Literal["source_script"] = Field("source_script")
file_name: Optional[str] = Field(None, description="""Name of script file.""") file_name: Optional[str] = Field(None, description="""Name of script file.""")
value: str = Field(...) value: str = Field(...)
@ -280,7 +263,6 @@ class Subject(NWBContainer):
Information about the animal or person from which the data was measured. Information about the animal or person from which the data was measured.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["subject"] = Field("subject") name: Literal["subject"] = Field("subject")
age: Optional[str] = Field( age: Optional[str] = Field(
None, None,
@ -314,7 +296,6 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel):
Metadata related to extracellular electrophysiology. Metadata related to extracellular electrophysiology.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["extracellular_ephys"] = Field("extracellular_ephys") name: Literal["extracellular_ephys"] = Field("extracellular_ephys")
electrode_group: Optional[List[str] | str] = Field( electrode_group: Optional[List[str] | str] = Field(
default_factory=list, description="""Physical group of electrodes.""" default_factory=list, description="""Physical group of electrodes."""
@ -330,7 +311,6 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
A table of all electrodes (i.e. channels) used for recording. A table of all electrodes (i.e. channels) used for recording.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
x: Optional[List[float] | float] = Field( x: Optional[List[float] | float] = Field(
default_factory=list, default_factory=list,
@ -400,7 +380,6 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel):
Metadata related to intracellular electrophysiology. Metadata related to intracellular electrophysiology.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["intracellular_ephys"] = Field("intracellular_ephys") name: Literal["intracellular_ephys"] = Field("intracellular_ephys")
filtering: Optional[str] = Field( filtering: Optional[str] = Field(
None, None,
@ -413,15 +392,3 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel):
None, None,
description="""The table which groups different PatchClampSeries together.""", description="""The table which groups different PatchClampSeries together.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
NWBFile.model_rebuild()
NWBFileStimulus.model_rebuild()
NWBFileGeneral.model_rebuild()
NWBFileGeneralSourceScript.model_rebuild()
Subject.model_rebuild()
NWBFileGeneralExtracellularEphys.model_rebuild()
NWBFileGeneralExtracellularEphysElectrodes.model_rebuild()
NWBFileGeneralIntracellularEphys.model_rebuild()

View file

@ -28,16 +28,16 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeries, NWBContainer,
TimeSeriesSync, TimeSeriesSync,
TimeSeriesStartingTime, TimeSeriesStartingTime,
NWBContainer, TimeSeries,
) )
from ...hdmf_common.v1_1_2.hdmf_common_table import ( from ...hdmf_common.v1_1_2.hdmf_common_table import (
VectorIndex,
DynamicTable, DynamicTable,
VectorData, VectorData,
VectorIndex,
) )
@ -46,13 +46,6 @@ version = "2.2.1"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -72,18 +65,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class PatchClampSeries(TimeSeries): class PatchClampSeries(TimeSeries):
""" """
An abstract base class for patch-clamp data - stimulus or response, current or voltage. An abstract base class for patch-clamp data - stimulus or response, current or voltage.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
None, description="""Protocol/stimulus name for this patch-clamp dataset.""" None, description="""Protocol/stimulus name for this patch-clamp dataset."""
@ -131,7 +117,6 @@ class PatchClampSeriesData(ConfiguredBaseModel):
Recorded voltage or current. Recorded voltage or current.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -145,7 +130,6 @@ class CurrentClampSeries(PatchClampSeries):
Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected. Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Recorded voltage.""") data: str = Field(..., description="""Recorded voltage.""")
bias_current: Optional[float] = Field( bias_current: Optional[float] = Field(
@ -202,7 +186,6 @@ class CurrentClampSeriesData(ConfiguredBaseModel):
Recorded voltage. Recorded voltage.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -216,7 +199,6 @@ class IZeroClampSeries(CurrentClampSeries):
Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell. Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
bias_current: float = Field( bias_current: float = Field(
..., description="""Bias current, in amps, fixed to 0.0.""" ..., description="""Bias current, in amps, fixed to 0.0."""
@ -273,7 +255,6 @@ class CurrentClampStimulusSeries(PatchClampSeries):
Stimulus current applied during current clamp recording. Stimulus current applied during current clamp recording.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Stimulus current applied.""") data: str = Field(..., description="""Stimulus current applied.""")
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
@ -321,7 +302,6 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel):
Stimulus current applied. Stimulus current applied.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -335,7 +315,6 @@ class VoltageClampSeries(PatchClampSeries):
Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected. Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Recorded current.""") data: str = Field(..., description="""Recorded current.""")
capacitance_fast: Optional[str] = Field( capacitance_fast: Optional[str] = Field(
@ -404,7 +383,6 @@ class VoltageClampSeriesData(ConfiguredBaseModel):
Recorded current. Recorded current.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -418,7 +396,6 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel):
Fast capacitance, in farads. Fast capacitance, in farads.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["capacitance_fast"] = Field("capacitance_fast") name: Literal["capacitance_fast"] = Field("capacitance_fast")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -432,7 +409,6 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel):
Slow capacitance, in farads. Slow capacitance, in farads.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["capacitance_slow"] = Field("capacitance_slow") name: Literal["capacitance_slow"] = Field("capacitance_slow")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -446,7 +422,6 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel):
Resistance compensation bandwidth, in hertz. Resistance compensation bandwidth, in hertz.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["resistance_comp_bandwidth"] = Field("resistance_comp_bandwidth") name: Literal["resistance_comp_bandwidth"] = Field("resistance_comp_bandwidth")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -460,7 +435,6 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel):
Resistance compensation correction, in percent. Resistance compensation correction, in percent.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["resistance_comp_correction"] = Field("resistance_comp_correction") name: Literal["resistance_comp_correction"] = Field("resistance_comp_correction")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -474,7 +448,6 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel):
Resistance compensation prediction, in percent. Resistance compensation prediction, in percent.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["resistance_comp_prediction"] = Field("resistance_comp_prediction") name: Literal["resistance_comp_prediction"] = Field("resistance_comp_prediction")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -488,7 +461,6 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel):
Whole cell capacitance compensation, in farads. Whole cell capacitance compensation, in farads.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["whole_cell_capacitance_comp"] = Field("whole_cell_capacitance_comp") name: Literal["whole_cell_capacitance_comp"] = Field("whole_cell_capacitance_comp")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -502,7 +474,6 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel):
Whole cell series resistance compensation, in ohms. Whole cell series resistance compensation, in ohms.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["whole_cell_series_resistance_comp"] = Field( name: Literal["whole_cell_series_resistance_comp"] = Field(
"whole_cell_series_resistance_comp" "whole_cell_series_resistance_comp"
) )
@ -518,7 +489,6 @@ class VoltageClampStimulusSeries(PatchClampSeries):
Stimulus voltage applied during a voltage clamp recording. Stimulus voltage applied during a voltage clamp recording.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Stimulus voltage applied.""") data: str = Field(..., description="""Stimulus voltage applied.""")
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
@ -566,7 +536,6 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel):
Stimulus voltage applied. Stimulus voltage applied.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -580,7 +549,6 @@ class IntracellularElectrode(NWBContainer):
An intracellular electrode and its metadata. An intracellular electrode and its metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: str = Field( description: str = Field(
..., ...,
@ -612,7 +580,6 @@ class SweepTable(DynamicTable):
The table which groups different PatchClampSeries together. The table which groups different PatchClampSeries together.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
sweep_number: Optional[List[int] | int] = Field( sweep_number: Optional[List[int] | int] = Field(
default_factory=list, default_factory=list,
@ -648,34 +615,8 @@ class SweepTableSeriesIndex(VectorIndex):
Index for series. Index for series.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["series_index"] = Field("series_index") name: Literal["series_index"] = Field("series_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
description="""Reference to the target dataset that this index applies to.""", description="""Reference to the target dataset that this index applies to.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
PatchClampSeries.model_rebuild()
PatchClampSeriesData.model_rebuild()
CurrentClampSeries.model_rebuild()
CurrentClampSeriesData.model_rebuild()
IZeroClampSeries.model_rebuild()
CurrentClampStimulusSeries.model_rebuild()
CurrentClampStimulusSeriesData.model_rebuild()
VoltageClampSeries.model_rebuild()
VoltageClampSeriesData.model_rebuild()
VoltageClampSeriesCapacitanceFast.model_rebuild()
VoltageClampSeriesCapacitanceSlow.model_rebuild()
VoltageClampSeriesResistanceCompBandwidth.model_rebuild()
VoltageClampSeriesResistanceCompCorrection.model_rebuild()
VoltageClampSeriesResistanceCompPrediction.model_rebuild()
VoltageClampSeriesWholeCellCapacitanceComp.model_rebuild()
VoltageClampSeriesWholeCellSeriesResistanceComp.model_rebuild()
VoltageClampStimulusSeries.model_rebuild()
VoltageClampStimulusSeriesData.model_rebuild()
IntracellularElectrode.model_rebuild()
SweepTable.model_rebuild()
SweepTableSeriesIndex.model_rebuild()

View file

@ -27,7 +27,7 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync from .core_nwb_base import Image, TimeSeriesStartingTime, TimeSeries, TimeSeriesSync
metamodel_version = "None" metamodel_version = "None"
@ -35,13 +35,6 @@ version = "2.2.1"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class GrayscaleImage(Image): class GrayscaleImage(Image):
""" """
A grayscale image. A grayscale image.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -94,7 +80,6 @@ class RGBImage(Image):
A color image. A color image.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -116,7 +101,6 @@ class RGBAImage(Image):
A color image with transparency. A color image with transparency.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -138,7 +122,6 @@ class ImageSeries(TimeSeries):
General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z]. General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z].
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Optional[ data: Optional[
Union[ Union[
@ -191,7 +174,6 @@ class ImageSeriesExternalFile(ConfiguredBaseModel):
Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file. Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["external_file"] = Field("external_file") name: Literal["external_file"] = Field("external_file")
starting_frame: Optional[int] = Field( starting_frame: Optional[int] = Field(
None, None,
@ -205,7 +187,6 @@ class ImageMaskSeries(ImageSeries):
An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed. An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Optional[ data: Optional[
Union[ Union[
@ -258,7 +239,6 @@ class OpticalSeries(ImageSeries):
Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important. Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
distance: Optional[float] = Field( distance: Optional[float] = Field(
None, description="""Distance from camera/monitor to target/eye.""" None, description="""Distance from camera/monitor to target/eye."""
@ -327,7 +307,6 @@ class IndexSeries(TimeSeries):
Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed. Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], int] = Field( data: NDArray[Shape["* num_times"], int] = Field(
..., description="""Index of the frame in the referenced ImageSeries.""" ..., description="""Index of the frame in the referenced ImageSeries."""
@ -359,15 +338,3 @@ class IndexSeries(TimeSeries):
None, None,
description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""", description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
GrayscaleImage.model_rebuild()
RGBImage.model_rebuild()
RGBAImage.model_rebuild()
ImageSeries.model_rebuild()
ImageSeriesExternalFile.model_rebuild()
ImageMaskSeries.model_rebuild()
OpticalSeries.model_rebuild()
IndexSeries.model_rebuild()

View file

@ -32,13 +32,6 @@ version = "None"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -56,13 +49,3 @@ class ConfiguredBaseModel(BaseModel):
self.array[i] = value self.array[i] = value
else: else:
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model

View file

@ -27,15 +27,15 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync
from ...hdmf_common.v1_1_2.hdmf_common_table import ( from ...hdmf_common.v1_1_2.hdmf_common_table import (
DynamicTableRegion, DynamicTableRegion,
DynamicTable,
VectorIndex, VectorIndex,
DynamicTable,
VectorData, VectorData,
) )
from .core_nwb_base import TimeSeriesStartingTime, TimeSeries, TimeSeriesSync
from .core_nwb_ecephys import ElectrodeGroup from .core_nwb_ecephys import ElectrodeGroup
@ -44,13 +44,6 @@ version = "2.2.1"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -70,18 +63,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class AbstractFeatureSeries(TimeSeries): class AbstractFeatureSeries(TimeSeries):
""" """
Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical. Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Values of each feature at each time.""") data: str = Field(..., description="""Values of each feature at each time.""")
feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field( feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field(
@ -125,7 +111,6 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel):
Values of each feature at each time. Values of each feature at each time.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -144,7 +129,6 @@ class AnnotationSeries(TimeSeries):
Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way. Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], str] = Field( data: NDArray[Shape["* num_times"], str] = Field(
..., description="""Annotations made during an experiment.""" ..., description="""Annotations made during an experiment."""
@ -183,7 +167,6 @@ class IntervalSeries(TimeSeries):
Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way. Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], int] = Field( data: NDArray[Shape["* num_times"], int] = Field(
..., description="""Use values >0 if interval started, <0 if interval ended.""" ..., description="""Use values >0 if interval started, <0 if interval ended."""
@ -222,7 +205,6 @@ class DecompositionSeries(TimeSeries):
Spectral analysis of a time series, e.g. of an LFP or a speech signal. Spectral analysis of a time series, e.g. of an LFP or a speech signal.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Data decomposed into frequency bands.""") data: str = Field(..., description="""Data decomposed into frequency bands.""")
metric: str = Field( metric: str = Field(
@ -266,7 +248,6 @@ class DecompositionSeriesData(ConfiguredBaseModel):
Data decomposed into frequency bands. Data decomposed into frequency bands.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -282,7 +263,6 @@ class DecompositionSeriesBands(DynamicTable):
Table for describing the bands that this series was generated from. There should be one row in this table for each band. Table for describing the bands that this series was generated from. There should be one row in this table for each band.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["bands"] = Field("bands") name: Literal["bands"] = Field("bands")
band_name: Optional[List[str] | str] = Field( band_name: Optional[List[str] | str] = Field(
default_factory=list, description="""Name of the band, e.g. theta.""" default_factory=list, description="""Name of the band, e.g. theta."""
@ -322,7 +302,6 @@ class Units(DynamicTable):
Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times. Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("Units") name: str = Field("Units")
spike_times_index: Optional[str] = Field( spike_times_index: Optional[str] = Field(
None, description="""Index into the spike_times dataset.""" None, description="""Index into the spike_times dataset."""
@ -386,7 +365,6 @@ class UnitsSpikeTimesIndex(VectorIndex):
Index into the spike_times dataset. Index into the spike_times dataset.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["spike_times_index"] = Field("spike_times_index") name: Literal["spike_times_index"] = Field("spike_times_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -399,7 +377,6 @@ class UnitsSpikeTimes(VectorData):
Spike times for each unit. Spike times for each unit.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["spike_times"] = Field("spike_times") name: Literal["spike_times"] = Field("spike_times")
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, None,
@ -415,7 +392,6 @@ class UnitsObsIntervalsIndex(VectorIndex):
Index into the obs_intervals dataset. Index into the obs_intervals dataset.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["obs_intervals_index"] = Field("obs_intervals_index") name: Literal["obs_intervals_index"] = Field("obs_intervals_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -428,7 +404,6 @@ class UnitsElectrodesIndex(VectorIndex):
Index into electrodes. Index into electrodes.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes_index"] = Field("electrodes_index") name: Literal["electrodes_index"] = Field("electrodes_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -441,7 +416,6 @@ class UnitsElectrodes(DynamicTableRegion):
Electrode that each spike unit came from, specified using a DynamicTableRegion. Electrode that each spike unit came from, specified using a DynamicTableRegion.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -450,20 +424,3 @@ class UnitsElectrodes(DynamicTableRegion):
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of what this table region points to.""" None, description="""Description of what this table region points to."""
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
AbstractFeatureSeries.model_rebuild()
AbstractFeatureSeriesData.model_rebuild()
AnnotationSeries.model_rebuild()
IntervalSeries.model_rebuild()
DecompositionSeries.model_rebuild()
DecompositionSeriesData.model_rebuild()
DecompositionSeriesBands.model_rebuild()
Units.model_rebuild()
UnitsSpikeTimesIndex.model_rebuild()
UnitsSpikeTimes.model_rebuild()
UnitsObsIntervalsIndex.model_rebuild()
UnitsElectrodesIndex.model_rebuild()
UnitsElectrodes.model_rebuild()

View file

@ -29,9 +29,9 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeriesSync, TimeSeriesSync,
TimeSeries,
NWBContainer, NWBContainer,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeries,
) )
@ -40,13 +40,6 @@ version = "2.2.1"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -66,18 +59,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class OptogeneticSeries(TimeSeries): class OptogeneticSeries(TimeSeries):
""" """
An optogenetic stimulus. An optogenetic stimulus.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], float] = Field( data: NDArray[Shape["* num_times"], float] = Field(
..., description="""Applied power for optogenetic stimulus, in watts.""" ..., description="""Applied power for optogenetic stimulus, in watts."""
@ -116,7 +102,6 @@ class OptogeneticStimulusSite(NWBContainer):
A site of optogenetic stimulation. A site of optogenetic stimulation.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: str = Field(..., description="""Description of stimulation site.""") description: str = Field(..., description="""Description of stimulation site.""")
excitation_lambda: float = Field( excitation_lambda: float = Field(
@ -126,9 +111,3 @@ class OptogeneticStimulusSite(NWBContainer):
..., ...,
description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""", description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
OptogeneticSeries.model_rebuild()
OptogeneticStimulusSite.model_rebuild()

View file

@ -27,31 +27,24 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from ...hdmf_common.v1_1_2.hdmf_common_table import DynamicTable, DynamicTableRegion from ...hdmf_common.v1_1_2.hdmf_common_table import DynamicTableRegion, DynamicTable
from .core_nwb_image import ImageSeriesExternalFile, ImageSeries
from .core_nwb_base import ( from .core_nwb_base import (
NWBDataInterface,
TimeSeriesStartingTime,
TimeSeries,
NWBContainer, NWBContainer,
TimeSeriesStartingTime,
NWBDataInterface,
TimeSeries,
TimeSeriesSync, TimeSeriesSync,
) )
from .core_nwb_image import ImageSeries, ImageSeriesExternalFile
metamodel_version = "None" metamodel_version = "None"
version = "2.2.1" version = "2.2.1"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -71,18 +64,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class TwoPhotonSeries(ImageSeries): class TwoPhotonSeries(ImageSeries):
""" """
Image stack recorded over time from 2-photon microscope. Image stack recorded over time from 2-photon microscope.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""") pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""")
scan_line_rate: Optional[float] = Field( scan_line_rate: Optional[float] = Field(
@ -149,7 +135,6 @@ class RoiResponseSeries(TimeSeries):
ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Union[ data: Union[
NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times"], float],
@ -193,7 +178,6 @@ class RoiResponseSeriesRois(DynamicTableRegion):
DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries. DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["rois"] = Field("rois") name: Literal["rois"] = Field("rois")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -209,7 +193,6 @@ class DfOverF(NWBDataInterface):
dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes). dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field( children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -221,7 +204,6 @@ class Fluorescence(NWBDataInterface):
Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes). Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field( children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -233,7 +215,6 @@ class ImageSegmentation(NWBDataInterface):
Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them. Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[ children: Optional[
List[Union[BaseModel, DynamicTable]] | Union[BaseModel, DynamicTable] List[Union[BaseModel, DynamicTable]] | Union[BaseModel, DynamicTable]
] = Field(default_factory=dict) ] = Field(default_factory=dict)
@ -245,7 +226,6 @@ class ImagingPlane(NWBContainer):
An imaging plane and its metadata. An imaging plane and its metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of the imaging plane.""" None, description="""Description of the imaging plane."""
@ -287,7 +267,6 @@ class ImagingPlaneManifold(ConfiguredBaseModel):
DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing. DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["manifold"] = Field("manifold") name: Literal["manifold"] = Field("manifold")
conversion: Optional[float] = Field( conversion: Optional[float] = Field(
None, None,
@ -310,7 +289,6 @@ class ImagingPlaneOriginCoords(ConfiguredBaseModel):
Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma). Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["origin_coords"] = Field("origin_coords") name: Literal["origin_coords"] = Field("origin_coords")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -324,7 +302,6 @@ class ImagingPlaneGridSpacing(ConfiguredBaseModel):
Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid. Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["grid_spacing"] = Field("grid_spacing") name: Literal["grid_spacing"] = Field("grid_spacing")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -338,7 +315,6 @@ class OpticalChannel(NWBContainer):
An optical channel used to record from an imaging plane. An optical channel used to record from an imaging plane.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: str = Field(...) name: str = Field(...)
description: str = Field( description: str = Field(
..., description="""Description or other notes about the channel.""" ..., description="""Description or other notes about the channel."""
@ -353,24 +329,7 @@ class MotionCorrection(NWBDataInterface):
An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions). An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[NWBDataInterface] | NWBDataInterface] = Field( children: Optional[List[NWBDataInterface] | NWBDataInterface] = Field(
default_factory=dict default_factory=dict
) )
name: str = Field(...) name: str = Field(...)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
TwoPhotonSeries.model_rebuild()
RoiResponseSeries.model_rebuild()
RoiResponseSeriesRois.model_rebuild()
DfOverF.model_rebuild()
Fluorescence.model_rebuild()
ImageSegmentation.model_rebuild()
ImagingPlane.model_rebuild()
ImagingPlaneManifold.model_rebuild()
ImagingPlaneOriginCoords.model_rebuild()
ImagingPlaneGridSpacing.model_rebuild()
OpticalChannel.model_rebuild()
MotionCorrection.model_rebuild()

View file

@ -27,23 +27,16 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import NWBDataInterface, NWBData
from .core_nwb_image import GrayscaleImage from .core_nwb_image import GrayscaleImage
from .core_nwb_base import NWBData, NWBDataInterface
metamodel_version = "None" metamodel_version = "None"
version = "2.2.1" version = "2.2.1"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -63,18 +56,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class RetinotopyMap(NWBData): class RetinotopyMap(NWBData):
""" """
Abstract two-dimensional map of responses. Array structure: [num_rows][num_columns] Abstract two-dimensional map of responses. Array structure: [num_rows][num_columns]
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -91,7 +77,6 @@ class AxisMap(RetinotopyMap):
Abstract two-dimensional map of responses to stimuli along a single response axis (e.g. eccentricity) Abstract two-dimensional map of responses to stimuli along a single response axis (e.g. eccentricity)
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, description="""Unit that axis data is stored in (e.g., degrees).""" None, description="""Unit that axis data is stored in (e.g., degrees)."""
@ -111,7 +96,6 @@ class RetinotopyImage(GrayscaleImage):
Gray-scale image related to retinotopic mapping. Array structure: [num_rows][num_columns] Gray-scale image related to retinotopic mapping. Array structure: [num_rows][num_columns]
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
bits_per_pixel: Optional[int] = Field( bits_per_pixel: Optional[int] = Field(
None, None,
@ -147,7 +131,6 @@ class ImagingRetinotopy(NWBDataInterface):
Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. NOTE: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x). Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. NOTE: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("ImagingRetinotopy") name: str = Field("ImagingRetinotopy")
axis_1_phase_map: str = Field( axis_1_phase_map: str = Field(
..., description="""Phase response to stimulus on the first measured axis.""" ..., description="""Phase response to stimulus on the first measured axis."""
@ -185,7 +168,6 @@ class ImagingRetinotopyAxis1PhaseMap(AxisMap):
Phase response to stimulus on the first measured axis. Phase response to stimulus on the first measured axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_1_phase_map"] = Field("axis_1_phase_map") name: Literal["axis_1_phase_map"] = Field("axis_1_phase_map")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, description="""Unit that axis data is stored in (e.g., degrees).""" None, description="""Unit that axis data is stored in (e.g., degrees)."""
@ -205,7 +187,6 @@ class ImagingRetinotopyAxis1PowerMap(AxisMap):
Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_1_power_map"] = Field("axis_1_power_map") name: Literal["axis_1_power_map"] = Field("axis_1_power_map")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, description="""Unit that axis data is stored in (e.g., degrees).""" None, description="""Unit that axis data is stored in (e.g., degrees)."""
@ -225,7 +206,6 @@ class ImagingRetinotopyAxis2PhaseMap(AxisMap):
Phase response to stimulus on the second measured axis. Phase response to stimulus on the second measured axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_2_phase_map"] = Field("axis_2_phase_map") name: Literal["axis_2_phase_map"] = Field("axis_2_phase_map")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, description="""Unit that axis data is stored in (e.g., degrees).""" None, description="""Unit that axis data is stored in (e.g., degrees)."""
@ -245,7 +225,6 @@ class ImagingRetinotopyAxis2PowerMap(AxisMap):
Power response to stimulus on the second measured axis. Power response to stimulus on the second measured axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_2_power_map"] = Field("axis_2_power_map") name: Literal["axis_2_power_map"] = Field("axis_2_power_map")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, description="""Unit that axis data is stored in (e.g., degrees).""" None, description="""Unit that axis data is stored in (e.g., degrees)."""
@ -265,7 +244,6 @@ class ImagingRetinotopySignMap(RetinotopyMap):
Sine of the angle between the direction of the gradient in axis_1 and axis_2. Sine of the angle between the direction of the gradient in axis_1 and axis_2.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["sign_map"] = Field("sign_map") name: Literal["sign_map"] = Field("sign_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -282,7 +260,6 @@ class ImagingRetinotopyFocalDepthImage(RetinotopyImage):
Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns]. Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["focal_depth_image"] = Field("focal_depth_image") name: Literal["focal_depth_image"] = Field("focal_depth_image")
focal_depth: Optional[float] = Field( focal_depth: Optional[float] = Field(
None, description="""Focal depth offset, in meters.""" None, description="""Focal depth offset, in meters."""
@ -321,7 +298,6 @@ class ImagingRetinotopyVasculatureImage(RetinotopyImage):
Gray-scale anatomical image of cortical surface. Array structure: [rows][columns] Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["vasculature_image"] = Field("vasculature_image") name: Literal["vasculature_image"] = Field("vasculature_image")
bits_per_pixel: Optional[int] = Field( bits_per_pixel: Optional[int] = Field(
None, None,
@ -350,18 +326,3 @@ class ImagingRetinotopyVasculatureImage(RetinotopyImage):
NDArray[Shape["* x, * y, 4 r_g_b_a"], float], NDArray[Shape["* x, * y, 4 r_g_b_a"], float],
] ]
] = Field(None) ] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
RetinotopyMap.model_rebuild()
AxisMap.model_rebuild()
RetinotopyImage.model_rebuild()
ImagingRetinotopy.model_rebuild()
ImagingRetinotopyAxis1PhaseMap.model_rebuild()
ImagingRetinotopyAxis1PowerMap.model_rebuild()
ImagingRetinotopyAxis2PhaseMap.model_rebuild()
ImagingRetinotopyAxis2PowerMap.model_rebuild()
ImagingRetinotopySignMap.model_rebuild()
ImagingRetinotopyFocalDepthImage.model_rebuild()
ImagingRetinotopyVasculatureImage.model_rebuild()

View file

@ -194,13 +194,6 @@ version = "2.2.1"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -218,13 +211,3 @@ class ConfiguredBaseModel(BaseModel):
self.array[i] = value self.array[i] = value
else: else:
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model

View file

@ -27,7 +27,7 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from ...hdmf_common.v1_1_3.hdmf_common_table import Container, Data, DynamicTable from ...hdmf_common.v1_1_3.hdmf_common_table import Data, Container, DynamicTable
metamodel_version = "None" metamodel_version = "None"
@ -35,13 +35,6 @@ version = "2.2.2"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class NWBData(Data): class NWBData(Data):
""" """
An abstract data type for a dataset. An abstract data type for a dataset.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -81,7 +67,6 @@ class Image(NWBData):
An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)). An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -103,7 +88,6 @@ class NWBContainer(Container):
An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers. An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -112,7 +96,6 @@ class NWBDataInterface(NWBContainer):
An abstract data type for a generic container storing collections of data, as opposed to metadata. An abstract data type for a generic container storing collections of data, as opposed to metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -121,7 +104,6 @@ class TimeSeries(NWBDataInterface):
General purpose time series. General purpose time series.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of the time series.""" None, description="""Description of the time series."""
@ -161,7 +143,6 @@ class TimeSeriesData(ConfiguredBaseModel):
Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file. Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
conversion: Optional[float] = Field( conversion: Optional[float] = Field(
None, None,
@ -190,7 +171,6 @@ class TimeSeriesStartingTime(ConfiguredBaseModel):
Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute. Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["starting_time"] = Field("starting_time") name: Literal["starting_time"] = Field("starting_time")
rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""") rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""")
unit: Optional[str] = Field( unit: Optional[str] = Field(
@ -205,7 +185,6 @@ class TimeSeriesSync(ConfiguredBaseModel):
Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes. Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["sync"] = Field("sync") name: Literal["sync"] = Field("sync")
@ -214,7 +193,6 @@ class ProcessingModule(NWBContainer):
A collection of processed data. A collection of processed data.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[ children: Optional[
List[Union[BaseModel, DynamicTable, NWBDataInterface]] List[Union[BaseModel, DynamicTable, NWBDataInterface]]
| Union[BaseModel, DynamicTable, NWBDataInterface] | Union[BaseModel, DynamicTable, NWBDataInterface]
@ -227,7 +205,6 @@ class Images(NWBDataInterface):
A collection of images. A collection of images.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("Images") name: str = Field("Images")
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of this collection of images.""" None, description="""Description of this collection of images."""
@ -235,17 +212,3 @@ class Images(NWBDataInterface):
image: List[str] | str = Field( image: List[str] | str = Field(
default_factory=list, description="""Images stored in this collection.""" default_factory=list, description="""Images stored in this collection."""
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
NWBData.model_rebuild()
Image.model_rebuild()
NWBContainer.model_rebuild()
NWBDataInterface.model_rebuild()
TimeSeries.model_rebuild()
TimeSeriesData.model_rebuild()
TimeSeriesStartingTime.model_rebuild()
TimeSeriesSync.model_rebuild()
ProcessingModule.model_rebuild()
Images.model_rebuild()

View file

@ -28,9 +28,9 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesStartingTime, TimeSeriesStartingTime,
NWBDataInterface,
TimeSeriesSync, TimeSeriesSync,
) )
@ -42,13 +42,6 @@ version = "2.2.2"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -68,18 +61,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class SpatialSeries(TimeSeries): class SpatialSeries(TimeSeries):
""" """
Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values. Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field( data: str = Field(
..., ...,
@ -123,7 +109,6 @@ class SpatialSeriesData(ConfiguredBaseModel):
1-D or 2-D array storing position or direction relative to some reference frame. 1-D or 2-D array storing position or direction relative to some reference frame.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -142,7 +127,6 @@ class BehavioralEpochs(NWBDataInterface):
TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data. TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[IntervalSeries] | IntervalSeries] = Field( children: Optional[List[IntervalSeries] | IntervalSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -154,7 +138,6 @@ class BehavioralEvents(NWBDataInterface):
TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details. TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict) children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -164,7 +147,6 @@ class BehavioralTimeSeries(NWBDataInterface):
TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details. TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict) children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -174,7 +156,6 @@ class PupilTracking(NWBDataInterface):
Eye-tracking data, representing pupil size. Eye-tracking data, representing pupil size.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict) children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -184,7 +165,6 @@ class EyeTracking(NWBDataInterface):
Eye-tracking data, representing direction of gaze. Eye-tracking data, representing direction of gaze.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpatialSeries] | SpatialSeries] = Field( children: Optional[List[SpatialSeries] | SpatialSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -196,7 +176,6 @@ class CompassDirection(NWBDataInterface):
With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees. With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpatialSeries] | SpatialSeries] = Field( children: Optional[List[SpatialSeries] | SpatialSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -208,21 +187,7 @@ class Position(NWBDataInterface):
Position data, whether along the x, x/y or x/y/z axis. Position data, whether along the x, x/y or x/y/z axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpatialSeries] | SpatialSeries] = Field( children: Optional[List[SpatialSeries] | SpatialSeries] = Field(
default_factory=dict default_factory=dict
) )
name: str = Field(...) name: str = Field(...)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
SpatialSeries.model_rebuild()
SpatialSeriesData.model_rebuild()
BehavioralEpochs.model_rebuild()
BehavioralEvents.model_rebuild()
BehavioralTimeSeries.model_rebuild()
PupilTracking.model_rebuild()
EyeTracking.model_rebuild()
CompassDirection.model_rebuild()
Position.model_rebuild()

View file

@ -35,13 +35,6 @@ version = "2.2.2"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class Device(NWBContainer): class Device(NWBContainer):
""" """
Metadata about a data acquisition device, e.g., recording system, electrode, microscope. Metadata about a data acquisition device, e.g., recording system, electrode, microscope.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, None,
@ -81,8 +67,3 @@ class Device(NWBContainer):
manufacturer: Optional[str] = Field( manufacturer: Optional[str] = Field(
None, description="""The name of the manufacturer of the device.""" None, description="""The name of the manufacturer of the device."""
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
Device.model_rebuild()

View file

@ -27,29 +27,22 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTableRegion, DynamicTable
from .core_nwb_base import ( from .core_nwb_base import (
NWBContainer,
TimeSeriesStartingTime,
NWBDataInterface, NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesStartingTime,
NWBContainer,
TimeSeriesSync, TimeSeriesSync,
) )
from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTableRegion, DynamicTable
metamodel_version = "None" metamodel_version = "None"
version = "2.2.2" version = "2.2.2"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -69,18 +62,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class ElectricalSeries(TimeSeries): class ElectricalSeries(TimeSeries):
""" """
A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels. A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Union[ data: Union[
NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times"], float],
@ -129,7 +115,6 @@ class ElectricalSeriesElectrodes(DynamicTableRegion):
DynamicTableRegion pointer to the electrodes that this time series was generated from. DynamicTableRegion pointer to the electrodes that this time series was generated from.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -153,7 +138,6 @@ class SpikeEventSeries(ElectricalSeries):
Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode). Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Union[ data: Union[
NDArray[Shape["* num_events, * num_channels, * num_samples"], float], NDArray[Shape["* num_events, * num_channels, * num_samples"], float],
@ -201,7 +185,6 @@ class FeatureExtraction(NWBDataInterface):
Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("FeatureExtraction") name: str = Field("FeatureExtraction")
description: NDArray[Shape["* num_features"], str] = Field( description: NDArray[Shape["* num_features"], str] = Field(
..., ...,
@ -228,7 +211,6 @@ class FeatureExtractionElectrodes(DynamicTableRegion):
DynamicTableRegion pointer to the electrodes that this time series was generated from. DynamicTableRegion pointer to the electrodes that this time series was generated from.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -252,7 +234,6 @@ class EventDetection(NWBDataInterface):
Detected spike events from voltage trace(s). Detected spike events from voltage trace(s).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("EventDetection") name: str = Field("EventDetection")
detection_method: str = Field( detection_method: str = Field(
..., ...,
@ -272,7 +253,6 @@ class EventWaveform(NWBDataInterface):
Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition. Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpikeEventSeries] | SpikeEventSeries] = Field( children: Optional[List[SpikeEventSeries] | SpikeEventSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -284,7 +264,6 @@ class FilteredEphys(NWBDataInterface):
Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries. Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field( children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -296,7 +275,6 @@ class LFP(NWBDataInterface):
LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries description or comments field. LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries description or comments field.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field( children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -308,7 +286,6 @@ class ElectrodeGroup(NWBContainer):
A physical grouping of electrodes, e.g. a shank of an array. A physical grouping of electrodes, e.g. a shank of an array.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of this electrode group.""" None, description="""Description of this electrode group."""
@ -327,7 +304,6 @@ class ElectrodeGroupPosition(ConfiguredBaseModel):
stereotaxic or common framework coordinates stereotaxic or common framework coordinates
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["position"] = Field("position") name: Literal["position"] = Field("position")
x: Optional[float] = Field(None, description="""x coordinate""") x: Optional[float] = Field(None, description="""x coordinate""")
y: Optional[float] = Field(None, description="""y coordinate""") y: Optional[float] = Field(None, description="""y coordinate""")
@ -339,7 +315,6 @@ class ClusterWaveforms(NWBDataInterface):
DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one. DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("ClusterWaveforms") name: str = Field("ClusterWaveforms")
waveform_filtering: str = Field( waveform_filtering: str = Field(
..., description="""Filtering applied to data before generating mean/sd""" ..., description="""Filtering applied to data before generating mean/sd"""
@ -359,7 +334,6 @@ class Clustering(NWBDataInterface):
DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("Clustering") name: str = Field("Clustering")
description: str = Field( description: str = Field(
..., ...,
@ -376,20 +350,3 @@ class Clustering(NWBDataInterface):
..., ...,
description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""", description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ElectricalSeries.model_rebuild()
ElectricalSeriesElectrodes.model_rebuild()
SpikeEventSeries.model_rebuild()
FeatureExtraction.model_rebuild()
FeatureExtractionElectrodes.model_rebuild()
EventDetection.model_rebuild()
EventWaveform.model_rebuild()
FilteredEphys.model_rebuild()
LFP.model_rebuild()
ElectrodeGroup.model_rebuild()
ElectrodeGroupPosition.model_rebuild()
ClusterWaveforms.model_rebuild()
Clustering.model_rebuild()

View file

@ -27,27 +27,20 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import TimeSeries
from ...hdmf_common.v1_1_3.hdmf_common_table import ( from ...hdmf_common.v1_1_3.hdmf_common_table import (
DynamicTable,
VectorIndex, VectorIndex,
DynamicTable,
VectorData, VectorData,
) )
from .core_nwb_base import TimeSeries
metamodel_version = "None" metamodel_version = "None"
version = "2.2.2" version = "2.2.2"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -67,18 +60,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class TimeIntervals(DynamicTable): class TimeIntervals(DynamicTable):
""" """
A container for aggregating epoch data and the TimeSeries that each epoch applies to. A container for aggregating epoch data and the TimeSeries that each epoch applies to.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
start_time: Optional[List[float] | float] = Field( start_time: Optional[List[float] | float] = Field(
default_factory=list, description="""Start time of epoch, in seconds.""" default_factory=list, description="""Start time of epoch, in seconds."""
@ -122,7 +108,6 @@ class TimeIntervalsTagsIndex(VectorIndex):
Index for tags. Index for tags.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["tags_index"] = Field("tags_index") name: Literal["tags_index"] = Field("tags_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -136,7 +121,6 @@ class TimeIntervalsTimeseries(VectorData):
An index into a TimeSeries object. An index into a TimeSeries object.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["timeseries"] = Field("timeseries") name: Literal["timeseries"] = Field("timeseries")
idx_start: Optional[int] = Field( idx_start: Optional[int] = Field(
None, None,
@ -167,18 +151,9 @@ class TimeIntervalsTimeseriesIndex(VectorIndex):
Index for timeseries. Index for timeseries.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["timeseries_index"] = Field("timeseries_index") name: Literal["timeseries_index"] = Field("timeseries_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
description="""Reference to the target dataset that this index applies to.""", description="""Reference to the target dataset that this index applies to.""",
) )
array: Optional[NDArray[Shape["* num_rows"], Any]] = Field(None) array: Optional[NDArray[Shape["* num_rows"], Any]] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
TimeIntervals.model_rebuild()
TimeIntervalsTagsIndex.model_rebuild()
TimeIntervalsTimeseries.model_rebuild()
TimeIntervalsTimeseriesIndex.model_rebuild()

View file

@ -27,27 +27,27 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_ophys import ImagingPlane from .core_nwb_icephys import SweepTable, IntracellularElectrode
from .core_nwb_base import TimeSeries, NWBDataInterface, ProcessingModule, NWBContainer
from .core_nwb_epoch import TimeIntervals from .core_nwb_epoch import TimeIntervals
from ...hdmf_common.v1_1_3.hdmf_common_table import ( from .core_nwb_ecephys import ElectrodeGroup
DynamicTable,
VectorData,
VectorIndex,
)
from .core_nwb_icephys import IntracellularElectrode, SweepTable from .core_nwb_base import NWBContainer, ProcessingModule, NWBDataInterface, TimeSeries
from .core_nwb_ogen import OptogeneticStimulusSite from .core_nwb_device import Device
from .core_nwb_misc import Units from .core_nwb_misc import Units
from .core_nwb_ecephys import ElectrodeGroup from .core_nwb_ogen import OptogeneticStimulusSite
from .core_nwb_device import Device from ...hdmf_common.v1_1_3.hdmf_common_table import (
VectorIndex,
DynamicTable,
VectorData,
)
from .core_nwb_ophys import ImagingPlane
metamodel_version = "None" metamodel_version = "None"
@ -55,13 +55,6 @@ version = "2.2.2"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -81,18 +74,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class NWBFile(NWBContainer): class NWBFile(NWBContainer):
""" """
An NWB:N file storing cellular-based neurophysiology data from a single experimental session. An NWB:N file storing cellular-based neurophysiology data from a single experimental session.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: Literal["root"] = Field("root") name: Literal["root"] = Field("root")
nwb_version: Optional[str] = Field( nwb_version: Optional[str] = Field(
None, None,
@ -163,7 +149,6 @@ class NWBFileStimulus(ConfiguredBaseModel):
Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file. Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["stimulus"] = Field("stimulus") name: Literal["stimulus"] = Field("stimulus")
presentation: Optional[List[TimeSeries] | TimeSeries] = Field( presentation: Optional[List[TimeSeries] | TimeSeries] = Field(
default_factory=dict, description="""Stimuli presented during the experiment.""" default_factory=dict, description="""Stimuli presented during the experiment."""
@ -179,7 +164,6 @@ class NWBFileGeneral(ConfiguredBaseModel):
Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them. Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["general"] = Field("general") name: Literal["general"] = Field("general")
data_collection: Optional[str] = Field( data_collection: Optional[str] = Field(
None, description="""Notes about data collection and analysis.""" None, description="""Notes about data collection and analysis."""
@ -269,7 +253,6 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel):
Script file or link to public source code used to create this NWB file. Script file or link to public source code used to create this NWB file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["source_script"] = Field("source_script") name: Literal["source_script"] = Field("source_script")
file_name: Optional[str] = Field(None, description="""Name of script file.""") file_name: Optional[str] = Field(None, description="""Name of script file.""")
value: str = Field(...) value: str = Field(...)
@ -280,7 +263,6 @@ class Subject(NWBContainer):
Information about the animal or person from which the data was measured. Information about the animal or person from which the data was measured.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["subject"] = Field("subject") name: Literal["subject"] = Field("subject")
age: Optional[str] = Field( age: Optional[str] = Field(
None, None,
@ -314,7 +296,6 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel):
Metadata related to extracellular electrophysiology. Metadata related to extracellular electrophysiology.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["extracellular_ephys"] = Field("extracellular_ephys") name: Literal["extracellular_ephys"] = Field("extracellular_ephys")
electrode_group: Optional[List[str] | str] = Field( electrode_group: Optional[List[str] | str] = Field(
default_factory=list, description="""Physical group of electrodes.""" default_factory=list, description="""Physical group of electrodes."""
@ -330,7 +311,6 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
A table of all electrodes (i.e. channels) used for recording. A table of all electrodes (i.e. channels) used for recording.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
x: Optional[List[float] | float] = Field( x: Optional[List[float] | float] = Field(
default_factory=list, default_factory=list,
@ -400,7 +380,6 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel):
Metadata related to intracellular electrophysiology. Metadata related to intracellular electrophysiology.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["intracellular_ephys"] = Field("intracellular_ephys") name: Literal["intracellular_ephys"] = Field("intracellular_ephys")
filtering: Optional[str] = Field( filtering: Optional[str] = Field(
None, None,
@ -413,15 +392,3 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel):
None, None,
description="""The table which groups different PatchClampSeries together.""", description="""The table which groups different PatchClampSeries together.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
NWBFile.model_rebuild()
NWBFileStimulus.model_rebuild()
NWBFileGeneral.model_rebuild()
NWBFileGeneralSourceScript.model_rebuild()
Subject.model_rebuild()
NWBFileGeneralExtracellularEphys.model_rebuild()
NWBFileGeneralExtracellularEphysElectrodes.model_rebuild()
NWBFileGeneralIntracellularEphys.model_rebuild()

View file

@ -28,16 +28,16 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeries, NWBContainer,
TimeSeriesSync, TimeSeriesSync,
TimeSeriesStartingTime, TimeSeriesStartingTime,
NWBContainer, TimeSeries,
) )
from ...hdmf_common.v1_1_3.hdmf_common_table import ( from ...hdmf_common.v1_1_3.hdmf_common_table import (
VectorIndex,
DynamicTable, DynamicTable,
VectorData, VectorData,
VectorIndex,
) )
@ -46,13 +46,6 @@ version = "2.2.2"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -72,18 +65,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class PatchClampSeries(TimeSeries): class PatchClampSeries(TimeSeries):
""" """
An abstract base class for patch-clamp data - stimulus or response, current or voltage. An abstract base class for patch-clamp data - stimulus or response, current or voltage.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
None, description="""Protocol/stimulus name for this patch-clamp dataset.""" None, description="""Protocol/stimulus name for this patch-clamp dataset."""
@ -131,7 +117,6 @@ class PatchClampSeriesData(ConfiguredBaseModel):
Recorded voltage or current. Recorded voltage or current.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -145,7 +130,6 @@ class CurrentClampSeries(PatchClampSeries):
Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected. Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Recorded voltage.""") data: str = Field(..., description="""Recorded voltage.""")
bias_current: Optional[float] = Field( bias_current: Optional[float] = Field(
@ -202,7 +186,6 @@ class CurrentClampSeriesData(ConfiguredBaseModel):
Recorded voltage. Recorded voltage.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -216,7 +199,6 @@ class IZeroClampSeries(CurrentClampSeries):
Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell. Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
bias_current: float = Field( bias_current: float = Field(
..., description="""Bias current, in amps, fixed to 0.0.""" ..., description="""Bias current, in amps, fixed to 0.0."""
@ -273,7 +255,6 @@ class CurrentClampStimulusSeries(PatchClampSeries):
Stimulus current applied during current clamp recording. Stimulus current applied during current clamp recording.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Stimulus current applied.""") data: str = Field(..., description="""Stimulus current applied.""")
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
@ -321,7 +302,6 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel):
Stimulus current applied. Stimulus current applied.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -335,7 +315,6 @@ class VoltageClampSeries(PatchClampSeries):
Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected. Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Recorded current.""") data: str = Field(..., description="""Recorded current.""")
capacitance_fast: Optional[str] = Field( capacitance_fast: Optional[str] = Field(
@ -404,7 +383,6 @@ class VoltageClampSeriesData(ConfiguredBaseModel):
Recorded current. Recorded current.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -418,7 +396,6 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel):
Fast capacitance, in farads. Fast capacitance, in farads.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["capacitance_fast"] = Field("capacitance_fast") name: Literal["capacitance_fast"] = Field("capacitance_fast")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -432,7 +409,6 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel):
Slow capacitance, in farads. Slow capacitance, in farads.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["capacitance_slow"] = Field("capacitance_slow") name: Literal["capacitance_slow"] = Field("capacitance_slow")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -446,7 +422,6 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel):
Resistance compensation bandwidth, in hertz. Resistance compensation bandwidth, in hertz.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["resistance_comp_bandwidth"] = Field("resistance_comp_bandwidth") name: Literal["resistance_comp_bandwidth"] = Field("resistance_comp_bandwidth")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -460,7 +435,6 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel):
Resistance compensation correction, in percent. Resistance compensation correction, in percent.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["resistance_comp_correction"] = Field("resistance_comp_correction") name: Literal["resistance_comp_correction"] = Field("resistance_comp_correction")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -474,7 +448,6 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel):
Resistance compensation prediction, in percent. Resistance compensation prediction, in percent.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["resistance_comp_prediction"] = Field("resistance_comp_prediction") name: Literal["resistance_comp_prediction"] = Field("resistance_comp_prediction")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -488,7 +461,6 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel):
Whole cell capacitance compensation, in farads. Whole cell capacitance compensation, in farads.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["whole_cell_capacitance_comp"] = Field("whole_cell_capacitance_comp") name: Literal["whole_cell_capacitance_comp"] = Field("whole_cell_capacitance_comp")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -502,7 +474,6 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel):
Whole cell series resistance compensation, in ohms. Whole cell series resistance compensation, in ohms.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["whole_cell_series_resistance_comp"] = Field( name: Literal["whole_cell_series_resistance_comp"] = Field(
"whole_cell_series_resistance_comp" "whole_cell_series_resistance_comp"
) )
@ -518,7 +489,6 @@ class VoltageClampStimulusSeries(PatchClampSeries):
Stimulus voltage applied during a voltage clamp recording. Stimulus voltage applied during a voltage clamp recording.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Stimulus voltage applied.""") data: str = Field(..., description="""Stimulus voltage applied.""")
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
@ -566,7 +536,6 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel):
Stimulus voltage applied. Stimulus voltage applied.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -580,7 +549,6 @@ class IntracellularElectrode(NWBContainer):
An intracellular electrode and its metadata. An intracellular electrode and its metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: str = Field( description: str = Field(
..., ...,
@ -612,7 +580,6 @@ class SweepTable(DynamicTable):
The table which groups different PatchClampSeries together. The table which groups different PatchClampSeries together.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
sweep_number: Optional[List[int] | int] = Field( sweep_number: Optional[List[int] | int] = Field(
default_factory=list, default_factory=list,
@ -648,35 +615,9 @@ class SweepTableSeriesIndex(VectorIndex):
Index for series. Index for series.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["series_index"] = Field("series_index") name: Literal["series_index"] = Field("series_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
description="""Reference to the target dataset that this index applies to.""", description="""Reference to the target dataset that this index applies to.""",
) )
array: Optional[NDArray[Shape["* num_rows"], Any]] = Field(None) array: Optional[NDArray[Shape["* num_rows"], Any]] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
PatchClampSeries.model_rebuild()
PatchClampSeriesData.model_rebuild()
CurrentClampSeries.model_rebuild()
CurrentClampSeriesData.model_rebuild()
IZeroClampSeries.model_rebuild()
CurrentClampStimulusSeries.model_rebuild()
CurrentClampStimulusSeriesData.model_rebuild()
VoltageClampSeries.model_rebuild()
VoltageClampSeriesData.model_rebuild()
VoltageClampSeriesCapacitanceFast.model_rebuild()
VoltageClampSeriesCapacitanceSlow.model_rebuild()
VoltageClampSeriesResistanceCompBandwidth.model_rebuild()
VoltageClampSeriesResistanceCompCorrection.model_rebuild()
VoltageClampSeriesResistanceCompPrediction.model_rebuild()
VoltageClampSeriesWholeCellCapacitanceComp.model_rebuild()
VoltageClampSeriesWholeCellSeriesResistanceComp.model_rebuild()
VoltageClampStimulusSeries.model_rebuild()
VoltageClampStimulusSeriesData.model_rebuild()
IntracellularElectrode.model_rebuild()
SweepTable.model_rebuild()
SweepTableSeriesIndex.model_rebuild()

View file

@ -27,7 +27,7 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync from .core_nwb_base import Image, TimeSeriesStartingTime, TimeSeries, TimeSeriesSync
metamodel_version = "None" metamodel_version = "None"
@ -35,13 +35,6 @@ version = "2.2.2"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class GrayscaleImage(Image): class GrayscaleImage(Image):
""" """
A grayscale image. A grayscale image.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -94,7 +80,6 @@ class RGBImage(Image):
A color image. A color image.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -116,7 +101,6 @@ class RGBAImage(Image):
A color image with transparency. A color image with transparency.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -138,7 +122,6 @@ class ImageSeries(TimeSeries):
General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z]. General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z].
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Optional[ data: Optional[
Union[ Union[
@ -191,7 +174,6 @@ class ImageSeriesExternalFile(ConfiguredBaseModel):
Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file. Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["external_file"] = Field("external_file") name: Literal["external_file"] = Field("external_file")
starting_frame: Optional[int] = Field( starting_frame: Optional[int] = Field(
None, None,
@ -205,7 +187,6 @@ class ImageMaskSeries(ImageSeries):
An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed. An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Optional[ data: Optional[
Union[ Union[
@ -258,7 +239,6 @@ class OpticalSeries(ImageSeries):
Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important. Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
distance: Optional[float] = Field( distance: Optional[float] = Field(
None, description="""Distance from camera/monitor to target/eye.""" None, description="""Distance from camera/monitor to target/eye."""
@ -327,7 +307,6 @@ class IndexSeries(TimeSeries):
Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed. Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], int] = Field( data: NDArray[Shape["* num_times"], int] = Field(
..., description="""Index of the frame in the referenced ImageSeries.""" ..., description="""Index of the frame in the referenced ImageSeries."""
@ -359,15 +338,3 @@ class IndexSeries(TimeSeries):
None, None,
description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""", description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
GrayscaleImage.model_rebuild()
RGBImage.model_rebuild()
RGBAImage.model_rebuild()
ImageSeries.model_rebuild()
ImageSeriesExternalFile.model_rebuild()
ImageMaskSeries.model_rebuild()
OpticalSeries.model_rebuild()
IndexSeries.model_rebuild()

View file

@ -32,13 +32,6 @@ version = "None"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -56,13 +49,3 @@ class ConfiguredBaseModel(BaseModel):
self.array[i] = value self.array[i] = value
else: else:
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model

View file

@ -27,15 +27,15 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync
from ...hdmf_common.v1_1_3.hdmf_common_table import ( from ...hdmf_common.v1_1_3.hdmf_common_table import (
VectorIndex,
DynamicTableRegion, DynamicTableRegion,
DynamicTable, DynamicTable,
VectorIndex,
VectorData, VectorData,
) )
from .core_nwb_base import TimeSeriesStartingTime, TimeSeries, TimeSeriesSync
from .core_nwb_ecephys import ElectrodeGroup from .core_nwb_ecephys import ElectrodeGroup
@ -44,13 +44,6 @@ version = "2.2.2"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -70,18 +63,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class AbstractFeatureSeries(TimeSeries): class AbstractFeatureSeries(TimeSeries):
""" """
Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical. Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Values of each feature at each time.""") data: str = Field(..., description="""Values of each feature at each time.""")
feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field( feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field(
@ -125,7 +111,6 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel):
Values of each feature at each time. Values of each feature at each time.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -144,7 +129,6 @@ class AnnotationSeries(TimeSeries):
Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way. Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], str] = Field( data: NDArray[Shape["* num_times"], str] = Field(
..., description="""Annotations made during an experiment.""" ..., description="""Annotations made during an experiment."""
@ -183,7 +167,6 @@ class IntervalSeries(TimeSeries):
Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way. Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], int] = Field( data: NDArray[Shape["* num_times"], int] = Field(
..., description="""Use values >0 if interval started, <0 if interval ended.""" ..., description="""Use values >0 if interval started, <0 if interval ended."""
@ -222,7 +205,6 @@ class DecompositionSeries(TimeSeries):
Spectral analysis of a time series, e.g. of an LFP or a speech signal. Spectral analysis of a time series, e.g. of an LFP or a speech signal.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Data decomposed into frequency bands.""") data: str = Field(..., description="""Data decomposed into frequency bands.""")
metric: str = Field( metric: str = Field(
@ -266,7 +248,6 @@ class DecompositionSeriesData(ConfiguredBaseModel):
Data decomposed into frequency bands. Data decomposed into frequency bands.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -282,7 +263,6 @@ class DecompositionSeriesBands(DynamicTable):
Table for describing the bands that this series was generated from. There should be one row in this table for each band. Table for describing the bands that this series was generated from. There should be one row in this table for each band.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["bands"] = Field("bands") name: Literal["bands"] = Field("bands")
band_name: Optional[List[str] | str] = Field( band_name: Optional[List[str] | str] = Field(
default_factory=list, description="""Name of the band, e.g. theta.""" default_factory=list, description="""Name of the band, e.g. theta."""
@ -322,7 +302,6 @@ class Units(DynamicTable):
Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times. Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("Units") name: str = Field("Units")
spike_times_index: Optional[str] = Field( spike_times_index: Optional[str] = Field(
None, description="""Index into the spike_times dataset.""" None, description="""Index into the spike_times dataset."""
@ -386,7 +365,6 @@ class UnitsSpikeTimesIndex(VectorIndex):
Index into the spike_times dataset. Index into the spike_times dataset.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["spike_times_index"] = Field("spike_times_index") name: Literal["spike_times_index"] = Field("spike_times_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -400,7 +378,6 @@ class UnitsSpikeTimes(VectorData):
Spike times for each unit. Spike times for each unit.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["spike_times"] = Field("spike_times") name: Literal["spike_times"] = Field("spike_times")
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, None,
@ -424,7 +401,6 @@ class UnitsObsIntervalsIndex(VectorIndex):
Index into the obs_intervals dataset. Index into the obs_intervals dataset.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["obs_intervals_index"] = Field("obs_intervals_index") name: Literal["obs_intervals_index"] = Field("obs_intervals_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -438,7 +414,6 @@ class UnitsElectrodesIndex(VectorIndex):
Index into electrodes. Index into electrodes.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes_index"] = Field("electrodes_index") name: Literal["electrodes_index"] = Field("electrodes_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -452,7 +427,6 @@ class UnitsElectrodes(DynamicTableRegion):
Electrode that each spike unit came from, specified using a DynamicTableRegion. Electrode that each spike unit came from, specified using a DynamicTableRegion.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -469,20 +443,3 @@ class UnitsElectrodes(DynamicTableRegion):
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any],
] ]
] = Field(None) ] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
AbstractFeatureSeries.model_rebuild()
AbstractFeatureSeriesData.model_rebuild()
AnnotationSeries.model_rebuild()
IntervalSeries.model_rebuild()
DecompositionSeries.model_rebuild()
DecompositionSeriesData.model_rebuild()
DecompositionSeriesBands.model_rebuild()
Units.model_rebuild()
UnitsSpikeTimesIndex.model_rebuild()
UnitsSpikeTimes.model_rebuild()
UnitsObsIntervalsIndex.model_rebuild()
UnitsElectrodesIndex.model_rebuild()
UnitsElectrodes.model_rebuild()

View file

@ -29,9 +29,9 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeriesSync, TimeSeriesSync,
TimeSeries,
NWBContainer, NWBContainer,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeries,
) )
@ -40,13 +40,6 @@ version = "2.2.2"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -66,18 +59,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class OptogeneticSeries(TimeSeries): class OptogeneticSeries(TimeSeries):
""" """
An optogenetic stimulus. An optogenetic stimulus.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], float] = Field( data: NDArray[Shape["* num_times"], float] = Field(
..., description="""Applied power for optogenetic stimulus, in watts.""" ..., description="""Applied power for optogenetic stimulus, in watts."""
@ -116,7 +102,6 @@ class OptogeneticStimulusSite(NWBContainer):
A site of optogenetic stimulation. A site of optogenetic stimulation.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: str = Field(..., description="""Description of stimulation site.""") description: str = Field(..., description="""Description of stimulation site.""")
excitation_lambda: float = Field( excitation_lambda: float = Field(
@ -126,9 +111,3 @@ class OptogeneticStimulusSite(NWBContainer):
..., ...,
description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""", description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
OptogeneticSeries.model_rebuild()
OptogeneticStimulusSite.model_rebuild()

View file

@ -27,31 +27,24 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTable, DynamicTableRegion from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTableRegion, DynamicTable
from .core_nwb_image import ImageSeriesExternalFile, ImageSeries
from .core_nwb_base import ( from .core_nwb_base import (
NWBDataInterface,
TimeSeriesStartingTime,
TimeSeries,
NWBContainer, NWBContainer,
TimeSeriesStartingTime,
NWBDataInterface,
TimeSeries,
TimeSeriesSync, TimeSeriesSync,
) )
from .core_nwb_image import ImageSeries, ImageSeriesExternalFile
metamodel_version = "None" metamodel_version = "None"
version = "2.2.2" version = "2.2.2"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -71,18 +64,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class TwoPhotonSeries(ImageSeries): class TwoPhotonSeries(ImageSeries):
""" """
Image stack recorded over time from 2-photon microscope. Image stack recorded over time from 2-photon microscope.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""") pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""")
scan_line_rate: Optional[float] = Field( scan_line_rate: Optional[float] = Field(
@ -149,7 +135,6 @@ class RoiResponseSeries(TimeSeries):
ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Union[ data: Union[
NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times"], float],
@ -193,7 +178,6 @@ class RoiResponseSeriesRois(DynamicTableRegion):
DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries. DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["rois"] = Field("rois") name: Literal["rois"] = Field("rois")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -217,7 +201,6 @@ class DfOverF(NWBDataInterface):
dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes). dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field( children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -229,7 +212,6 @@ class Fluorescence(NWBDataInterface):
Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes). Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field( children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -241,7 +223,6 @@ class ImageSegmentation(NWBDataInterface):
Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them. Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[ children: Optional[
List[Union[BaseModel, DynamicTable]] | Union[BaseModel, DynamicTable] List[Union[BaseModel, DynamicTable]] | Union[BaseModel, DynamicTable]
] = Field(default_factory=dict) ] = Field(default_factory=dict)
@ -253,7 +234,6 @@ class ImagingPlane(NWBContainer):
An imaging plane and its metadata. An imaging plane and its metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[NWBContainer] | NWBContainer] = Field(default_factory=dict) children: Optional[List[NWBContainer] | NWBContainer] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -263,20 +243,7 @@ class MotionCorrection(NWBDataInterface):
An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions). An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[NWBDataInterface] | NWBDataInterface] = Field( children: Optional[List[NWBDataInterface] | NWBDataInterface] = Field(
default_factory=dict default_factory=dict
) )
name: str = Field(...) name: str = Field(...)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
TwoPhotonSeries.model_rebuild()
RoiResponseSeries.model_rebuild()
RoiResponseSeriesRois.model_rebuild()
DfOverF.model_rebuild()
Fluorescence.model_rebuild()
ImageSegmentation.model_rebuild()
ImagingPlane.model_rebuild()
MotionCorrection.model_rebuild()

View file

@ -35,13 +35,6 @@ version = "2.2.2"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class ImagingRetinotopy(NWBDataInterface): class ImagingRetinotopy(NWBDataInterface):
""" """
Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. This group does not store the raw responses imaged during retinotopic mapping or the stimuli presented, but rather the resulting phase and power maps after applying a Fourier transform on the averaged responses. Note: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x). Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. This group does not store the raw responses imaged during retinotopic mapping or the stimuli presented, but rather the resulting phase and power maps after applying a Fourier transform on the averaged responses. Note: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("ImagingRetinotopy") name: str = Field("ImagingRetinotopy")
axis_1_phase_map: str = Field( axis_1_phase_map: str = Field(
..., description="""Phase response to stimulus on the first measured axis.""" ..., description="""Phase response to stimulus on the first measured axis."""
@ -111,7 +97,6 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel):
Phase response to stimulus on the first measured axis. Phase response to stimulus on the first measured axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_1_phase_map"] = Field("axis_1_phase_map") name: Literal["axis_1_phase_map"] = Field("axis_1_phase_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -131,7 +116,6 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel):
Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_1_power_map"] = Field("axis_1_power_map") name: Literal["axis_1_power_map"] = Field("axis_1_power_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -151,7 +135,6 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel):
Phase response to stimulus on the second measured axis. Phase response to stimulus on the second measured axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_2_phase_map"] = Field("axis_2_phase_map") name: Literal["axis_2_phase_map"] = Field("axis_2_phase_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -171,7 +154,6 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel):
Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_2_power_map"] = Field("axis_2_power_map") name: Literal["axis_2_power_map"] = Field("axis_2_power_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -191,7 +173,6 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel):
Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns]. Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["focal_depth_image"] = Field("focal_depth_image") name: Literal["focal_depth_image"] = Field("focal_depth_image")
bits_per_pixel: Optional[int] = Field( bits_per_pixel: Optional[int] = Field(
None, None,
@ -218,7 +199,6 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel):
Sine of the angle between the direction of the gradient in axis_1 and axis_2. Sine of the angle between the direction of the gradient in axis_1 and axis_2.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["sign_map"] = Field("sign_map") name: Literal["sign_map"] = Field("sign_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -235,7 +215,6 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel):
Gray-scale anatomical image of cortical surface. Array structure: [rows][columns] Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["vasculature_image"] = Field("vasculature_image") name: Literal["vasculature_image"] = Field("vasculature_image")
bits_per_pixel: Optional[int] = Field( bits_per_pixel: Optional[int] = Field(
None, None,
@ -252,15 +231,3 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel):
None, description="""Format of image. Right now only 'raw' is supported.""" None, description="""Format of image. Right now only 'raw' is supported."""
) )
array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field(None) array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ImagingRetinotopy.model_rebuild()
ImagingRetinotopyAxis1PhaseMap.model_rebuild()
ImagingRetinotopyAxis1PowerMap.model_rebuild()
ImagingRetinotopyAxis2PhaseMap.model_rebuild()
ImagingRetinotopyAxis2PowerMap.model_rebuild()
ImagingRetinotopyFocalDepthImage.model_rebuild()
ImagingRetinotopySignMap.model_rebuild()
ImagingRetinotopyVasculatureImage.model_rebuild()

View file

@ -187,13 +187,6 @@ version = "2.2.2"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -211,13 +204,3 @@ class ConfiguredBaseModel(BaseModel):
self.array[i] = value self.array[i] = value
else: else:
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model

View file

@ -27,7 +27,7 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from ...hdmf_common.v1_1_3.hdmf_common_table import Container, Data, DynamicTable from ...hdmf_common.v1_1_3.hdmf_common_table import Data, Container, DynamicTable
metamodel_version = "None" metamodel_version = "None"
@ -35,13 +35,6 @@ version = "2.2.4"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class NWBData(Data): class NWBData(Data):
""" """
An abstract data type for a dataset. An abstract data type for a dataset.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -81,7 +67,6 @@ class Image(NWBData):
An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)). An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -103,7 +88,6 @@ class NWBContainer(Container):
An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers. An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -112,7 +96,6 @@ class NWBDataInterface(NWBContainer):
An abstract data type for a generic container storing collections of data, as opposed to metadata. An abstract data type for a generic container storing collections of data, as opposed to metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -121,7 +104,6 @@ class TimeSeries(NWBDataInterface):
General purpose time series. General purpose time series.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of the time series.""" None, description="""Description of the time series."""
@ -161,7 +143,6 @@ class TimeSeriesData(ConfiguredBaseModel):
Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file. Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
conversion: Optional[float] = Field( conversion: Optional[float] = Field(
None, None,
@ -190,7 +171,6 @@ class TimeSeriesStartingTime(ConfiguredBaseModel):
Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute. Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["starting_time"] = Field("starting_time") name: Literal["starting_time"] = Field("starting_time")
rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""") rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""")
unit: Optional[str] = Field( unit: Optional[str] = Field(
@ -205,7 +185,6 @@ class TimeSeriesSync(ConfiguredBaseModel):
Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes. Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["sync"] = Field("sync") name: Literal["sync"] = Field("sync")
@ -214,7 +193,6 @@ class ProcessingModule(NWBContainer):
A collection of processed data. A collection of processed data.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[ children: Optional[
List[Union[BaseModel, DynamicTable, NWBDataInterface]] List[Union[BaseModel, DynamicTable, NWBDataInterface]]
| Union[BaseModel, DynamicTable, NWBDataInterface] | Union[BaseModel, DynamicTable, NWBDataInterface]
@ -227,7 +205,6 @@ class Images(NWBDataInterface):
A collection of images. A collection of images.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("Images") name: str = Field("Images")
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of this collection of images.""" None, description="""Description of this collection of images."""
@ -235,17 +212,3 @@ class Images(NWBDataInterface):
image: List[str] | str = Field( image: List[str] | str = Field(
default_factory=list, description="""Images stored in this collection.""" default_factory=list, description="""Images stored in this collection."""
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
NWBData.model_rebuild()
Image.model_rebuild()
NWBContainer.model_rebuild()
NWBDataInterface.model_rebuild()
TimeSeries.model_rebuild()
TimeSeriesData.model_rebuild()
TimeSeriesStartingTime.model_rebuild()
TimeSeriesSync.model_rebuild()
ProcessingModule.model_rebuild()
Images.model_rebuild()

View file

@ -28,9 +28,9 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesStartingTime, TimeSeriesStartingTime,
NWBDataInterface,
TimeSeriesSync, TimeSeriesSync,
) )
@ -42,13 +42,6 @@ version = "2.2.4"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -68,18 +61,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class SpatialSeries(TimeSeries): class SpatialSeries(TimeSeries):
""" """
Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values. Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field( data: str = Field(
..., ...,
@ -123,7 +109,6 @@ class SpatialSeriesData(ConfiguredBaseModel):
1-D or 2-D array storing position or direction relative to some reference frame. 1-D or 2-D array storing position or direction relative to some reference frame.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -142,7 +127,6 @@ class BehavioralEpochs(NWBDataInterface):
TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data. TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[IntervalSeries] | IntervalSeries] = Field( children: Optional[List[IntervalSeries] | IntervalSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -154,7 +138,6 @@ class BehavioralEvents(NWBDataInterface):
TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details. TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict) children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -164,7 +147,6 @@ class BehavioralTimeSeries(NWBDataInterface):
TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details. TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict) children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -174,7 +156,6 @@ class PupilTracking(NWBDataInterface):
Eye-tracking data, representing pupil size. Eye-tracking data, representing pupil size.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict) children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -184,7 +165,6 @@ class EyeTracking(NWBDataInterface):
Eye-tracking data, representing direction of gaze. Eye-tracking data, representing direction of gaze.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpatialSeries] | SpatialSeries] = Field( children: Optional[List[SpatialSeries] | SpatialSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -196,7 +176,6 @@ class CompassDirection(NWBDataInterface):
With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees. With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpatialSeries] | SpatialSeries] = Field( children: Optional[List[SpatialSeries] | SpatialSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -208,21 +187,7 @@ class Position(NWBDataInterface):
Position data, whether along the x, x/y or x/y/z axis. Position data, whether along the x, x/y or x/y/z axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpatialSeries] | SpatialSeries] = Field( children: Optional[List[SpatialSeries] | SpatialSeries] = Field(
default_factory=dict default_factory=dict
) )
name: str = Field(...) name: str = Field(...)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
SpatialSeries.model_rebuild()
SpatialSeriesData.model_rebuild()
BehavioralEpochs.model_rebuild()
BehavioralEvents.model_rebuild()
BehavioralTimeSeries.model_rebuild()
PupilTracking.model_rebuild()
EyeTracking.model_rebuild()
CompassDirection.model_rebuild()
Position.model_rebuild()

View file

@ -35,13 +35,6 @@ version = "2.2.4"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class Device(NWBContainer): class Device(NWBContainer):
""" """
Metadata about a data acquisition device, e.g., recording system, electrode, microscope. Metadata about a data acquisition device, e.g., recording system, electrode, microscope.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, None,
@ -81,8 +67,3 @@ class Device(NWBContainer):
manufacturer: Optional[str] = Field( manufacturer: Optional[str] = Field(
None, description="""The name of the manufacturer of the device.""" None, description="""The name of the manufacturer of the device."""
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
Device.model_rebuild()

View file

@ -27,29 +27,22 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTableRegion, DynamicTable
from .core_nwb_base import ( from .core_nwb_base import (
NWBContainer,
TimeSeriesStartingTime,
NWBDataInterface, NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesStartingTime,
NWBContainer,
TimeSeriesSync, TimeSeriesSync,
) )
from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTableRegion, DynamicTable
metamodel_version = "None" metamodel_version = "None"
version = "2.2.4" version = "2.2.4"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -69,18 +62,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class ElectricalSeries(TimeSeries): class ElectricalSeries(TimeSeries):
""" """
A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels. A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Union[ data: Union[
NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times"], float],
@ -129,7 +115,6 @@ class ElectricalSeriesElectrodes(DynamicTableRegion):
DynamicTableRegion pointer to the electrodes that this time series was generated from. DynamicTableRegion pointer to the electrodes that this time series was generated from.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -153,7 +138,6 @@ class SpikeEventSeries(ElectricalSeries):
Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode). Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Union[ data: Union[
NDArray[Shape["* num_events, * num_channels, * num_samples"], float], NDArray[Shape["* num_events, * num_channels, * num_samples"], float],
@ -201,7 +185,6 @@ class FeatureExtraction(NWBDataInterface):
Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("FeatureExtraction") name: str = Field("FeatureExtraction")
description: NDArray[Shape["* num_features"], str] = Field( description: NDArray[Shape["* num_features"], str] = Field(
..., ...,
@ -228,7 +211,6 @@ class FeatureExtractionElectrodes(DynamicTableRegion):
DynamicTableRegion pointer to the electrodes that this time series was generated from. DynamicTableRegion pointer to the electrodes that this time series was generated from.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -252,7 +234,6 @@ class EventDetection(NWBDataInterface):
Detected spike events from voltage trace(s). Detected spike events from voltage trace(s).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("EventDetection") name: str = Field("EventDetection")
detection_method: str = Field( detection_method: str = Field(
..., ...,
@ -272,7 +253,6 @@ class EventWaveform(NWBDataInterface):
Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition. Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpikeEventSeries] | SpikeEventSeries] = Field( children: Optional[List[SpikeEventSeries] | SpikeEventSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -284,7 +264,6 @@ class FilteredEphys(NWBDataInterface):
Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries. Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field( children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -296,7 +275,6 @@ class LFP(NWBDataInterface):
LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries description or comments field. LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries description or comments field.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field( children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -308,7 +286,6 @@ class ElectrodeGroup(NWBContainer):
A physical grouping of electrodes, e.g. a shank of an array. A physical grouping of electrodes, e.g. a shank of an array.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of this electrode group.""" None, description="""Description of this electrode group."""
@ -327,7 +304,6 @@ class ElectrodeGroupPosition(ConfiguredBaseModel):
stereotaxic or common framework coordinates stereotaxic or common framework coordinates
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["position"] = Field("position") name: Literal["position"] = Field("position")
x: Optional[float] = Field(None, description="""x coordinate""") x: Optional[float] = Field(None, description="""x coordinate""")
y: Optional[float] = Field(None, description="""y coordinate""") y: Optional[float] = Field(None, description="""y coordinate""")
@ -339,7 +315,6 @@ class ClusterWaveforms(NWBDataInterface):
DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one. DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("ClusterWaveforms") name: str = Field("ClusterWaveforms")
waveform_filtering: str = Field( waveform_filtering: str = Field(
..., description="""Filtering applied to data before generating mean/sd""" ..., description="""Filtering applied to data before generating mean/sd"""
@ -359,7 +334,6 @@ class Clustering(NWBDataInterface):
DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("Clustering") name: str = Field("Clustering")
description: str = Field( description: str = Field(
..., ...,
@ -376,20 +350,3 @@ class Clustering(NWBDataInterface):
..., ...,
description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""", description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ElectricalSeries.model_rebuild()
ElectricalSeriesElectrodes.model_rebuild()
SpikeEventSeries.model_rebuild()
FeatureExtraction.model_rebuild()
FeatureExtractionElectrodes.model_rebuild()
EventDetection.model_rebuild()
EventWaveform.model_rebuild()
FilteredEphys.model_rebuild()
LFP.model_rebuild()
ElectrodeGroup.model_rebuild()
ElectrodeGroupPosition.model_rebuild()
ClusterWaveforms.model_rebuild()
Clustering.model_rebuild()

View file

@ -27,27 +27,20 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import TimeSeries
from ...hdmf_common.v1_1_3.hdmf_common_table import ( from ...hdmf_common.v1_1_3.hdmf_common_table import (
DynamicTable,
VectorIndex, VectorIndex,
DynamicTable,
VectorData, VectorData,
) )
from .core_nwb_base import TimeSeries
metamodel_version = "None" metamodel_version = "None"
version = "2.2.4" version = "2.2.4"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -67,18 +60,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class TimeIntervals(DynamicTable): class TimeIntervals(DynamicTable):
""" """
A container for aggregating epoch data and the TimeSeries that each epoch applies to. A container for aggregating epoch data and the TimeSeries that each epoch applies to.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
start_time: Optional[List[float] | float] = Field( start_time: Optional[List[float] | float] = Field(
default_factory=list, description="""Start time of epoch, in seconds.""" default_factory=list, description="""Start time of epoch, in seconds."""
@ -122,7 +108,6 @@ class TimeIntervalsTagsIndex(VectorIndex):
Index for tags. Index for tags.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["tags_index"] = Field("tags_index") name: Literal["tags_index"] = Field("tags_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -136,7 +121,6 @@ class TimeIntervalsTimeseries(VectorData):
An index into a TimeSeries object. An index into a TimeSeries object.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["timeseries"] = Field("timeseries") name: Literal["timeseries"] = Field("timeseries")
idx_start: Optional[int] = Field( idx_start: Optional[int] = Field(
None, None,
@ -167,18 +151,9 @@ class TimeIntervalsTimeseriesIndex(VectorIndex):
Index for timeseries. Index for timeseries.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["timeseries_index"] = Field("timeseries_index") name: Literal["timeseries_index"] = Field("timeseries_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
description="""Reference to the target dataset that this index applies to.""", description="""Reference to the target dataset that this index applies to.""",
) )
array: Optional[NDArray[Shape["* num_rows"], Any]] = Field(None) array: Optional[NDArray[Shape["* num_rows"], Any]] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
TimeIntervals.model_rebuild()
TimeIntervalsTagsIndex.model_rebuild()
TimeIntervalsTimeseries.model_rebuild()
TimeIntervalsTimeseriesIndex.model_rebuild()

View file

@ -27,33 +27,33 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_ophys import ImagingPlane from .core_nwb_icephys import SweepTable, IntracellularElectrode
from .core_nwb_base import (
TimeSeries,
NWBDataInterface,
ProcessingModule,
NWBContainer,
NWBData,
)
from .core_nwb_epoch import TimeIntervals from .core_nwb_epoch import TimeIntervals
from ...hdmf_common.v1_1_3.hdmf_common_table import ( from .core_nwb_ecephys import ElectrodeGroup
DynamicTable,
VectorData, from .core_nwb_base import (
VectorIndex, NWBContainer,
ProcessingModule,
NWBData,
NWBDataInterface,
TimeSeries,
) )
from .core_nwb_icephys import IntracellularElectrode, SweepTable from .core_nwb_device import Device
from .core_nwb_ogen import OptogeneticStimulusSite
from .core_nwb_misc import Units from .core_nwb_misc import Units
from .core_nwb_ecephys import ElectrodeGroup from .core_nwb_ogen import OptogeneticStimulusSite
from .core_nwb_device import Device from ...hdmf_common.v1_1_3.hdmf_common_table import (
VectorIndex,
DynamicTable,
VectorData,
)
from .core_nwb_ophys import ImagingPlane
metamodel_version = "None" metamodel_version = "None"
@ -61,13 +61,6 @@ version = "2.2.4"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -87,18 +80,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class ScratchData(NWBData): class ScratchData(NWBData):
""" """
Any one-off datasets Any one-off datasets
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
notes: Optional[str] = Field( notes: Optional[str] = Field(
None, description="""Any notes the user has about the dataset being stored""" None, description="""Any notes the user has about the dataset being stored"""
@ -110,7 +96,6 @@ class NWBFile(NWBContainer):
An NWB:N file storing cellular-based neurophysiology data from a single experimental session. An NWB:N file storing cellular-based neurophysiology data from a single experimental session.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: Literal["root"] = Field("root") name: Literal["root"] = Field("root")
nwb_version: Optional[str] = Field( nwb_version: Optional[str] = Field(
None, None,
@ -181,7 +166,6 @@ class NWBFileStimulus(ConfiguredBaseModel):
Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file. Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["stimulus"] = Field("stimulus") name: Literal["stimulus"] = Field("stimulus")
presentation: Optional[List[TimeSeries] | TimeSeries] = Field( presentation: Optional[List[TimeSeries] | TimeSeries] = Field(
default_factory=dict, description="""Stimuli presented during the experiment.""" default_factory=dict, description="""Stimuli presented during the experiment."""
@ -197,7 +181,6 @@ class NWBFileGeneral(ConfiguredBaseModel):
Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them. Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["general"] = Field("general") name: Literal["general"] = Field("general")
data_collection: Optional[str] = Field( data_collection: Optional[str] = Field(
None, description="""Notes about data collection and analysis.""" None, description="""Notes about data collection and analysis."""
@ -287,7 +270,6 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel):
Script file or link to public source code used to create this NWB file. Script file or link to public source code used to create this NWB file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["source_script"] = Field("source_script") name: Literal["source_script"] = Field("source_script")
file_name: Optional[str] = Field(None, description="""Name of script file.""") file_name: Optional[str] = Field(None, description="""Name of script file.""")
value: str = Field(...) value: str = Field(...)
@ -298,7 +280,6 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel):
Metadata related to extracellular electrophysiology. Metadata related to extracellular electrophysiology.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["extracellular_ephys"] = Field("extracellular_ephys") name: Literal["extracellular_ephys"] = Field("extracellular_ephys")
electrode_group: Optional[List[str] | str] = Field( electrode_group: Optional[List[str] | str] = Field(
default_factory=list, description="""Physical group of electrodes.""" default_factory=list, description="""Physical group of electrodes."""
@ -314,7 +295,6 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
A table of all electrodes (i.e. channels) used for recording. A table of all electrodes (i.e. channels) used for recording.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
x: Optional[List[float] | float] = Field( x: Optional[List[float] | float] = Field(
default_factory=list, default_factory=list,
@ -384,7 +364,6 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel):
Metadata related to intracellular electrophysiology. Metadata related to intracellular electrophysiology.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["intracellular_ephys"] = Field("intracellular_ephys") name: Literal["intracellular_ephys"] = Field("intracellular_ephys")
filtering: Optional[str] = Field( filtering: Optional[str] = Field(
None, None,
@ -404,7 +383,6 @@ class LabMetaData(NWBContainer):
Lab-specific meta-data. Lab-specific meta-data.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -413,7 +391,6 @@ class Subject(NWBContainer):
Information about the animal or person from which the data was measured. Information about the animal or person from which the data was measured.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
age: Optional[str] = Field( age: Optional[str] = Field(
None, None,
@ -440,17 +417,3 @@ class Subject(NWBContainer):
None, None,
description="""Weight at time of experiment, at time of surgery and at other important times.""", description="""Weight at time of experiment, at time of surgery and at other important times.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ScratchData.model_rebuild()
NWBFile.model_rebuild()
NWBFileStimulus.model_rebuild()
NWBFileGeneral.model_rebuild()
NWBFileGeneralSourceScript.model_rebuild()
NWBFileGeneralExtracellularEphys.model_rebuild()
NWBFileGeneralExtracellularEphysElectrodes.model_rebuild()
NWBFileGeneralIntracellularEphys.model_rebuild()
LabMetaData.model_rebuild()
Subject.model_rebuild()

View file

@ -28,16 +28,16 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeries, NWBContainer,
TimeSeriesSync, TimeSeriesSync,
TimeSeriesStartingTime, TimeSeriesStartingTime,
NWBContainer, TimeSeries,
) )
from ...hdmf_common.v1_1_3.hdmf_common_table import ( from ...hdmf_common.v1_1_3.hdmf_common_table import (
VectorIndex,
DynamicTable, DynamicTable,
VectorData, VectorData,
VectorIndex,
) )
@ -46,13 +46,6 @@ version = "2.2.4"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -72,18 +65,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class PatchClampSeries(TimeSeries): class PatchClampSeries(TimeSeries):
""" """
An abstract base class for patch-clamp data - stimulus or response, current or voltage. An abstract base class for patch-clamp data - stimulus or response, current or voltage.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
None, description="""Protocol/stimulus name for this patch-clamp dataset.""" None, description="""Protocol/stimulus name for this patch-clamp dataset."""
@ -131,7 +117,6 @@ class PatchClampSeriesData(ConfiguredBaseModel):
Recorded voltage or current. Recorded voltage or current.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -145,7 +130,6 @@ class CurrentClampSeries(PatchClampSeries):
Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected. Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Recorded voltage.""") data: str = Field(..., description="""Recorded voltage.""")
bias_current: Optional[float] = Field( bias_current: Optional[float] = Field(
@ -202,7 +186,6 @@ class CurrentClampSeriesData(ConfiguredBaseModel):
Recorded voltage. Recorded voltage.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -216,7 +199,6 @@ class IZeroClampSeries(CurrentClampSeries):
Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell. Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
bias_current: float = Field( bias_current: float = Field(
..., description="""Bias current, in amps, fixed to 0.0.""" ..., description="""Bias current, in amps, fixed to 0.0."""
@ -273,7 +255,6 @@ class CurrentClampStimulusSeries(PatchClampSeries):
Stimulus current applied during current clamp recording. Stimulus current applied during current clamp recording.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Stimulus current applied.""") data: str = Field(..., description="""Stimulus current applied.""")
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
@ -321,7 +302,6 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel):
Stimulus current applied. Stimulus current applied.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -335,7 +315,6 @@ class VoltageClampSeries(PatchClampSeries):
Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected. Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Recorded current.""") data: str = Field(..., description="""Recorded current.""")
capacitance_fast: Optional[str] = Field( capacitance_fast: Optional[str] = Field(
@ -404,7 +383,6 @@ class VoltageClampSeriesData(ConfiguredBaseModel):
Recorded current. Recorded current.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -418,7 +396,6 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel):
Fast capacitance, in farads. Fast capacitance, in farads.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["capacitance_fast"] = Field("capacitance_fast") name: Literal["capacitance_fast"] = Field("capacitance_fast")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -432,7 +409,6 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel):
Slow capacitance, in farads. Slow capacitance, in farads.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["capacitance_slow"] = Field("capacitance_slow") name: Literal["capacitance_slow"] = Field("capacitance_slow")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -446,7 +422,6 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel):
Resistance compensation bandwidth, in hertz. Resistance compensation bandwidth, in hertz.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["resistance_comp_bandwidth"] = Field("resistance_comp_bandwidth") name: Literal["resistance_comp_bandwidth"] = Field("resistance_comp_bandwidth")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -460,7 +435,6 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel):
Resistance compensation correction, in percent. Resistance compensation correction, in percent.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["resistance_comp_correction"] = Field("resistance_comp_correction") name: Literal["resistance_comp_correction"] = Field("resistance_comp_correction")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -474,7 +448,6 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel):
Resistance compensation prediction, in percent. Resistance compensation prediction, in percent.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["resistance_comp_prediction"] = Field("resistance_comp_prediction") name: Literal["resistance_comp_prediction"] = Field("resistance_comp_prediction")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -488,7 +461,6 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel):
Whole cell capacitance compensation, in farads. Whole cell capacitance compensation, in farads.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["whole_cell_capacitance_comp"] = Field("whole_cell_capacitance_comp") name: Literal["whole_cell_capacitance_comp"] = Field("whole_cell_capacitance_comp")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -502,7 +474,6 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel):
Whole cell series resistance compensation, in ohms. Whole cell series resistance compensation, in ohms.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["whole_cell_series_resistance_comp"] = Field( name: Literal["whole_cell_series_resistance_comp"] = Field(
"whole_cell_series_resistance_comp" "whole_cell_series_resistance_comp"
) )
@ -518,7 +489,6 @@ class VoltageClampStimulusSeries(PatchClampSeries):
Stimulus voltage applied during a voltage clamp recording. Stimulus voltage applied during a voltage clamp recording.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Stimulus voltage applied.""") data: str = Field(..., description="""Stimulus voltage applied.""")
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
@ -566,7 +536,6 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel):
Stimulus voltage applied. Stimulus voltage applied.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -580,7 +549,6 @@ class IntracellularElectrode(NWBContainer):
An intracellular electrode and its metadata. An intracellular electrode and its metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: str = Field( description: str = Field(
..., ...,
@ -612,7 +580,6 @@ class SweepTable(DynamicTable):
The table which groups different PatchClampSeries together. The table which groups different PatchClampSeries together.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
sweep_number: Optional[List[int] | int] = Field( sweep_number: Optional[List[int] | int] = Field(
default_factory=list, default_factory=list,
@ -648,35 +615,9 @@ class SweepTableSeriesIndex(VectorIndex):
Index for series. Index for series.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["series_index"] = Field("series_index") name: Literal["series_index"] = Field("series_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
description="""Reference to the target dataset that this index applies to.""", description="""Reference to the target dataset that this index applies to.""",
) )
array: Optional[NDArray[Shape["* num_rows"], Any]] = Field(None) array: Optional[NDArray[Shape["* num_rows"], Any]] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
PatchClampSeries.model_rebuild()
PatchClampSeriesData.model_rebuild()
CurrentClampSeries.model_rebuild()
CurrentClampSeriesData.model_rebuild()
IZeroClampSeries.model_rebuild()
CurrentClampStimulusSeries.model_rebuild()
CurrentClampStimulusSeriesData.model_rebuild()
VoltageClampSeries.model_rebuild()
VoltageClampSeriesData.model_rebuild()
VoltageClampSeriesCapacitanceFast.model_rebuild()
VoltageClampSeriesCapacitanceSlow.model_rebuild()
VoltageClampSeriesResistanceCompBandwidth.model_rebuild()
VoltageClampSeriesResistanceCompCorrection.model_rebuild()
VoltageClampSeriesResistanceCompPrediction.model_rebuild()
VoltageClampSeriesWholeCellCapacitanceComp.model_rebuild()
VoltageClampSeriesWholeCellSeriesResistanceComp.model_rebuild()
VoltageClampStimulusSeries.model_rebuild()
VoltageClampStimulusSeriesData.model_rebuild()
IntracellularElectrode.model_rebuild()
SweepTable.model_rebuild()
SweepTableSeriesIndex.model_rebuild()

View file

@ -27,7 +27,7 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync from .core_nwb_base import Image, TimeSeriesStartingTime, TimeSeries, TimeSeriesSync
metamodel_version = "None" metamodel_version = "None"
@ -35,13 +35,6 @@ version = "2.2.4"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class GrayscaleImage(Image): class GrayscaleImage(Image):
""" """
A grayscale image. A grayscale image.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -94,7 +80,6 @@ class RGBImage(Image):
A color image. A color image.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -116,7 +101,6 @@ class RGBAImage(Image):
A color image with transparency. A color image with transparency.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -138,7 +122,6 @@ class ImageSeries(TimeSeries):
General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z]. General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z].
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Optional[ data: Optional[
Union[ Union[
@ -191,7 +174,6 @@ class ImageSeriesExternalFile(ConfiguredBaseModel):
Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file. Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["external_file"] = Field("external_file") name: Literal["external_file"] = Field("external_file")
starting_frame: Optional[int] = Field( starting_frame: Optional[int] = Field(
None, None,
@ -205,7 +187,6 @@ class ImageMaskSeries(ImageSeries):
An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed. An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Optional[ data: Optional[
Union[ Union[
@ -258,7 +239,6 @@ class OpticalSeries(ImageSeries):
Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important. Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
distance: Optional[float] = Field( distance: Optional[float] = Field(
None, description="""Distance from camera/monitor to target/eye.""" None, description="""Distance from camera/monitor to target/eye."""
@ -327,7 +307,6 @@ class IndexSeries(TimeSeries):
Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed. Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], int] = Field( data: NDArray[Shape["* num_times"], int] = Field(
..., description="""Index of the frame in the referenced ImageSeries.""" ..., description="""Index of the frame in the referenced ImageSeries."""
@ -359,15 +338,3 @@ class IndexSeries(TimeSeries):
None, None,
description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""", description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
GrayscaleImage.model_rebuild()
RGBImage.model_rebuild()
RGBAImage.model_rebuild()
ImageSeries.model_rebuild()
ImageSeriesExternalFile.model_rebuild()
ImageMaskSeries.model_rebuild()
OpticalSeries.model_rebuild()
IndexSeries.model_rebuild()

View file

@ -32,13 +32,6 @@ version = "None"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -56,13 +49,3 @@ class ConfiguredBaseModel(BaseModel):
self.array[i] = value self.array[i] = value
else: else:
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model

View file

@ -27,15 +27,15 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync
from ...hdmf_common.v1_1_3.hdmf_common_table import ( from ...hdmf_common.v1_1_3.hdmf_common_table import (
VectorIndex,
DynamicTableRegion, DynamicTableRegion,
DynamicTable, DynamicTable,
VectorIndex,
VectorData, VectorData,
) )
from .core_nwb_base import TimeSeriesStartingTime, TimeSeries, TimeSeriesSync
from .core_nwb_ecephys import ElectrodeGroup from .core_nwb_ecephys import ElectrodeGroup
@ -44,13 +44,6 @@ version = "2.2.4"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -70,18 +63,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class AbstractFeatureSeries(TimeSeries): class AbstractFeatureSeries(TimeSeries):
""" """
Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical. Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Values of each feature at each time.""") data: str = Field(..., description="""Values of each feature at each time.""")
feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field( feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field(
@ -125,7 +111,6 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel):
Values of each feature at each time. Values of each feature at each time.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -144,7 +129,6 @@ class AnnotationSeries(TimeSeries):
Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way. Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], str] = Field( data: NDArray[Shape["* num_times"], str] = Field(
..., description="""Annotations made during an experiment.""" ..., description="""Annotations made during an experiment."""
@ -183,7 +167,6 @@ class IntervalSeries(TimeSeries):
Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way. Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], int] = Field( data: NDArray[Shape["* num_times"], int] = Field(
..., description="""Use values >0 if interval started, <0 if interval ended.""" ..., description="""Use values >0 if interval started, <0 if interval ended."""
@ -222,7 +205,6 @@ class DecompositionSeries(TimeSeries):
Spectral analysis of a time series, e.g. of an LFP or a speech signal. Spectral analysis of a time series, e.g. of an LFP or a speech signal.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Data decomposed into frequency bands.""") data: str = Field(..., description="""Data decomposed into frequency bands.""")
metric: str = Field( metric: str = Field(
@ -266,7 +248,6 @@ class DecompositionSeriesData(ConfiguredBaseModel):
Data decomposed into frequency bands. Data decomposed into frequency bands.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -282,7 +263,6 @@ class DecompositionSeriesBands(DynamicTable):
Table for describing the bands that this series was generated from. There should be one row in this table for each band. Table for describing the bands that this series was generated from. There should be one row in this table for each band.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["bands"] = Field("bands") name: Literal["bands"] = Field("bands")
band_name: Optional[List[str] | str] = Field( band_name: Optional[List[str] | str] = Field(
default_factory=list, description="""Name of the band, e.g. theta.""" default_factory=list, description="""Name of the band, e.g. theta."""
@ -322,7 +302,6 @@ class Units(DynamicTable):
Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times. Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("Units") name: str = Field("Units")
spike_times_index: Optional[str] = Field( spike_times_index: Optional[str] = Field(
None, description="""Index into the spike_times dataset.""" None, description="""Index into the spike_times dataset."""
@ -386,7 +365,6 @@ class UnitsSpikeTimesIndex(VectorIndex):
Index into the spike_times dataset. Index into the spike_times dataset.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["spike_times_index"] = Field("spike_times_index") name: Literal["spike_times_index"] = Field("spike_times_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -400,7 +378,6 @@ class UnitsSpikeTimes(VectorData):
Spike times for each unit. Spike times for each unit.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["spike_times"] = Field("spike_times") name: Literal["spike_times"] = Field("spike_times")
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, None,
@ -424,7 +401,6 @@ class UnitsObsIntervalsIndex(VectorIndex):
Index into the obs_intervals dataset. Index into the obs_intervals dataset.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["obs_intervals_index"] = Field("obs_intervals_index") name: Literal["obs_intervals_index"] = Field("obs_intervals_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -438,7 +414,6 @@ class UnitsElectrodesIndex(VectorIndex):
Index into electrodes. Index into electrodes.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes_index"] = Field("electrodes_index") name: Literal["electrodes_index"] = Field("electrodes_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -452,7 +427,6 @@ class UnitsElectrodes(DynamicTableRegion):
Electrode that each spike unit came from, specified using a DynamicTableRegion. Electrode that each spike unit came from, specified using a DynamicTableRegion.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -469,20 +443,3 @@ class UnitsElectrodes(DynamicTableRegion):
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any],
] ]
] = Field(None) ] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
AbstractFeatureSeries.model_rebuild()
AbstractFeatureSeriesData.model_rebuild()
AnnotationSeries.model_rebuild()
IntervalSeries.model_rebuild()
DecompositionSeries.model_rebuild()
DecompositionSeriesData.model_rebuild()
DecompositionSeriesBands.model_rebuild()
Units.model_rebuild()
UnitsSpikeTimesIndex.model_rebuild()
UnitsSpikeTimes.model_rebuild()
UnitsObsIntervalsIndex.model_rebuild()
UnitsElectrodesIndex.model_rebuild()
UnitsElectrodes.model_rebuild()

View file

@ -29,9 +29,9 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeriesSync, TimeSeriesSync,
TimeSeries,
NWBContainer, NWBContainer,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeries,
) )
@ -40,13 +40,6 @@ version = "2.2.4"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -66,18 +59,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class OptogeneticSeries(TimeSeries): class OptogeneticSeries(TimeSeries):
""" """
An optogenetic stimulus. An optogenetic stimulus.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], float] = Field( data: NDArray[Shape["* num_times"], float] = Field(
..., description="""Applied power for optogenetic stimulus, in watts.""" ..., description="""Applied power for optogenetic stimulus, in watts."""
@ -116,7 +102,6 @@ class OptogeneticStimulusSite(NWBContainer):
A site of optogenetic stimulation. A site of optogenetic stimulation.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: str = Field(..., description="""Description of stimulation site.""") description: str = Field(..., description="""Description of stimulation site.""")
excitation_lambda: float = Field( excitation_lambda: float = Field(
@ -126,9 +111,3 @@ class OptogeneticStimulusSite(NWBContainer):
..., ...,
description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""", description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
OptogeneticSeries.model_rebuild()
OptogeneticStimulusSite.model_rebuild()

View file

@ -28,18 +28,18 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeries,
TimeSeriesSync,
NWBDataInterface,
TimeSeriesStartingTime,
NWBContainer, NWBContainer,
TimeSeriesSync,
TimeSeriesStartingTime,
NWBDataInterface,
TimeSeries,
) )
from ...hdmf_common.v1_1_3.hdmf_common_table import ( from ...hdmf_common.v1_1_3.hdmf_common_table import (
DynamicTableRegion, DynamicTableRegion,
VectorIndex,
DynamicTable, DynamicTable,
VectorData, VectorData,
VectorIndex,
) )
from .core_nwb_image import ImageSeries, ImageSeriesExternalFile from .core_nwb_image import ImageSeries, ImageSeriesExternalFile
@ -50,13 +50,6 @@ version = "2.2.4"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -76,18 +69,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class TwoPhotonSeries(ImageSeries): class TwoPhotonSeries(ImageSeries):
""" """
Image stack recorded over time from 2-photon microscope. Image stack recorded over time from 2-photon microscope.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""") pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""")
scan_line_rate: Optional[float] = Field( scan_line_rate: Optional[float] = Field(
@ -154,7 +140,6 @@ class RoiResponseSeries(TimeSeries):
ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Union[ data: Union[
NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times"], float],
@ -198,7 +183,6 @@ class RoiResponseSeriesRois(DynamicTableRegion):
DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries. DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["rois"] = Field("rois") name: Literal["rois"] = Field("rois")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -222,7 +206,6 @@ class DfOverF(NWBDataInterface):
dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes). dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field( children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -234,7 +217,6 @@ class Fluorescence(NWBDataInterface):
Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes). Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field( children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -246,7 +228,6 @@ class ImageSegmentation(NWBDataInterface):
Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them. Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[PlaneSegmentation] | PlaneSegmentation] = Field( children: Optional[List[PlaneSegmentation] | PlaneSegmentation] = Field(
default_factory=dict default_factory=dict
) )
@ -258,7 +239,6 @@ class PlaneSegmentation(DynamicTable):
Results from image segmentation of a specific imaging plane. Results from image segmentation of a specific imaging plane.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
image_mask: Optional[ image_mask: Optional[
Union[ Union[
@ -312,7 +292,6 @@ class PlaneSegmentationPixelMaskIndex(VectorIndex):
Index into pixel_mask. Index into pixel_mask.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["pixel_mask_index"] = Field("pixel_mask_index") name: Literal["pixel_mask_index"] = Field("pixel_mask_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -326,7 +305,6 @@ class PlaneSegmentationPixelMask(VectorData):
Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["pixel_mask"] = Field("pixel_mask") name: Literal["pixel_mask"] = Field("pixel_mask")
x: Optional[int] = Field(None, description="""Pixel x-coordinate.""") x: Optional[int] = Field(None, description="""Pixel x-coordinate.""")
y: Optional[int] = Field(None, description="""Pixel y-coordinate.""") y: Optional[int] = Field(None, description="""Pixel y-coordinate.""")
@ -349,7 +327,6 @@ class PlaneSegmentationVoxelMaskIndex(VectorIndex):
Index into voxel_mask. Index into voxel_mask.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["voxel_mask_index"] = Field("voxel_mask_index") name: Literal["voxel_mask_index"] = Field("voxel_mask_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -363,7 +340,6 @@ class PlaneSegmentationVoxelMask(VectorData):
Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["voxel_mask"] = Field("voxel_mask") name: Literal["voxel_mask"] = Field("voxel_mask")
x: Optional[int] = Field(None, description="""Voxel x-coordinate.""") x: Optional[int] = Field(None, description="""Voxel x-coordinate.""")
y: Optional[int] = Field(None, description="""Voxel y-coordinate.""") y: Optional[int] = Field(None, description="""Voxel y-coordinate.""")
@ -387,7 +363,6 @@ class ImagingPlane(NWBContainer):
An imaging plane and its metadata. An imaging plane and its metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[OpticalChannel] | OpticalChannel] = Field( children: Optional[List[OpticalChannel] | OpticalChannel] = Field(
default_factory=dict default_factory=dict
) )
@ -399,7 +374,6 @@ class OpticalChannel(NWBContainer):
An optical channel used to record from an imaging plane. An optical channel used to record from an imaging plane.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: str = Field( description: str = Field(
..., description="""Description or other notes about the channel.""" ..., description="""Description or other notes about the channel."""
@ -414,7 +388,6 @@ class MotionCorrection(NWBDataInterface):
An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions). An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[CorrectedImageStack] | CorrectedImageStack] = Field( children: Optional[List[CorrectedImageStack] | CorrectedImageStack] = Field(
default_factory=dict default_factory=dict
) )
@ -426,7 +399,6 @@ class CorrectedImageStack(NWBDataInterface):
Reuslts from motion correction of an image stack. Reuslts from motion correction of an image stack.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
corrected: str = Field( corrected: str = Field(
..., ...,
@ -436,22 +408,3 @@ class CorrectedImageStack(NWBDataInterface):
..., ...,
description="""Stores the x,y delta necessary to align each frame to the common coordinates, for example, to align each frame to a reference image.""", description="""Stores the x,y delta necessary to align each frame to the common coordinates, for example, to align each frame to a reference image.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
TwoPhotonSeries.model_rebuild()
RoiResponseSeries.model_rebuild()
RoiResponseSeriesRois.model_rebuild()
DfOverF.model_rebuild()
Fluorescence.model_rebuild()
ImageSegmentation.model_rebuild()
PlaneSegmentation.model_rebuild()
PlaneSegmentationPixelMaskIndex.model_rebuild()
PlaneSegmentationPixelMask.model_rebuild()
PlaneSegmentationVoxelMaskIndex.model_rebuild()
PlaneSegmentationVoxelMask.model_rebuild()
ImagingPlane.model_rebuild()
OpticalChannel.model_rebuild()
MotionCorrection.model_rebuild()
CorrectedImageStack.model_rebuild()

View file

@ -35,13 +35,6 @@ version = "2.2.4"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class ImagingRetinotopy(NWBDataInterface): class ImagingRetinotopy(NWBDataInterface):
""" """
Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. This group does not store the raw responses imaged during retinotopic mapping or the stimuli presented, but rather the resulting phase and power maps after applying a Fourier transform on the averaged responses. Note: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x). Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. This group does not store the raw responses imaged during retinotopic mapping or the stimuli presented, but rather the resulting phase and power maps after applying a Fourier transform on the averaged responses. Note: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("ImagingRetinotopy") name: str = Field("ImagingRetinotopy")
axis_1_phase_map: str = Field( axis_1_phase_map: str = Field(
..., description="""Phase response to stimulus on the first measured axis.""" ..., description="""Phase response to stimulus on the first measured axis."""
@ -111,7 +97,6 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel):
Phase response to stimulus on the first measured axis. Phase response to stimulus on the first measured axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_1_phase_map"] = Field("axis_1_phase_map") name: Literal["axis_1_phase_map"] = Field("axis_1_phase_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -131,7 +116,6 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel):
Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_1_power_map"] = Field("axis_1_power_map") name: Literal["axis_1_power_map"] = Field("axis_1_power_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -151,7 +135,6 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel):
Phase response to stimulus on the second measured axis. Phase response to stimulus on the second measured axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_2_phase_map"] = Field("axis_2_phase_map") name: Literal["axis_2_phase_map"] = Field("axis_2_phase_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -171,7 +154,6 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel):
Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_2_power_map"] = Field("axis_2_power_map") name: Literal["axis_2_power_map"] = Field("axis_2_power_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -191,7 +173,6 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel):
Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns]. Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["focal_depth_image"] = Field("focal_depth_image") name: Literal["focal_depth_image"] = Field("focal_depth_image")
bits_per_pixel: Optional[int] = Field( bits_per_pixel: Optional[int] = Field(
None, None,
@ -218,7 +199,6 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel):
Sine of the angle between the direction of the gradient in axis_1 and axis_2. Sine of the angle between the direction of the gradient in axis_1 and axis_2.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["sign_map"] = Field("sign_map") name: Literal["sign_map"] = Field("sign_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -235,7 +215,6 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel):
Gray-scale anatomical image of cortical surface. Array structure: [rows][columns] Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["vasculature_image"] = Field("vasculature_image") name: Literal["vasculature_image"] = Field("vasculature_image")
bits_per_pixel: Optional[int] = Field( bits_per_pixel: Optional[int] = Field(
None, None,
@ -252,15 +231,3 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel):
None, description="""Format of image. Right now only 'raw' is supported.""" None, description="""Format of image. Right now only 'raw' is supported."""
) )
array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field(None) array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ImagingRetinotopy.model_rebuild()
ImagingRetinotopyAxis1PhaseMap.model_rebuild()
ImagingRetinotopyAxis1PowerMap.model_rebuild()
ImagingRetinotopyAxis2PhaseMap.model_rebuild()
ImagingRetinotopyAxis2PowerMap.model_rebuild()
ImagingRetinotopyFocalDepthImage.model_rebuild()
ImagingRetinotopySignMap.model_rebuild()
ImagingRetinotopyVasculatureImage.model_rebuild()

View file

@ -196,13 +196,6 @@ version = "2.2.4"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -220,13 +213,3 @@ class ConfiguredBaseModel(BaseModel):
self.array[i] = value self.array[i] = value
else: else:
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model

View file

@ -27,7 +27,7 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from ...hdmf_common.v1_1_3.hdmf_common_table import Container, Data, DynamicTable from ...hdmf_common.v1_1_3.hdmf_common_table import Data, Container, DynamicTable
metamodel_version = "None" metamodel_version = "None"
@ -35,13 +35,6 @@ version = "2.2.5"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class NWBData(Data): class NWBData(Data):
""" """
An abstract data type for a dataset. An abstract data type for a dataset.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -81,7 +67,6 @@ class Image(NWBData):
An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)). An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -103,7 +88,6 @@ class NWBContainer(Container):
An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers. An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -112,7 +96,6 @@ class NWBDataInterface(NWBContainer):
An abstract data type for a generic container storing collections of data, as opposed to metadata. An abstract data type for a generic container storing collections of data, as opposed to metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -121,7 +104,6 @@ class TimeSeries(NWBDataInterface):
General purpose time series. General purpose time series.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of the time series.""" None, description="""Description of the time series."""
@ -161,7 +143,6 @@ class TimeSeriesData(ConfiguredBaseModel):
Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file. Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
conversion: Optional[float] = Field( conversion: Optional[float] = Field(
None, None,
@ -190,7 +171,6 @@ class TimeSeriesStartingTime(ConfiguredBaseModel):
Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute. Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["starting_time"] = Field("starting_time") name: Literal["starting_time"] = Field("starting_time")
rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""") rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""")
unit: Optional[str] = Field( unit: Optional[str] = Field(
@ -205,7 +185,6 @@ class TimeSeriesSync(ConfiguredBaseModel):
Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes. Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["sync"] = Field("sync") name: Literal["sync"] = Field("sync")
@ -214,7 +193,6 @@ class ProcessingModule(NWBContainer):
A collection of processed data. A collection of processed data.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[ children: Optional[
List[Union[BaseModel, DynamicTable, NWBDataInterface]] List[Union[BaseModel, DynamicTable, NWBDataInterface]]
| Union[BaseModel, DynamicTable, NWBDataInterface] | Union[BaseModel, DynamicTable, NWBDataInterface]
@ -227,7 +205,6 @@ class Images(NWBDataInterface):
A collection of images. A collection of images.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("Images") name: str = Field("Images")
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of this collection of images.""" None, description="""Description of this collection of images."""
@ -235,17 +212,3 @@ class Images(NWBDataInterface):
image: List[str] | str = Field( image: List[str] | str = Field(
default_factory=list, description="""Images stored in this collection.""" default_factory=list, description="""Images stored in this collection."""
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
NWBData.model_rebuild()
Image.model_rebuild()
NWBContainer.model_rebuild()
NWBDataInterface.model_rebuild()
TimeSeries.model_rebuild()
TimeSeriesData.model_rebuild()
TimeSeriesStartingTime.model_rebuild()
TimeSeriesSync.model_rebuild()
ProcessingModule.model_rebuild()
Images.model_rebuild()

View file

@ -28,9 +28,9 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesStartingTime, TimeSeriesStartingTime,
NWBDataInterface,
TimeSeriesSync, TimeSeriesSync,
) )
@ -42,13 +42,6 @@ version = "2.2.5"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -68,18 +61,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class SpatialSeries(TimeSeries): class SpatialSeries(TimeSeries):
""" """
Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values. Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field( data: str = Field(
..., ...,
@ -123,7 +109,6 @@ class SpatialSeriesData(ConfiguredBaseModel):
1-D or 2-D array storing position or direction relative to some reference frame. 1-D or 2-D array storing position or direction relative to some reference frame.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -142,7 +127,6 @@ class BehavioralEpochs(NWBDataInterface):
TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data. TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[IntervalSeries] | IntervalSeries] = Field( children: Optional[List[IntervalSeries] | IntervalSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -154,7 +138,6 @@ class BehavioralEvents(NWBDataInterface):
TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details. TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict) children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -164,7 +147,6 @@ class BehavioralTimeSeries(NWBDataInterface):
TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details. TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict) children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -174,7 +156,6 @@ class PupilTracking(NWBDataInterface):
Eye-tracking data, representing pupil size. Eye-tracking data, representing pupil size.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict) children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -184,7 +165,6 @@ class EyeTracking(NWBDataInterface):
Eye-tracking data, representing direction of gaze. Eye-tracking data, representing direction of gaze.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpatialSeries] | SpatialSeries] = Field( children: Optional[List[SpatialSeries] | SpatialSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -196,7 +176,6 @@ class CompassDirection(NWBDataInterface):
With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees. With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpatialSeries] | SpatialSeries] = Field( children: Optional[List[SpatialSeries] | SpatialSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -208,21 +187,7 @@ class Position(NWBDataInterface):
Position data, whether along the x, x/y or x/y/z axis. Position data, whether along the x, x/y or x/y/z axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpatialSeries] | SpatialSeries] = Field( children: Optional[List[SpatialSeries] | SpatialSeries] = Field(
default_factory=dict default_factory=dict
) )
name: str = Field(...) name: str = Field(...)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
SpatialSeries.model_rebuild()
SpatialSeriesData.model_rebuild()
BehavioralEpochs.model_rebuild()
BehavioralEvents.model_rebuild()
BehavioralTimeSeries.model_rebuild()
PupilTracking.model_rebuild()
EyeTracking.model_rebuild()
CompassDirection.model_rebuild()
Position.model_rebuild()

View file

@ -35,13 +35,6 @@ version = "2.2.5"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class Device(NWBContainer): class Device(NWBContainer):
""" """
Metadata about a data acquisition device, e.g., recording system, electrode, microscope. Metadata about a data acquisition device, e.g., recording system, electrode, microscope.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, None,
@ -81,8 +67,3 @@ class Device(NWBContainer):
manufacturer: Optional[str] = Field( manufacturer: Optional[str] = Field(
None, description="""The name of the manufacturer of the device.""" None, description="""The name of the manufacturer of the device."""
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
Device.model_rebuild()

View file

@ -27,29 +27,22 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTableRegion, DynamicTable
from .core_nwb_base import ( from .core_nwb_base import (
NWBContainer,
TimeSeriesStartingTime,
NWBDataInterface, NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesStartingTime,
NWBContainer,
TimeSeriesSync, TimeSeriesSync,
) )
from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTableRegion, DynamicTable
metamodel_version = "None" metamodel_version = "None"
version = "2.2.5" version = "2.2.5"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -69,18 +62,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class ElectricalSeries(TimeSeries): class ElectricalSeries(TimeSeries):
""" """
A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels. A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Union[ data: Union[
NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times"], float],
@ -129,7 +115,6 @@ class ElectricalSeriesElectrodes(DynamicTableRegion):
DynamicTableRegion pointer to the electrodes that this time series was generated from. DynamicTableRegion pointer to the electrodes that this time series was generated from.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -153,7 +138,6 @@ class SpikeEventSeries(ElectricalSeries):
Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode). Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Union[ data: Union[
NDArray[Shape["* num_events, * num_channels, * num_samples"], float], NDArray[Shape["* num_events, * num_channels, * num_samples"], float],
@ -201,7 +185,6 @@ class FeatureExtraction(NWBDataInterface):
Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("FeatureExtraction") name: str = Field("FeatureExtraction")
description: NDArray[Shape["* num_features"], str] = Field( description: NDArray[Shape["* num_features"], str] = Field(
..., ...,
@ -228,7 +211,6 @@ class FeatureExtractionElectrodes(DynamicTableRegion):
DynamicTableRegion pointer to the electrodes that this time series was generated from. DynamicTableRegion pointer to the electrodes that this time series was generated from.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -252,7 +234,6 @@ class EventDetection(NWBDataInterface):
Detected spike events from voltage trace(s). Detected spike events from voltage trace(s).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("EventDetection") name: str = Field("EventDetection")
detection_method: str = Field( detection_method: str = Field(
..., ...,
@ -272,7 +253,6 @@ class EventWaveform(NWBDataInterface):
Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition. Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpikeEventSeries] | SpikeEventSeries] = Field( children: Optional[List[SpikeEventSeries] | SpikeEventSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -284,7 +264,6 @@ class FilteredEphys(NWBDataInterface):
Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries. Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field( children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -296,7 +275,6 @@ class LFP(NWBDataInterface):
LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries description or comments field. LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries description or comments field.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field( children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -308,7 +286,6 @@ class ElectrodeGroup(NWBContainer):
A physical grouping of electrodes, e.g. a shank of an array. A physical grouping of electrodes, e.g. a shank of an array.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of this electrode group.""" None, description="""Description of this electrode group."""
@ -327,7 +304,6 @@ class ElectrodeGroupPosition(ConfiguredBaseModel):
stereotaxic or common framework coordinates stereotaxic or common framework coordinates
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["position"] = Field("position") name: Literal["position"] = Field("position")
x: Optional[float] = Field(None, description="""x coordinate""") x: Optional[float] = Field(None, description="""x coordinate""")
y: Optional[float] = Field(None, description="""y coordinate""") y: Optional[float] = Field(None, description="""y coordinate""")
@ -339,7 +315,6 @@ class ClusterWaveforms(NWBDataInterface):
DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one. DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("ClusterWaveforms") name: str = Field("ClusterWaveforms")
waveform_filtering: str = Field( waveform_filtering: str = Field(
..., description="""Filtering applied to data before generating mean/sd""" ..., description="""Filtering applied to data before generating mean/sd"""
@ -359,7 +334,6 @@ class Clustering(NWBDataInterface):
DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("Clustering") name: str = Field("Clustering")
description: str = Field( description: str = Field(
..., ...,
@ -376,20 +350,3 @@ class Clustering(NWBDataInterface):
..., ...,
description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""", description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ElectricalSeries.model_rebuild()
ElectricalSeriesElectrodes.model_rebuild()
SpikeEventSeries.model_rebuild()
FeatureExtraction.model_rebuild()
FeatureExtractionElectrodes.model_rebuild()
EventDetection.model_rebuild()
EventWaveform.model_rebuild()
FilteredEphys.model_rebuild()
LFP.model_rebuild()
ElectrodeGroup.model_rebuild()
ElectrodeGroupPosition.model_rebuild()
ClusterWaveforms.model_rebuild()
Clustering.model_rebuild()

View file

@ -27,27 +27,20 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import TimeSeries
from ...hdmf_common.v1_1_3.hdmf_common_table import ( from ...hdmf_common.v1_1_3.hdmf_common_table import (
DynamicTable,
VectorIndex, VectorIndex,
DynamicTable,
VectorData, VectorData,
) )
from .core_nwb_base import TimeSeries
metamodel_version = "None" metamodel_version = "None"
version = "2.2.5" version = "2.2.5"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -67,18 +60,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class TimeIntervals(DynamicTable): class TimeIntervals(DynamicTable):
""" """
A container for aggregating epoch data and the TimeSeries that each epoch applies to. A container for aggregating epoch data and the TimeSeries that each epoch applies to.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
start_time: Optional[List[float] | float] = Field( start_time: Optional[List[float] | float] = Field(
default_factory=list, description="""Start time of epoch, in seconds.""" default_factory=list, description="""Start time of epoch, in seconds."""
@ -122,7 +108,6 @@ class TimeIntervalsTagsIndex(VectorIndex):
Index for tags. Index for tags.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["tags_index"] = Field("tags_index") name: Literal["tags_index"] = Field("tags_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -136,7 +121,6 @@ class TimeIntervalsTimeseries(VectorData):
An index into a TimeSeries object. An index into a TimeSeries object.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["timeseries"] = Field("timeseries") name: Literal["timeseries"] = Field("timeseries")
idx_start: Optional[int] = Field( idx_start: Optional[int] = Field(
None, None,
@ -167,18 +151,9 @@ class TimeIntervalsTimeseriesIndex(VectorIndex):
Index for timeseries. Index for timeseries.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["timeseries_index"] = Field("timeseries_index") name: Literal["timeseries_index"] = Field("timeseries_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
description="""Reference to the target dataset that this index applies to.""", description="""Reference to the target dataset that this index applies to.""",
) )
array: Optional[NDArray[Shape["* num_rows"], Any]] = Field(None) array: Optional[NDArray[Shape["* num_rows"], Any]] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
TimeIntervals.model_rebuild()
TimeIntervalsTagsIndex.model_rebuild()
TimeIntervalsTimeseries.model_rebuild()
TimeIntervalsTimeseriesIndex.model_rebuild()

View file

@ -27,33 +27,33 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_ophys import ImagingPlane from .core_nwb_icephys import SweepTable, IntracellularElectrode
from .core_nwb_base import (
TimeSeries,
NWBDataInterface,
ProcessingModule,
NWBContainer,
NWBData,
)
from .core_nwb_epoch import TimeIntervals from .core_nwb_epoch import TimeIntervals
from ...hdmf_common.v1_1_3.hdmf_common_table import ( from .core_nwb_ecephys import ElectrodeGroup
DynamicTable,
VectorData, from .core_nwb_base import (
VectorIndex, NWBContainer,
ProcessingModule,
NWBData,
NWBDataInterface,
TimeSeries,
) )
from .core_nwb_icephys import IntracellularElectrode, SweepTable from .core_nwb_device import Device
from .core_nwb_ogen import OptogeneticStimulusSite
from .core_nwb_misc import Units from .core_nwb_misc import Units
from .core_nwb_ecephys import ElectrodeGroup from .core_nwb_ogen import OptogeneticStimulusSite
from .core_nwb_device import Device from ...hdmf_common.v1_1_3.hdmf_common_table import (
VectorIndex,
DynamicTable,
VectorData,
)
from .core_nwb_ophys import ImagingPlane
metamodel_version = "None" metamodel_version = "None"
@ -61,13 +61,6 @@ version = "2.2.5"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -87,18 +80,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class ScratchData(NWBData): class ScratchData(NWBData):
""" """
Any one-off datasets Any one-off datasets
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
notes: Optional[str] = Field( notes: Optional[str] = Field(
None, description="""Any notes the user has about the dataset being stored""" None, description="""Any notes the user has about the dataset being stored"""
@ -110,7 +96,6 @@ class NWBFile(NWBContainer):
An NWB:N file storing cellular-based neurophysiology data from a single experimental session. An NWB:N file storing cellular-based neurophysiology data from a single experimental session.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: Literal["root"] = Field("root") name: Literal["root"] = Field("root")
nwb_version: Optional[str] = Field( nwb_version: Optional[str] = Field(
None, None,
@ -181,7 +166,6 @@ class NWBFileStimulus(ConfiguredBaseModel):
Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file. Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["stimulus"] = Field("stimulus") name: Literal["stimulus"] = Field("stimulus")
presentation: Optional[List[TimeSeries] | TimeSeries] = Field( presentation: Optional[List[TimeSeries] | TimeSeries] = Field(
default_factory=dict, description="""Stimuli presented during the experiment.""" default_factory=dict, description="""Stimuli presented during the experiment."""
@ -197,7 +181,6 @@ class NWBFileGeneral(ConfiguredBaseModel):
Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them. Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["general"] = Field("general") name: Literal["general"] = Field("general")
data_collection: Optional[str] = Field( data_collection: Optional[str] = Field(
None, description="""Notes about data collection and analysis.""" None, description="""Notes about data collection and analysis."""
@ -287,7 +270,6 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel):
Script file or link to public source code used to create this NWB file. Script file or link to public source code used to create this NWB file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["source_script"] = Field("source_script") name: Literal["source_script"] = Field("source_script")
file_name: Optional[str] = Field(None, description="""Name of script file.""") file_name: Optional[str] = Field(None, description="""Name of script file.""")
value: str = Field(...) value: str = Field(...)
@ -298,7 +280,6 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel):
Metadata related to extracellular electrophysiology. Metadata related to extracellular electrophysiology.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["extracellular_ephys"] = Field("extracellular_ephys") name: Literal["extracellular_ephys"] = Field("extracellular_ephys")
electrode_group: Optional[List[str] | str] = Field( electrode_group: Optional[List[str] | str] = Field(
default_factory=list, description="""Physical group of electrodes.""" default_factory=list, description="""Physical group of electrodes."""
@ -314,7 +295,6 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
A table of all electrodes (i.e. channels) used for recording. A table of all electrodes (i.e. channels) used for recording.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
x: Optional[List[float] | float] = Field( x: Optional[List[float] | float] = Field(
default_factory=list, default_factory=list,
@ -384,7 +364,6 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel):
Metadata related to intracellular electrophysiology. Metadata related to intracellular electrophysiology.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["intracellular_ephys"] = Field("intracellular_ephys") name: Literal["intracellular_ephys"] = Field("intracellular_ephys")
filtering: Optional[str] = Field( filtering: Optional[str] = Field(
None, None,
@ -404,7 +383,6 @@ class LabMetaData(NWBContainer):
Lab-specific meta-data. Lab-specific meta-data.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -413,7 +391,6 @@ class Subject(NWBContainer):
Information about the animal or person from which the data was measured. Information about the animal or person from which the data was measured.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
age: Optional[str] = Field( age: Optional[str] = Field(
None, None,
@ -440,17 +417,3 @@ class Subject(NWBContainer):
None, None,
description="""Weight at time of experiment, at time of surgery and at other important times.""", description="""Weight at time of experiment, at time of surgery and at other important times.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ScratchData.model_rebuild()
NWBFile.model_rebuild()
NWBFileStimulus.model_rebuild()
NWBFileGeneral.model_rebuild()
NWBFileGeneralSourceScript.model_rebuild()
NWBFileGeneralExtracellularEphys.model_rebuild()
NWBFileGeneralExtracellularEphysElectrodes.model_rebuild()
NWBFileGeneralIntracellularEphys.model_rebuild()
LabMetaData.model_rebuild()
Subject.model_rebuild()

View file

@ -28,16 +28,16 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeries, NWBContainer,
TimeSeriesSync, TimeSeriesSync,
TimeSeriesStartingTime, TimeSeriesStartingTime,
NWBContainer, TimeSeries,
) )
from ...hdmf_common.v1_1_3.hdmf_common_table import ( from ...hdmf_common.v1_1_3.hdmf_common_table import (
VectorIndex,
DynamicTable, DynamicTable,
VectorData, VectorData,
VectorIndex,
) )
@ -46,13 +46,6 @@ version = "2.2.5"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -72,18 +65,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class PatchClampSeries(TimeSeries): class PatchClampSeries(TimeSeries):
""" """
An abstract base class for patch-clamp data - stimulus or response, current or voltage. An abstract base class for patch-clamp data - stimulus or response, current or voltage.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
None, description="""Protocol/stimulus name for this patch-clamp dataset.""" None, description="""Protocol/stimulus name for this patch-clamp dataset."""
@ -131,7 +117,6 @@ class PatchClampSeriesData(ConfiguredBaseModel):
Recorded voltage or current. Recorded voltage or current.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -145,7 +130,6 @@ class CurrentClampSeries(PatchClampSeries):
Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected. Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Recorded voltage.""") data: str = Field(..., description="""Recorded voltage.""")
bias_current: Optional[float] = Field( bias_current: Optional[float] = Field(
@ -202,7 +186,6 @@ class CurrentClampSeriesData(ConfiguredBaseModel):
Recorded voltage. Recorded voltage.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -216,7 +199,6 @@ class IZeroClampSeries(CurrentClampSeries):
Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell. Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
bias_current: float = Field( bias_current: float = Field(
..., description="""Bias current, in amps, fixed to 0.0.""" ..., description="""Bias current, in amps, fixed to 0.0."""
@ -273,7 +255,6 @@ class CurrentClampStimulusSeries(PatchClampSeries):
Stimulus current applied during current clamp recording. Stimulus current applied during current clamp recording.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Stimulus current applied.""") data: str = Field(..., description="""Stimulus current applied.""")
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
@ -321,7 +302,6 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel):
Stimulus current applied. Stimulus current applied.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -335,7 +315,6 @@ class VoltageClampSeries(PatchClampSeries):
Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected. Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Recorded current.""") data: str = Field(..., description="""Recorded current.""")
capacitance_fast: Optional[str] = Field( capacitance_fast: Optional[str] = Field(
@ -404,7 +383,6 @@ class VoltageClampSeriesData(ConfiguredBaseModel):
Recorded current. Recorded current.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -418,7 +396,6 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel):
Fast capacitance, in farads. Fast capacitance, in farads.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["capacitance_fast"] = Field("capacitance_fast") name: Literal["capacitance_fast"] = Field("capacitance_fast")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -432,7 +409,6 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel):
Slow capacitance, in farads. Slow capacitance, in farads.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["capacitance_slow"] = Field("capacitance_slow") name: Literal["capacitance_slow"] = Field("capacitance_slow")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -446,7 +422,6 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel):
Resistance compensation bandwidth, in hertz. Resistance compensation bandwidth, in hertz.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["resistance_comp_bandwidth"] = Field("resistance_comp_bandwidth") name: Literal["resistance_comp_bandwidth"] = Field("resistance_comp_bandwidth")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -460,7 +435,6 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel):
Resistance compensation correction, in percent. Resistance compensation correction, in percent.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["resistance_comp_correction"] = Field("resistance_comp_correction") name: Literal["resistance_comp_correction"] = Field("resistance_comp_correction")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -474,7 +448,6 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel):
Resistance compensation prediction, in percent. Resistance compensation prediction, in percent.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["resistance_comp_prediction"] = Field("resistance_comp_prediction") name: Literal["resistance_comp_prediction"] = Field("resistance_comp_prediction")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -488,7 +461,6 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel):
Whole cell capacitance compensation, in farads. Whole cell capacitance compensation, in farads.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["whole_cell_capacitance_comp"] = Field("whole_cell_capacitance_comp") name: Literal["whole_cell_capacitance_comp"] = Field("whole_cell_capacitance_comp")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -502,7 +474,6 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel):
Whole cell series resistance compensation, in ohms. Whole cell series resistance compensation, in ohms.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["whole_cell_series_resistance_comp"] = Field( name: Literal["whole_cell_series_resistance_comp"] = Field(
"whole_cell_series_resistance_comp" "whole_cell_series_resistance_comp"
) )
@ -518,7 +489,6 @@ class VoltageClampStimulusSeries(PatchClampSeries):
Stimulus voltage applied during a voltage clamp recording. Stimulus voltage applied during a voltage clamp recording.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Stimulus voltage applied.""") data: str = Field(..., description="""Stimulus voltage applied.""")
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
@ -566,7 +536,6 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel):
Stimulus voltage applied. Stimulus voltage applied.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -580,7 +549,6 @@ class IntracellularElectrode(NWBContainer):
An intracellular electrode and its metadata. An intracellular electrode and its metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: str = Field( description: str = Field(
..., ...,
@ -612,7 +580,6 @@ class SweepTable(DynamicTable):
The table which groups different PatchClampSeries together. The table which groups different PatchClampSeries together.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
sweep_number: Optional[List[int] | int] = Field( sweep_number: Optional[List[int] | int] = Field(
default_factory=list, default_factory=list,
@ -648,35 +615,9 @@ class SweepTableSeriesIndex(VectorIndex):
Index for series. Index for series.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["series_index"] = Field("series_index") name: Literal["series_index"] = Field("series_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
description="""Reference to the target dataset that this index applies to.""", description="""Reference to the target dataset that this index applies to.""",
) )
array: Optional[NDArray[Shape["* num_rows"], Any]] = Field(None) array: Optional[NDArray[Shape["* num_rows"], Any]] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
PatchClampSeries.model_rebuild()
PatchClampSeriesData.model_rebuild()
CurrentClampSeries.model_rebuild()
CurrentClampSeriesData.model_rebuild()
IZeroClampSeries.model_rebuild()
CurrentClampStimulusSeries.model_rebuild()
CurrentClampStimulusSeriesData.model_rebuild()
VoltageClampSeries.model_rebuild()
VoltageClampSeriesData.model_rebuild()
VoltageClampSeriesCapacitanceFast.model_rebuild()
VoltageClampSeriesCapacitanceSlow.model_rebuild()
VoltageClampSeriesResistanceCompBandwidth.model_rebuild()
VoltageClampSeriesResistanceCompCorrection.model_rebuild()
VoltageClampSeriesResistanceCompPrediction.model_rebuild()
VoltageClampSeriesWholeCellCapacitanceComp.model_rebuild()
VoltageClampSeriesWholeCellSeriesResistanceComp.model_rebuild()
VoltageClampStimulusSeries.model_rebuild()
VoltageClampStimulusSeriesData.model_rebuild()
IntracellularElectrode.model_rebuild()
SweepTable.model_rebuild()
SweepTableSeriesIndex.model_rebuild()

View file

@ -27,7 +27,7 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync from .core_nwb_base import Image, TimeSeriesStartingTime, TimeSeries, TimeSeriesSync
metamodel_version = "None" metamodel_version = "None"
@ -35,13 +35,6 @@ version = "2.2.5"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class GrayscaleImage(Image): class GrayscaleImage(Image):
""" """
A grayscale image. A grayscale image.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -94,7 +80,6 @@ class RGBImage(Image):
A color image. A color image.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -116,7 +101,6 @@ class RGBAImage(Image):
A color image with transparency. A color image with transparency.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -138,7 +122,6 @@ class ImageSeries(TimeSeries):
General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z]. General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z].
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Optional[ data: Optional[
Union[ Union[
@ -191,7 +174,6 @@ class ImageSeriesExternalFile(ConfiguredBaseModel):
Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file. Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["external_file"] = Field("external_file") name: Literal["external_file"] = Field("external_file")
starting_frame: Optional[int] = Field( starting_frame: Optional[int] = Field(
None, None,
@ -205,7 +187,6 @@ class ImageMaskSeries(ImageSeries):
An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed. An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Optional[ data: Optional[
Union[ Union[
@ -258,7 +239,6 @@ class OpticalSeries(ImageSeries):
Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important. Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
distance: Optional[float] = Field( distance: Optional[float] = Field(
None, description="""Distance from camera/monitor to target/eye.""" None, description="""Distance from camera/monitor to target/eye."""
@ -327,7 +307,6 @@ class IndexSeries(TimeSeries):
Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed. Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], int] = Field( data: NDArray[Shape["* num_times"], int] = Field(
..., description="""Index of the frame in the referenced ImageSeries.""" ..., description="""Index of the frame in the referenced ImageSeries."""
@ -359,15 +338,3 @@ class IndexSeries(TimeSeries):
None, None,
description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""", description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
GrayscaleImage.model_rebuild()
RGBImage.model_rebuild()
RGBAImage.model_rebuild()
ImageSeries.model_rebuild()
ImageSeriesExternalFile.model_rebuild()
ImageMaskSeries.model_rebuild()
OpticalSeries.model_rebuild()
IndexSeries.model_rebuild()

View file

@ -32,13 +32,6 @@ version = "None"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -56,13 +49,3 @@ class ConfiguredBaseModel(BaseModel):
self.array[i] = value self.array[i] = value
else: else:
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model

View file

@ -27,15 +27,15 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync
from ...hdmf_common.v1_1_3.hdmf_common_table import ( from ...hdmf_common.v1_1_3.hdmf_common_table import (
VectorIndex,
DynamicTableRegion, DynamicTableRegion,
DynamicTable, DynamicTable,
VectorIndex,
VectorData, VectorData,
) )
from .core_nwb_base import TimeSeriesStartingTime, TimeSeries, TimeSeriesSync
from .core_nwb_ecephys import ElectrodeGroup from .core_nwb_ecephys import ElectrodeGroup
@ -44,13 +44,6 @@ version = "2.2.5"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -70,18 +63,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class AbstractFeatureSeries(TimeSeries): class AbstractFeatureSeries(TimeSeries):
""" """
Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical. Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Values of each feature at each time.""") data: str = Field(..., description="""Values of each feature at each time.""")
feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field( feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field(
@ -125,7 +111,6 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel):
Values of each feature at each time. Values of each feature at each time.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -144,7 +129,6 @@ class AnnotationSeries(TimeSeries):
Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way. Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], str] = Field( data: NDArray[Shape["* num_times"], str] = Field(
..., description="""Annotations made during an experiment.""" ..., description="""Annotations made during an experiment."""
@ -183,7 +167,6 @@ class IntervalSeries(TimeSeries):
Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way. Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], int] = Field( data: NDArray[Shape["* num_times"], int] = Field(
..., description="""Use values >0 if interval started, <0 if interval ended.""" ..., description="""Use values >0 if interval started, <0 if interval ended."""
@ -222,7 +205,6 @@ class DecompositionSeries(TimeSeries):
Spectral analysis of a time series, e.g. of an LFP or a speech signal. Spectral analysis of a time series, e.g. of an LFP or a speech signal.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Data decomposed into frequency bands.""") data: str = Field(..., description="""Data decomposed into frequency bands.""")
metric: str = Field( metric: str = Field(
@ -266,7 +248,6 @@ class DecompositionSeriesData(ConfiguredBaseModel):
Data decomposed into frequency bands. Data decomposed into frequency bands.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -282,7 +263,6 @@ class DecompositionSeriesBands(DynamicTable):
Table for describing the bands that this series was generated from. There should be one row in this table for each band. Table for describing the bands that this series was generated from. There should be one row in this table for each band.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["bands"] = Field("bands") name: Literal["bands"] = Field("bands")
band_name: Optional[List[str] | str] = Field( band_name: Optional[List[str] | str] = Field(
default_factory=list, description="""Name of the band, e.g. theta.""" default_factory=list, description="""Name of the band, e.g. theta."""
@ -322,7 +302,6 @@ class Units(DynamicTable):
Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times. Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("Units") name: str = Field("Units")
spike_times_index: Optional[str] = Field( spike_times_index: Optional[str] = Field(
None, description="""Index into the spike_times dataset.""" None, description="""Index into the spike_times dataset."""
@ -386,7 +365,6 @@ class UnitsSpikeTimesIndex(VectorIndex):
Index into the spike_times dataset. Index into the spike_times dataset.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["spike_times_index"] = Field("spike_times_index") name: Literal["spike_times_index"] = Field("spike_times_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -400,7 +378,6 @@ class UnitsSpikeTimes(VectorData):
Spike times for each unit. Spike times for each unit.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["spike_times"] = Field("spike_times") name: Literal["spike_times"] = Field("spike_times")
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, None,
@ -424,7 +401,6 @@ class UnitsObsIntervalsIndex(VectorIndex):
Index into the obs_intervals dataset. Index into the obs_intervals dataset.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["obs_intervals_index"] = Field("obs_intervals_index") name: Literal["obs_intervals_index"] = Field("obs_intervals_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -438,7 +414,6 @@ class UnitsElectrodesIndex(VectorIndex):
Index into electrodes. Index into electrodes.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes_index"] = Field("electrodes_index") name: Literal["electrodes_index"] = Field("electrodes_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -452,7 +427,6 @@ class UnitsElectrodes(DynamicTableRegion):
Electrode that each spike unit came from, specified using a DynamicTableRegion. Electrode that each spike unit came from, specified using a DynamicTableRegion.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -469,20 +443,3 @@ class UnitsElectrodes(DynamicTableRegion):
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any],
] ]
] = Field(None) ] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
AbstractFeatureSeries.model_rebuild()
AbstractFeatureSeriesData.model_rebuild()
AnnotationSeries.model_rebuild()
IntervalSeries.model_rebuild()
DecompositionSeries.model_rebuild()
DecompositionSeriesData.model_rebuild()
DecompositionSeriesBands.model_rebuild()
Units.model_rebuild()
UnitsSpikeTimesIndex.model_rebuild()
UnitsSpikeTimes.model_rebuild()
UnitsObsIntervalsIndex.model_rebuild()
UnitsElectrodesIndex.model_rebuild()
UnitsElectrodes.model_rebuild()

View file

@ -29,9 +29,9 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeriesSync, TimeSeriesSync,
TimeSeries,
NWBContainer, NWBContainer,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeries,
) )
@ -40,13 +40,6 @@ version = "2.2.5"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -66,18 +59,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class OptogeneticSeries(TimeSeries): class OptogeneticSeries(TimeSeries):
""" """
An optogenetic stimulus. An optogenetic stimulus.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], float] = Field( data: NDArray[Shape["* num_times"], float] = Field(
..., description="""Applied power for optogenetic stimulus, in watts.""" ..., description="""Applied power for optogenetic stimulus, in watts."""
@ -116,7 +102,6 @@ class OptogeneticStimulusSite(NWBContainer):
A site of optogenetic stimulation. A site of optogenetic stimulation.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: str = Field(..., description="""Description of stimulation site.""") description: str = Field(..., description="""Description of stimulation site.""")
excitation_lambda: float = Field( excitation_lambda: float = Field(
@ -126,9 +111,3 @@ class OptogeneticStimulusSite(NWBContainer):
..., ...,
description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""", description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
OptogeneticSeries.model_rebuild()
OptogeneticStimulusSite.model_rebuild()

View file

@ -28,18 +28,18 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeries,
TimeSeriesSync,
NWBDataInterface,
TimeSeriesStartingTime,
NWBContainer, NWBContainer,
TimeSeriesSync,
TimeSeriesStartingTime,
NWBDataInterface,
TimeSeries,
) )
from ...hdmf_common.v1_1_3.hdmf_common_table import ( from ...hdmf_common.v1_1_3.hdmf_common_table import (
DynamicTableRegion, DynamicTableRegion,
VectorIndex,
DynamicTable, DynamicTable,
VectorData, VectorData,
VectorIndex,
) )
from .core_nwb_image import ImageSeries, ImageSeriesExternalFile from .core_nwb_image import ImageSeries, ImageSeriesExternalFile
@ -50,13 +50,6 @@ version = "2.2.5"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -76,18 +69,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class TwoPhotonSeries(ImageSeries): class TwoPhotonSeries(ImageSeries):
""" """
Image stack recorded over time from 2-photon microscope. Image stack recorded over time from 2-photon microscope.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""") pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""")
scan_line_rate: Optional[float] = Field( scan_line_rate: Optional[float] = Field(
@ -154,7 +140,6 @@ class RoiResponseSeries(TimeSeries):
ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Union[ data: Union[
NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times"], float],
@ -198,7 +183,6 @@ class RoiResponseSeriesRois(DynamicTableRegion):
DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries. DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["rois"] = Field("rois") name: Literal["rois"] = Field("rois")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -222,7 +206,6 @@ class DfOverF(NWBDataInterface):
dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes). dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field( children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -234,7 +217,6 @@ class Fluorescence(NWBDataInterface):
Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes). Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field( children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -246,7 +228,6 @@ class ImageSegmentation(NWBDataInterface):
Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them. Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[PlaneSegmentation] | PlaneSegmentation] = Field( children: Optional[List[PlaneSegmentation] | PlaneSegmentation] = Field(
default_factory=dict default_factory=dict
) )
@ -258,7 +239,6 @@ class PlaneSegmentation(DynamicTable):
Results from image segmentation of a specific imaging plane. Results from image segmentation of a specific imaging plane.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
image_mask: Optional[ image_mask: Optional[
Union[ Union[
@ -312,7 +292,6 @@ class PlaneSegmentationPixelMaskIndex(VectorIndex):
Index into pixel_mask. Index into pixel_mask.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["pixel_mask_index"] = Field("pixel_mask_index") name: Literal["pixel_mask_index"] = Field("pixel_mask_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -326,7 +305,6 @@ class PlaneSegmentationPixelMask(VectorData):
Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["pixel_mask"] = Field("pixel_mask") name: Literal["pixel_mask"] = Field("pixel_mask")
x: Optional[int] = Field(None, description="""Pixel x-coordinate.""") x: Optional[int] = Field(None, description="""Pixel x-coordinate.""")
y: Optional[int] = Field(None, description="""Pixel y-coordinate.""") y: Optional[int] = Field(None, description="""Pixel y-coordinate.""")
@ -349,7 +327,6 @@ class PlaneSegmentationVoxelMaskIndex(VectorIndex):
Index into voxel_mask. Index into voxel_mask.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["voxel_mask_index"] = Field("voxel_mask_index") name: Literal["voxel_mask_index"] = Field("voxel_mask_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -363,7 +340,6 @@ class PlaneSegmentationVoxelMask(VectorData):
Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["voxel_mask"] = Field("voxel_mask") name: Literal["voxel_mask"] = Field("voxel_mask")
x: Optional[int] = Field(None, description="""Voxel x-coordinate.""") x: Optional[int] = Field(None, description="""Voxel x-coordinate.""")
y: Optional[int] = Field(None, description="""Voxel y-coordinate.""") y: Optional[int] = Field(None, description="""Voxel y-coordinate.""")
@ -387,7 +363,6 @@ class ImagingPlane(NWBContainer):
An imaging plane and its metadata. An imaging plane and its metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[OpticalChannel] | OpticalChannel] = Field( children: Optional[List[OpticalChannel] | OpticalChannel] = Field(
default_factory=dict default_factory=dict
) )
@ -399,7 +374,6 @@ class OpticalChannel(NWBContainer):
An optical channel used to record from an imaging plane. An optical channel used to record from an imaging plane.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: str = Field( description: str = Field(
..., description="""Description or other notes about the channel.""" ..., description="""Description or other notes about the channel."""
@ -414,7 +388,6 @@ class MotionCorrection(NWBDataInterface):
An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions). An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[CorrectedImageStack] | CorrectedImageStack] = Field( children: Optional[List[CorrectedImageStack] | CorrectedImageStack] = Field(
default_factory=dict default_factory=dict
) )
@ -426,7 +399,6 @@ class CorrectedImageStack(NWBDataInterface):
Reuslts from motion correction of an image stack. Reuslts from motion correction of an image stack.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
corrected: str = Field( corrected: str = Field(
..., ...,
@ -436,22 +408,3 @@ class CorrectedImageStack(NWBDataInterface):
..., ...,
description="""Stores the x,y delta necessary to align each frame to the common coordinates, for example, to align each frame to a reference image.""", description="""Stores the x,y delta necessary to align each frame to the common coordinates, for example, to align each frame to a reference image.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
TwoPhotonSeries.model_rebuild()
RoiResponseSeries.model_rebuild()
RoiResponseSeriesRois.model_rebuild()
DfOverF.model_rebuild()
Fluorescence.model_rebuild()
ImageSegmentation.model_rebuild()
PlaneSegmentation.model_rebuild()
PlaneSegmentationPixelMaskIndex.model_rebuild()
PlaneSegmentationPixelMask.model_rebuild()
PlaneSegmentationVoxelMaskIndex.model_rebuild()
PlaneSegmentationVoxelMask.model_rebuild()
ImagingPlane.model_rebuild()
OpticalChannel.model_rebuild()
MotionCorrection.model_rebuild()
CorrectedImageStack.model_rebuild()

View file

@ -35,13 +35,6 @@ version = "2.2.5"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class ImagingRetinotopy(NWBDataInterface): class ImagingRetinotopy(NWBDataInterface):
""" """
Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. This group does not store the raw responses imaged during retinotopic mapping or the stimuli presented, but rather the resulting phase and power maps after applying a Fourier transform on the averaged responses. Note: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x). Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. This group does not store the raw responses imaged during retinotopic mapping or the stimuli presented, but rather the resulting phase and power maps after applying a Fourier transform on the averaged responses. Note: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("ImagingRetinotopy") name: str = Field("ImagingRetinotopy")
axis_1_phase_map: str = Field( axis_1_phase_map: str = Field(
..., description="""Phase response to stimulus on the first measured axis.""" ..., description="""Phase response to stimulus on the first measured axis."""
@ -111,7 +97,6 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel):
Phase response to stimulus on the first measured axis. Phase response to stimulus on the first measured axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_1_phase_map"] = Field("axis_1_phase_map") name: Literal["axis_1_phase_map"] = Field("axis_1_phase_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -131,7 +116,6 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel):
Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_1_power_map"] = Field("axis_1_power_map") name: Literal["axis_1_power_map"] = Field("axis_1_power_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -151,7 +135,6 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel):
Phase response to stimulus on the second measured axis. Phase response to stimulus on the second measured axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_2_phase_map"] = Field("axis_2_phase_map") name: Literal["axis_2_phase_map"] = Field("axis_2_phase_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -171,7 +154,6 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel):
Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_2_power_map"] = Field("axis_2_power_map") name: Literal["axis_2_power_map"] = Field("axis_2_power_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -191,7 +173,6 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel):
Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns]. Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["focal_depth_image"] = Field("focal_depth_image") name: Literal["focal_depth_image"] = Field("focal_depth_image")
bits_per_pixel: Optional[int] = Field( bits_per_pixel: Optional[int] = Field(
None, None,
@ -218,7 +199,6 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel):
Sine of the angle between the direction of the gradient in axis_1 and axis_2. Sine of the angle between the direction of the gradient in axis_1 and axis_2.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["sign_map"] = Field("sign_map") name: Literal["sign_map"] = Field("sign_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -235,7 +215,6 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel):
Gray-scale anatomical image of cortical surface. Array structure: [rows][columns] Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["vasculature_image"] = Field("vasculature_image") name: Literal["vasculature_image"] = Field("vasculature_image")
bits_per_pixel: Optional[int] = Field( bits_per_pixel: Optional[int] = Field(
None, None,
@ -252,15 +231,3 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel):
None, description="""Format of image. Right now only 'raw' is supported.""" None, description="""Format of image. Right now only 'raw' is supported."""
) )
array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field(None) array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ImagingRetinotopy.model_rebuild()
ImagingRetinotopyAxis1PhaseMap.model_rebuild()
ImagingRetinotopyAxis1PowerMap.model_rebuild()
ImagingRetinotopyAxis2PhaseMap.model_rebuild()
ImagingRetinotopyAxis2PowerMap.model_rebuild()
ImagingRetinotopyFocalDepthImage.model_rebuild()
ImagingRetinotopySignMap.model_rebuild()
ImagingRetinotopyVasculatureImage.model_rebuild()

View file

@ -196,13 +196,6 @@ version = "2.2.5"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -220,13 +213,3 @@ class ConfiguredBaseModel(BaseModel):
self.array[i] = value self.array[i] = value
else: else:
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model

View file

@ -27,7 +27,7 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from ...hdmf_common.v1_5_0.hdmf_common_base import Container, Data from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container
from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable
@ -37,13 +37,6 @@ version = "2.3.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -63,18 +56,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class NWBData(Data): class NWBData(Data):
""" """
An abstract data type for a dataset. An abstract data type for a dataset.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -83,7 +69,6 @@ class Image(NWBData):
An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)). An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -105,7 +90,6 @@ class NWBContainer(Container):
An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers. An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -114,7 +98,6 @@ class NWBDataInterface(NWBContainer):
An abstract data type for a generic container storing collections of data, as opposed to metadata. An abstract data type for a generic container storing collections of data, as opposed to metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -123,7 +106,6 @@ class TimeSeries(NWBDataInterface):
General purpose time series. General purpose time series.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of the time series.""" None, description="""Description of the time series."""
@ -163,7 +145,6 @@ class TimeSeriesData(ConfiguredBaseModel):
Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file. Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
conversion: Optional[float] = Field( conversion: Optional[float] = Field(
None, None,
@ -196,7 +177,6 @@ class TimeSeriesStartingTime(ConfiguredBaseModel):
Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute. Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["starting_time"] = Field("starting_time") name: Literal["starting_time"] = Field("starting_time")
rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""") rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""")
unit: Optional[str] = Field( unit: Optional[str] = Field(
@ -211,7 +191,6 @@ class TimeSeriesSync(ConfiguredBaseModel):
Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes. Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["sync"] = Field("sync") name: Literal["sync"] = Field("sync")
@ -220,7 +199,6 @@ class ProcessingModule(NWBContainer):
A collection of processed data. A collection of processed data.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[ children: Optional[
List[Union[BaseModel, DynamicTable, NWBDataInterface]] List[Union[BaseModel, DynamicTable, NWBDataInterface]]
| Union[BaseModel, DynamicTable, NWBDataInterface] | Union[BaseModel, DynamicTable, NWBDataInterface]
@ -233,7 +211,6 @@ class Images(NWBDataInterface):
A collection of images. A collection of images.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("Images") name: str = Field("Images")
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of this collection of images.""" None, description="""Description of this collection of images."""
@ -241,17 +218,3 @@ class Images(NWBDataInterface):
image: List[str] | str = Field( image: List[str] | str = Field(
default_factory=list, description="""Images stored in this collection.""" default_factory=list, description="""Images stored in this collection."""
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
NWBData.model_rebuild()
Image.model_rebuild()
NWBContainer.model_rebuild()
NWBDataInterface.model_rebuild()
TimeSeries.model_rebuild()
TimeSeriesData.model_rebuild()
TimeSeriesStartingTime.model_rebuild()
TimeSeriesSync.model_rebuild()
ProcessingModule.model_rebuild()
Images.model_rebuild()

View file

@ -28,9 +28,9 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesStartingTime, TimeSeriesStartingTime,
NWBDataInterface,
TimeSeriesSync, TimeSeriesSync,
) )
@ -42,13 +42,6 @@ version = "2.3.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -68,18 +61,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class SpatialSeries(TimeSeries): class SpatialSeries(TimeSeries):
""" """
Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values. Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field( data: str = Field(
..., ...,
@ -123,7 +109,6 @@ class SpatialSeriesData(ConfiguredBaseModel):
1-D or 2-D array storing position or direction relative to some reference frame. 1-D or 2-D array storing position or direction relative to some reference frame.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -142,7 +127,6 @@ class BehavioralEpochs(NWBDataInterface):
TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data. TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[IntervalSeries] | IntervalSeries] = Field( children: Optional[List[IntervalSeries] | IntervalSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -154,7 +138,6 @@ class BehavioralEvents(NWBDataInterface):
TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details. TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict) children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -164,7 +147,6 @@ class BehavioralTimeSeries(NWBDataInterface):
TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details. TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict) children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -174,7 +156,6 @@ class PupilTracking(NWBDataInterface):
Eye-tracking data, representing pupil size. Eye-tracking data, representing pupil size.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict) children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -184,7 +165,6 @@ class EyeTracking(NWBDataInterface):
Eye-tracking data, representing direction of gaze. Eye-tracking data, representing direction of gaze.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpatialSeries] | SpatialSeries] = Field( children: Optional[List[SpatialSeries] | SpatialSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -196,7 +176,6 @@ class CompassDirection(NWBDataInterface):
With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees. With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpatialSeries] | SpatialSeries] = Field( children: Optional[List[SpatialSeries] | SpatialSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -208,21 +187,7 @@ class Position(NWBDataInterface):
Position data, whether along the x, x/y or x/y/z axis. Position data, whether along the x, x/y or x/y/z axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpatialSeries] | SpatialSeries] = Field( children: Optional[List[SpatialSeries] | SpatialSeries] = Field(
default_factory=dict default_factory=dict
) )
name: str = Field(...) name: str = Field(...)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
SpatialSeries.model_rebuild()
SpatialSeriesData.model_rebuild()
BehavioralEpochs.model_rebuild()
BehavioralEvents.model_rebuild()
BehavioralTimeSeries.model_rebuild()
PupilTracking.model_rebuild()
EyeTracking.model_rebuild()
CompassDirection.model_rebuild()
Position.model_rebuild()

View file

@ -35,13 +35,6 @@ version = "2.3.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class Device(NWBContainer): class Device(NWBContainer):
""" """
Metadata about a data acquisition device, e.g., recording system, electrode, microscope. Metadata about a data acquisition device, e.g., recording system, electrode, microscope.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, None,
@ -81,8 +67,3 @@ class Device(NWBContainer):
manufacturer: Optional[str] = Field( manufacturer: Optional[str] = Field(
None, description="""The name of the manufacturer of the device.""" None, description="""The name of the manufacturer of the device."""
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
Device.model_rebuild()

View file

@ -27,29 +27,22 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTableRegion, DynamicTable
from .core_nwb_base import ( from .core_nwb_base import (
NWBContainer,
TimeSeriesStartingTime,
NWBDataInterface, NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesStartingTime,
NWBContainer,
TimeSeriesSync, TimeSeriesSync,
) )
from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTableRegion, DynamicTable
metamodel_version = "None" metamodel_version = "None"
version = "2.3.0" version = "2.3.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -69,18 +62,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class ElectricalSeries(TimeSeries): class ElectricalSeries(TimeSeries):
""" """
A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels. A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
filtering: Optional[str] = Field( filtering: Optional[str] = Field(
None, None,
@ -133,7 +119,6 @@ class ElectricalSeriesElectrodes(DynamicTableRegion):
DynamicTableRegion pointer to the electrodes that this time series was generated from. DynamicTableRegion pointer to the electrodes that this time series was generated from.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -157,7 +142,6 @@ class SpikeEventSeries(ElectricalSeries):
Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode). Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Union[ data: Union[
NDArray[Shape["* num_events, * num_channels, * num_samples"], float], NDArray[Shape["* num_events, * num_channels, * num_samples"], float],
@ -209,7 +193,6 @@ class FeatureExtraction(NWBDataInterface):
Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("FeatureExtraction") name: str = Field("FeatureExtraction")
description: NDArray[Shape["* num_features"], str] = Field( description: NDArray[Shape["* num_features"], str] = Field(
..., ...,
@ -236,7 +219,6 @@ class FeatureExtractionElectrodes(DynamicTableRegion):
DynamicTableRegion pointer to the electrodes that this time series was generated from. DynamicTableRegion pointer to the electrodes that this time series was generated from.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -260,7 +242,6 @@ class EventDetection(NWBDataInterface):
Detected spike events from voltage trace(s). Detected spike events from voltage trace(s).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("EventDetection") name: str = Field("EventDetection")
detection_method: str = Field( detection_method: str = Field(
..., ...,
@ -280,7 +261,6 @@ class EventWaveform(NWBDataInterface):
Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition. Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpikeEventSeries] | SpikeEventSeries] = Field( children: Optional[List[SpikeEventSeries] | SpikeEventSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -292,7 +272,6 @@ class FilteredEphys(NWBDataInterface):
Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries 'filtering' attribute. Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries 'filtering' attribute.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field( children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -304,7 +283,6 @@ class LFP(NWBDataInterface):
LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries 'filtering' attribute. LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries 'filtering' attribute.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field( children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -316,7 +294,6 @@ class ElectrodeGroup(NWBContainer):
A physical grouping of electrodes, e.g. a shank of an array. A physical grouping of electrodes, e.g. a shank of an array.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of this electrode group.""" None, description="""Description of this electrode group."""
@ -335,7 +312,6 @@ class ElectrodeGroupPosition(ConfiguredBaseModel):
stereotaxic or common framework coordinates stereotaxic or common framework coordinates
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["position"] = Field("position") name: Literal["position"] = Field("position")
x: Optional[float] = Field(None, description="""x coordinate""") x: Optional[float] = Field(None, description="""x coordinate""")
y: Optional[float] = Field(None, description="""y coordinate""") y: Optional[float] = Field(None, description="""y coordinate""")
@ -347,7 +323,6 @@ class ClusterWaveforms(NWBDataInterface):
DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one. DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("ClusterWaveforms") name: str = Field("ClusterWaveforms")
waveform_filtering: str = Field( waveform_filtering: str = Field(
..., description="""Filtering applied to data before generating mean/sd""" ..., description="""Filtering applied to data before generating mean/sd"""
@ -367,7 +342,6 @@ class Clustering(NWBDataInterface):
DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("Clustering") name: str = Field("Clustering")
description: str = Field( description: str = Field(
..., ...,
@ -384,20 +358,3 @@ class Clustering(NWBDataInterface):
..., ...,
description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""", description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ElectricalSeries.model_rebuild()
ElectricalSeriesElectrodes.model_rebuild()
SpikeEventSeries.model_rebuild()
FeatureExtraction.model_rebuild()
FeatureExtractionElectrodes.model_rebuild()
EventDetection.model_rebuild()
EventWaveform.model_rebuild()
FilteredEphys.model_rebuild()
LFP.model_rebuild()
ElectrodeGroup.model_rebuild()
ElectrodeGroupPosition.model_rebuild()
ClusterWaveforms.model_rebuild()
Clustering.model_rebuild()

View file

@ -27,27 +27,20 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import TimeSeries
from ...hdmf_common.v1_5_0.hdmf_common_table import ( from ...hdmf_common.v1_5_0.hdmf_common_table import (
DynamicTable,
VectorIndex, VectorIndex,
DynamicTable,
VectorData, VectorData,
) )
from .core_nwb_base import TimeSeries
metamodel_version = "None" metamodel_version = "None"
version = "2.3.0" version = "2.3.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -67,18 +60,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class TimeIntervals(DynamicTable): class TimeIntervals(DynamicTable):
""" """
A container for aggregating epoch data and the TimeSeries that each epoch applies to. A container for aggregating epoch data and the TimeSeries that each epoch applies to.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
start_time: Optional[List[float] | float] = Field( start_time: Optional[List[float] | float] = Field(
default_factory=list, description="""Start time of epoch, in seconds.""" default_factory=list, description="""Start time of epoch, in seconds."""
@ -119,7 +105,6 @@ class TimeIntervalsTagsIndex(VectorIndex):
Index for tags. Index for tags.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["tags_index"] = Field("tags_index") name: Literal["tags_index"] = Field("tags_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -143,7 +128,6 @@ class TimeIntervalsTimeseries(VectorData):
An index into a TimeSeries object. An index into a TimeSeries object.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["timeseries"] = Field("timeseries") name: Literal["timeseries"] = Field("timeseries")
idx_start: Optional[int] = Field( idx_start: Optional[int] = Field(
None, None,
@ -174,7 +158,6 @@ class TimeIntervalsTimeseriesIndex(VectorIndex):
Index for timeseries. Index for timeseries.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["timeseries_index"] = Field("timeseries_index") name: Literal["timeseries_index"] = Field("timeseries_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -191,11 +174,3 @@ class TimeIntervalsTimeseriesIndex(VectorIndex):
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any],
] ]
] = Field(None) ] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
TimeIntervals.model_rebuild()
TimeIntervalsTagsIndex.model_rebuild()
TimeIntervalsTimeseries.model_rebuild()
TimeIntervalsTimeseriesIndex.model_rebuild()

View file

@ -27,29 +27,29 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_ophys import ImagingPlane from .core_nwb_icephys import SweepTable, IntracellularElectrode
from .core_nwb_base import (
TimeSeries,
NWBDataInterface,
ProcessingModule,
NWBContainer,
NWBData,
)
from .core_nwb_epoch import TimeIntervals from .core_nwb_epoch import TimeIntervals
from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, VectorData from .core_nwb_ecephys import ElectrodeGroup
from .core_nwb_icephys import IntracellularElectrode, SweepTable from .core_nwb_base import (
NWBContainer,
ProcessingModule,
NWBData,
NWBDataInterface,
TimeSeries,
)
from .core_nwb_ogen import OptogeneticStimulusSite from .core_nwb_device import Device
from .core_nwb_misc import Units from .core_nwb_misc import Units
from .core_nwb_ecephys import ElectrodeGroup from .core_nwb_ogen import OptogeneticStimulusSite
from .core_nwb_device import Device from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, VectorData
from .core_nwb_ophys import ImagingPlane
metamodel_version = "None" metamodel_version = "None"
@ -57,13 +57,6 @@ version = "2.3.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -83,18 +76,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class ScratchData(NWBData): class ScratchData(NWBData):
""" """
Any one-off datasets Any one-off datasets
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
notes: Optional[str] = Field( notes: Optional[str] = Field(
None, description="""Any notes the user has about the dataset being stored""" None, description="""Any notes the user has about the dataset being stored"""
@ -106,7 +92,6 @@ class NWBFile(NWBContainer):
An NWB:N file storing cellular-based neurophysiology data from a single experimental session. An NWB:N file storing cellular-based neurophysiology data from a single experimental session.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: Literal["root"] = Field("root") name: Literal["root"] = Field("root")
nwb_version: Optional[str] = Field( nwb_version: Optional[str] = Field(
None, None,
@ -177,7 +162,6 @@ class NWBFileStimulus(ConfiguredBaseModel):
Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file. Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["stimulus"] = Field("stimulus") name: Literal["stimulus"] = Field("stimulus")
presentation: Optional[List[TimeSeries] | TimeSeries] = Field( presentation: Optional[List[TimeSeries] | TimeSeries] = Field(
default_factory=dict, description="""Stimuli presented during the experiment.""" default_factory=dict, description="""Stimuli presented during the experiment."""
@ -193,7 +177,6 @@ class NWBFileGeneral(ConfiguredBaseModel):
Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them. Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["general"] = Field("general") name: Literal["general"] = Field("general")
data_collection: Optional[str] = Field( data_collection: Optional[str] = Field(
None, description="""Notes about data collection and analysis.""" None, description="""Notes about data collection and analysis."""
@ -283,7 +266,6 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel):
Script file or link to public source code used to create this NWB file. Script file or link to public source code used to create this NWB file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["source_script"] = Field("source_script") name: Literal["source_script"] = Field("source_script")
file_name: Optional[str] = Field(None, description="""Name of script file.""") file_name: Optional[str] = Field(None, description="""Name of script file.""")
value: str = Field(...) value: str = Field(...)
@ -294,7 +276,6 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel):
Metadata related to extracellular electrophysiology. Metadata related to extracellular electrophysiology.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["extracellular_ephys"] = Field("extracellular_ephys") name: Literal["extracellular_ephys"] = Field("extracellular_ephys")
electrode_group: Optional[List[str] | str] = Field( electrode_group: Optional[List[str] | str] = Field(
default_factory=list, description="""Physical group of electrodes.""" default_factory=list, description="""Physical group of electrodes."""
@ -310,7 +291,6 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
A table of all electrodes (i.e. channels) used for recording. A table of all electrodes (i.e. channels) used for recording.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
x: Optional[List[float] | float] = Field( x: Optional[List[float] | float] = Field(
default_factory=list, default_factory=list,
@ -378,7 +358,6 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel):
Metadata related to intracellular electrophysiology. Metadata related to intracellular electrophysiology.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["intracellular_ephys"] = Field("intracellular_ephys") name: Literal["intracellular_ephys"] = Field("intracellular_ephys")
filtering: Optional[str] = Field( filtering: Optional[str] = Field(
None, None,
@ -398,7 +377,6 @@ class LabMetaData(NWBContainer):
Lab-specific meta-data. Lab-specific meta-data.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -407,7 +385,6 @@ class Subject(NWBContainer):
Information about the animal or person from which the data was measured. Information about the animal or person from which the data was measured.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
age: Optional[str] = Field( age: Optional[str] = Field(
None, None,
@ -435,17 +412,3 @@ class Subject(NWBContainer):
None, None,
description="""Weight at time of experiment, at time of surgery and at other important times.""", description="""Weight at time of experiment, at time of surgery and at other important times.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ScratchData.model_rebuild()
NWBFile.model_rebuild()
NWBFileStimulus.model_rebuild()
NWBFileGeneral.model_rebuild()
NWBFileGeneralSourceScript.model_rebuild()
NWBFileGeneralExtracellularEphys.model_rebuild()
NWBFileGeneralExtracellularEphysElectrodes.model_rebuild()
NWBFileGeneralIntracellularEphys.model_rebuild()
LabMetaData.model_rebuild()
Subject.model_rebuild()

View file

@ -28,16 +28,16 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeries, NWBContainer,
TimeSeriesSync, TimeSeriesSync,
TimeSeriesStartingTime, TimeSeriesStartingTime,
NWBContainer, TimeSeries,
) )
from ...hdmf_common.v1_5_0.hdmf_common_table import ( from ...hdmf_common.v1_5_0.hdmf_common_table import (
VectorIndex,
DynamicTable, DynamicTable,
VectorData, VectorData,
VectorIndex,
) )
@ -46,13 +46,6 @@ version = "2.3.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -72,18 +65,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class PatchClampSeries(TimeSeries): class PatchClampSeries(TimeSeries):
""" """
An abstract base class for patch-clamp data - stimulus or response, current or voltage. An abstract base class for patch-clamp data - stimulus or response, current or voltage.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
None, description="""Protocol/stimulus name for this patch-clamp dataset.""" None, description="""Protocol/stimulus name for this patch-clamp dataset."""
@ -131,7 +117,6 @@ class PatchClampSeriesData(ConfiguredBaseModel):
Recorded voltage or current. Recorded voltage or current.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -145,7 +130,6 @@ class CurrentClampSeries(PatchClampSeries):
Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected. Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Recorded voltage.""") data: str = Field(..., description="""Recorded voltage.""")
bias_current: Optional[float] = Field( bias_current: Optional[float] = Field(
@ -202,7 +186,6 @@ class CurrentClampSeriesData(ConfiguredBaseModel):
Recorded voltage. Recorded voltage.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -216,7 +199,6 @@ class IZeroClampSeries(CurrentClampSeries):
Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell. Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
None, None,
@ -274,7 +256,6 @@ class CurrentClampStimulusSeries(PatchClampSeries):
Stimulus current applied during current clamp recording. Stimulus current applied during current clamp recording.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Stimulus current applied.""") data: str = Field(..., description="""Stimulus current applied.""")
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
@ -322,7 +303,6 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel):
Stimulus current applied. Stimulus current applied.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -336,7 +316,6 @@ class VoltageClampSeries(PatchClampSeries):
Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected. Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Recorded current.""") data: str = Field(..., description="""Recorded current.""")
capacitance_fast: Optional[str] = Field( capacitance_fast: Optional[str] = Field(
@ -405,7 +384,6 @@ class VoltageClampSeriesData(ConfiguredBaseModel):
Recorded current. Recorded current.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -419,7 +397,6 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel):
Fast capacitance, in farads. Fast capacitance, in farads.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["capacitance_fast"] = Field("capacitance_fast") name: Literal["capacitance_fast"] = Field("capacitance_fast")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -433,7 +410,6 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel):
Slow capacitance, in farads. Slow capacitance, in farads.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["capacitance_slow"] = Field("capacitance_slow") name: Literal["capacitance_slow"] = Field("capacitance_slow")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -447,7 +423,6 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel):
Resistance compensation bandwidth, in hertz. Resistance compensation bandwidth, in hertz.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["resistance_comp_bandwidth"] = Field("resistance_comp_bandwidth") name: Literal["resistance_comp_bandwidth"] = Field("resistance_comp_bandwidth")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -461,7 +436,6 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel):
Resistance compensation correction, in percent. Resistance compensation correction, in percent.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["resistance_comp_correction"] = Field("resistance_comp_correction") name: Literal["resistance_comp_correction"] = Field("resistance_comp_correction")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -475,7 +449,6 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel):
Resistance compensation prediction, in percent. Resistance compensation prediction, in percent.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["resistance_comp_prediction"] = Field("resistance_comp_prediction") name: Literal["resistance_comp_prediction"] = Field("resistance_comp_prediction")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -489,7 +462,6 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel):
Whole cell capacitance compensation, in farads. Whole cell capacitance compensation, in farads.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["whole_cell_capacitance_comp"] = Field("whole_cell_capacitance_comp") name: Literal["whole_cell_capacitance_comp"] = Field("whole_cell_capacitance_comp")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -503,7 +475,6 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel):
Whole cell series resistance compensation, in ohms. Whole cell series resistance compensation, in ohms.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["whole_cell_series_resistance_comp"] = Field( name: Literal["whole_cell_series_resistance_comp"] = Field(
"whole_cell_series_resistance_comp" "whole_cell_series_resistance_comp"
) )
@ -519,7 +490,6 @@ class VoltageClampStimulusSeries(PatchClampSeries):
Stimulus voltage applied during a voltage clamp recording. Stimulus voltage applied during a voltage clamp recording.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Stimulus voltage applied.""") data: str = Field(..., description="""Stimulus voltage applied.""")
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
@ -567,7 +537,6 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel):
Stimulus voltage applied. Stimulus voltage applied.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -581,7 +550,6 @@ class IntracellularElectrode(NWBContainer):
An intracellular electrode and its metadata. An intracellular electrode and its metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: str = Field( description: str = Field(
..., ...,
@ -613,7 +581,6 @@ class SweepTable(DynamicTable):
The table which groups different PatchClampSeries together. The table which groups different PatchClampSeries together.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
sweep_number: Optional[List[int] | int] = Field( sweep_number: Optional[List[int] | int] = Field(
default_factory=list, default_factory=list,
@ -646,7 +613,6 @@ class SweepTableSeriesIndex(VectorIndex):
Index for series. Index for series.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["series_index"] = Field("series_index") name: Literal["series_index"] = Field("series_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -663,28 +629,3 @@ class SweepTableSeriesIndex(VectorIndex):
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any],
] ]
] = Field(None) ] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
PatchClampSeries.model_rebuild()
PatchClampSeriesData.model_rebuild()
CurrentClampSeries.model_rebuild()
CurrentClampSeriesData.model_rebuild()
IZeroClampSeries.model_rebuild()
CurrentClampStimulusSeries.model_rebuild()
CurrentClampStimulusSeriesData.model_rebuild()
VoltageClampSeries.model_rebuild()
VoltageClampSeriesData.model_rebuild()
VoltageClampSeriesCapacitanceFast.model_rebuild()
VoltageClampSeriesCapacitanceSlow.model_rebuild()
VoltageClampSeriesResistanceCompBandwidth.model_rebuild()
VoltageClampSeriesResistanceCompCorrection.model_rebuild()
VoltageClampSeriesResistanceCompPrediction.model_rebuild()
VoltageClampSeriesWholeCellCapacitanceComp.model_rebuild()
VoltageClampSeriesWholeCellSeriesResistanceComp.model_rebuild()
VoltageClampStimulusSeries.model_rebuild()
VoltageClampStimulusSeriesData.model_rebuild()
IntracellularElectrode.model_rebuild()
SweepTable.model_rebuild()
SweepTableSeriesIndex.model_rebuild()

View file

@ -27,7 +27,7 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync from .core_nwb_base import Image, TimeSeriesStartingTime, TimeSeries, TimeSeriesSync
metamodel_version = "None" metamodel_version = "None"
@ -35,13 +35,6 @@ version = "2.3.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class GrayscaleImage(Image): class GrayscaleImage(Image):
""" """
A grayscale image. A grayscale image.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -94,7 +80,6 @@ class RGBImage(Image):
A color image. A color image.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -116,7 +101,6 @@ class RGBAImage(Image):
A color image with transparency. A color image with transparency.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -138,7 +122,6 @@ class ImageSeries(TimeSeries):
General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z]. General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z].
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Optional[ data: Optional[
Union[ Union[
@ -191,7 +174,6 @@ class ImageSeriesExternalFile(ConfiguredBaseModel):
Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file. Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["external_file"] = Field("external_file") name: Literal["external_file"] = Field("external_file")
starting_frame: Optional[int] = Field( starting_frame: Optional[int] = Field(
None, None,
@ -205,7 +187,6 @@ class ImageMaskSeries(ImageSeries):
An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed. An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Optional[ data: Optional[
Union[ Union[
@ -258,7 +239,6 @@ class OpticalSeries(ImageSeries):
Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important. Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
distance: Optional[float] = Field( distance: Optional[float] = Field(
None, description="""Distance from camera/monitor to target/eye.""" None, description="""Distance from camera/monitor to target/eye."""
@ -327,7 +307,6 @@ class IndexSeries(TimeSeries):
Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed. Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], int] = Field( data: NDArray[Shape["* num_times"], int] = Field(
..., description="""Index of the frame in the referenced ImageSeries.""" ..., description="""Index of the frame in the referenced ImageSeries."""
@ -359,15 +338,3 @@ class IndexSeries(TimeSeries):
None, None,
description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""", description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
GrayscaleImage.model_rebuild()
RGBImage.model_rebuild()
RGBAImage.model_rebuild()
ImageSeries.model_rebuild()
ImageSeriesExternalFile.model_rebuild()
ImageMaskSeries.model_rebuild()
OpticalSeries.model_rebuild()
IndexSeries.model_rebuild()

View file

@ -32,13 +32,6 @@ version = "None"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -56,13 +49,3 @@ class ConfiguredBaseModel(BaseModel):
self.array[i] = value self.array[i] = value
else: else:
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model

View file

@ -27,16 +27,16 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import TimeSeries, TimeSeriesSync, TimeSeriesStartingTime from .core_nwb_ecephys import ElectrodeGroup
from ...hdmf_common.v1_5_0.hdmf_common_table import ( from ...hdmf_common.v1_5_0.hdmf_common_table import (
DynamicTableRegion, DynamicTableRegion,
VectorIndex,
DynamicTable, DynamicTable,
VectorData, VectorData,
VectorIndex,
) )
from .core_nwb_ecephys import ElectrodeGroup from .core_nwb_base import TimeSeriesSync, TimeSeriesStartingTime, TimeSeries
metamodel_version = "None" metamodel_version = "None"
@ -44,13 +44,6 @@ version = "2.3.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -70,18 +63,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class AbstractFeatureSeries(TimeSeries): class AbstractFeatureSeries(TimeSeries):
""" """
Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical. Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Values of each feature at each time.""") data: str = Field(..., description="""Values of each feature at each time.""")
feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field( feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field(
@ -125,7 +111,6 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel):
Values of each feature at each time. Values of each feature at each time.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -144,7 +129,6 @@ class AnnotationSeries(TimeSeries):
Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way. Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], str] = Field( data: NDArray[Shape["* num_times"], str] = Field(
..., description="""Annotations made during an experiment.""" ..., description="""Annotations made during an experiment."""
@ -183,7 +167,6 @@ class IntervalSeries(TimeSeries):
Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way. Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], int] = Field( data: NDArray[Shape["* num_times"], int] = Field(
..., description="""Use values >0 if interval started, <0 if interval ended.""" ..., description="""Use values >0 if interval started, <0 if interval ended."""
@ -222,7 +205,6 @@ class DecompositionSeries(TimeSeries):
Spectral analysis of a time series, e.g. of an LFP or a speech signal. Spectral analysis of a time series, e.g. of an LFP or a speech signal.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Data decomposed into frequency bands.""") data: str = Field(..., description="""Data decomposed into frequency bands.""")
metric: str = Field( metric: str = Field(
@ -270,7 +252,6 @@ class DecompositionSeriesData(ConfiguredBaseModel):
Data decomposed into frequency bands. Data decomposed into frequency bands.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -286,7 +267,6 @@ class DecompositionSeriesSourceChannels(DynamicTableRegion):
DynamicTableRegion pointer to the channels that this decomposition series was generated from. DynamicTableRegion pointer to the channels that this decomposition series was generated from.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["source_channels"] = Field("source_channels") name: Literal["source_channels"] = Field("source_channels")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -310,7 +290,6 @@ class DecompositionSeriesBands(DynamicTable):
Table for describing the bands that this series was generated from. There should be one row in this table for each band. Table for describing the bands that this series was generated from. There should be one row in this table for each band.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["bands"] = Field("bands") name: Literal["bands"] = Field("bands")
band_name: Optional[List[str] | str] = Field( band_name: Optional[List[str] | str] = Field(
default_factory=list, description="""Name of the band, e.g. theta.""" default_factory=list, description="""Name of the band, e.g. theta."""
@ -347,7 +326,6 @@ class Units(DynamicTable):
Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times. Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("Units") name: str = Field("Units")
spike_times_index: Optional[str] = Field( spike_times_index: Optional[str] = Field(
None, description="""Index into the spike_times dataset.""" None, description="""Index into the spike_times dataset."""
@ -422,7 +400,6 @@ class UnitsSpikeTimesIndex(VectorIndex):
Index into the spike_times dataset. Index into the spike_times dataset.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["spike_times_index"] = Field("spike_times_index") name: Literal["spike_times_index"] = Field("spike_times_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -446,7 +423,6 @@ class UnitsSpikeTimes(VectorData):
Spike times for each unit. Spike times for each unit.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["spike_times"] = Field("spike_times") name: Literal["spike_times"] = Field("spike_times")
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, None,
@ -470,7 +446,6 @@ class UnitsObsIntervalsIndex(VectorIndex):
Index into the obs_intervals dataset. Index into the obs_intervals dataset.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["obs_intervals_index"] = Field("obs_intervals_index") name: Literal["obs_intervals_index"] = Field("obs_intervals_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -494,7 +469,6 @@ class UnitsElectrodesIndex(VectorIndex):
Index into electrodes. Index into electrodes.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes_index"] = Field("electrodes_index") name: Literal["electrodes_index"] = Field("electrodes_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -518,7 +492,6 @@ class UnitsElectrodes(DynamicTableRegion):
Electrode that each spike unit came from, specified using a DynamicTableRegion. Electrode that each spike unit came from, specified using a DynamicTableRegion.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -542,7 +515,6 @@ class UnitsWaveformsIndex(VectorIndex):
Index into the waveforms dataset. One value for every spike event. See 'waveforms' for more detail. Index into the waveforms dataset. One value for every spike event. See 'waveforms' for more detail.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["waveforms_index"] = Field("waveforms_index") name: Literal["waveforms_index"] = Field("waveforms_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -566,7 +538,6 @@ class UnitsWaveformsIndexIndex(VectorIndex):
Index into the waveforms_index dataset. One value for every unit (row in the table). See 'waveforms' for more detail. Index into the waveforms_index dataset. One value for every unit (row in the table). See 'waveforms' for more detail.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["waveforms_index_index"] = Field("waveforms_index_index") name: Literal["waveforms_index_index"] = Field("waveforms_index_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -583,23 +554,3 @@ class UnitsWaveformsIndexIndex(VectorIndex):
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any],
] ]
] = Field(None) ] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
AbstractFeatureSeries.model_rebuild()
AbstractFeatureSeriesData.model_rebuild()
AnnotationSeries.model_rebuild()
IntervalSeries.model_rebuild()
DecompositionSeries.model_rebuild()
DecompositionSeriesData.model_rebuild()
DecompositionSeriesSourceChannels.model_rebuild()
DecompositionSeriesBands.model_rebuild()
Units.model_rebuild()
UnitsSpikeTimesIndex.model_rebuild()
UnitsSpikeTimes.model_rebuild()
UnitsObsIntervalsIndex.model_rebuild()
UnitsElectrodesIndex.model_rebuild()
UnitsElectrodes.model_rebuild()
UnitsWaveformsIndex.model_rebuild()
UnitsWaveformsIndexIndex.model_rebuild()

View file

@ -29,9 +29,9 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeriesSync, TimeSeriesSync,
TimeSeries,
NWBContainer, NWBContainer,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeries,
) )
@ -40,13 +40,6 @@ version = "2.3.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -66,18 +59,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class OptogeneticSeries(TimeSeries): class OptogeneticSeries(TimeSeries):
""" """
An optogenetic stimulus. An optogenetic stimulus.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], float] = Field( data: NDArray[Shape["* num_times"], float] = Field(
..., description="""Applied power for optogenetic stimulus, in watts.""" ..., description="""Applied power for optogenetic stimulus, in watts."""
@ -116,7 +102,6 @@ class OptogeneticStimulusSite(NWBContainer):
A site of optogenetic stimulation. A site of optogenetic stimulation.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: str = Field(..., description="""Description of stimulation site.""") description: str = Field(..., description="""Description of stimulation site.""")
excitation_lambda: float = Field( excitation_lambda: float = Field(
@ -126,9 +111,3 @@ class OptogeneticStimulusSite(NWBContainer):
..., ...,
description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""", description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
OptogeneticSeries.model_rebuild()
OptogeneticStimulusSite.model_rebuild()

View file

@ -28,18 +28,18 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeries,
TimeSeriesSync,
NWBDataInterface,
TimeSeriesStartingTime,
NWBContainer, NWBContainer,
TimeSeriesSync,
TimeSeriesStartingTime,
NWBDataInterface,
TimeSeries,
) )
from ...hdmf_common.v1_5_0.hdmf_common_table import ( from ...hdmf_common.v1_5_0.hdmf_common_table import (
DynamicTableRegion, DynamicTableRegion,
VectorIndex,
DynamicTable, DynamicTable,
VectorData, VectorData,
VectorIndex,
) )
from .core_nwb_image import ImageSeries, ImageSeriesExternalFile from .core_nwb_image import ImageSeries, ImageSeriesExternalFile
@ -50,13 +50,6 @@ version = "2.3.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -76,18 +69,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class TwoPhotonSeries(ImageSeries): class TwoPhotonSeries(ImageSeries):
""" """
Image stack recorded over time from 2-photon microscope. Image stack recorded over time from 2-photon microscope.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""") pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""")
scan_line_rate: Optional[float] = Field( scan_line_rate: Optional[float] = Field(
@ -154,7 +140,6 @@ class RoiResponseSeries(TimeSeries):
ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Union[ data: Union[
NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times"], float],
@ -198,7 +183,6 @@ class RoiResponseSeriesRois(DynamicTableRegion):
DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries. DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["rois"] = Field("rois") name: Literal["rois"] = Field("rois")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -222,7 +206,6 @@ class DfOverF(NWBDataInterface):
dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes). dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field( children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -234,7 +217,6 @@ class Fluorescence(NWBDataInterface):
Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes). Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field( children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -246,7 +228,6 @@ class ImageSegmentation(NWBDataInterface):
Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them. Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[PlaneSegmentation] | PlaneSegmentation] = Field( children: Optional[List[PlaneSegmentation] | PlaneSegmentation] = Field(
default_factory=dict default_factory=dict
) )
@ -258,7 +239,6 @@ class PlaneSegmentation(DynamicTable):
Results from image segmentation of a specific imaging plane. Results from image segmentation of a specific imaging plane.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
image_mask: Optional[ image_mask: Optional[
Union[ Union[
@ -309,7 +289,6 @@ class PlaneSegmentationPixelMaskIndex(VectorIndex):
Index into pixel_mask. Index into pixel_mask.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["pixel_mask_index"] = Field("pixel_mask_index") name: Literal["pixel_mask_index"] = Field("pixel_mask_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -333,7 +312,6 @@ class PlaneSegmentationPixelMask(VectorData):
Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["pixel_mask"] = Field("pixel_mask") name: Literal["pixel_mask"] = Field("pixel_mask")
x: Optional[int] = Field(None, description="""Pixel x-coordinate.""") x: Optional[int] = Field(None, description="""Pixel x-coordinate.""")
y: Optional[int] = Field(None, description="""Pixel y-coordinate.""") y: Optional[int] = Field(None, description="""Pixel y-coordinate.""")
@ -356,7 +334,6 @@ class PlaneSegmentationVoxelMaskIndex(VectorIndex):
Index into voxel_mask. Index into voxel_mask.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["voxel_mask_index"] = Field("voxel_mask_index") name: Literal["voxel_mask_index"] = Field("voxel_mask_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -380,7 +357,6 @@ class PlaneSegmentationVoxelMask(VectorData):
Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["voxel_mask"] = Field("voxel_mask") name: Literal["voxel_mask"] = Field("voxel_mask")
x: Optional[int] = Field(None, description="""Voxel x-coordinate.""") x: Optional[int] = Field(None, description="""Voxel x-coordinate.""")
y: Optional[int] = Field(None, description="""Voxel y-coordinate.""") y: Optional[int] = Field(None, description="""Voxel y-coordinate.""")
@ -404,7 +380,6 @@ class ImagingPlane(NWBContainer):
An imaging plane and its metadata. An imaging plane and its metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[OpticalChannel] | OpticalChannel] = Field( children: Optional[List[OpticalChannel] | OpticalChannel] = Field(
default_factory=dict default_factory=dict
) )
@ -416,7 +391,6 @@ class OpticalChannel(NWBContainer):
An optical channel used to record from an imaging plane. An optical channel used to record from an imaging plane.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: str = Field( description: str = Field(
..., description="""Description or other notes about the channel.""" ..., description="""Description or other notes about the channel."""
@ -431,7 +405,6 @@ class MotionCorrection(NWBDataInterface):
An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions). An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[CorrectedImageStack] | CorrectedImageStack] = Field( children: Optional[List[CorrectedImageStack] | CorrectedImageStack] = Field(
default_factory=dict default_factory=dict
) )
@ -443,7 +416,6 @@ class CorrectedImageStack(NWBDataInterface):
Reuslts from motion correction of an image stack. Reuslts from motion correction of an image stack.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
corrected: str = Field( corrected: str = Field(
..., ...,
@ -453,22 +425,3 @@ class CorrectedImageStack(NWBDataInterface):
..., ...,
description="""Stores the x,y delta necessary to align each frame to the common coordinates, for example, to align each frame to a reference image.""", description="""Stores the x,y delta necessary to align each frame to the common coordinates, for example, to align each frame to a reference image.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
TwoPhotonSeries.model_rebuild()
RoiResponseSeries.model_rebuild()
RoiResponseSeriesRois.model_rebuild()
DfOverF.model_rebuild()
Fluorescence.model_rebuild()
ImageSegmentation.model_rebuild()
PlaneSegmentation.model_rebuild()
PlaneSegmentationPixelMaskIndex.model_rebuild()
PlaneSegmentationPixelMask.model_rebuild()
PlaneSegmentationVoxelMaskIndex.model_rebuild()
PlaneSegmentationVoxelMask.model_rebuild()
ImagingPlane.model_rebuild()
OpticalChannel.model_rebuild()
MotionCorrection.model_rebuild()
CorrectedImageStack.model_rebuild()

View file

@ -35,13 +35,6 @@ version = "2.3.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class ImagingRetinotopy(NWBDataInterface): class ImagingRetinotopy(NWBDataInterface):
""" """
Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. This group does not store the raw responses imaged during retinotopic mapping or the stimuli presented, but rather the resulting phase and power maps after applying a Fourier transform on the averaged responses. Note: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x). Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. This group does not store the raw responses imaged during retinotopic mapping or the stimuli presented, but rather the resulting phase and power maps after applying a Fourier transform on the averaged responses. Note: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("ImagingRetinotopy") name: str = Field("ImagingRetinotopy")
axis_1_phase_map: str = Field( axis_1_phase_map: str = Field(
..., description="""Phase response to stimulus on the first measured axis.""" ..., description="""Phase response to stimulus on the first measured axis."""
@ -111,7 +97,6 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel):
Phase response to stimulus on the first measured axis. Phase response to stimulus on the first measured axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_1_phase_map"] = Field("axis_1_phase_map") name: Literal["axis_1_phase_map"] = Field("axis_1_phase_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -131,7 +116,6 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel):
Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_1_power_map"] = Field("axis_1_power_map") name: Literal["axis_1_power_map"] = Field("axis_1_power_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -151,7 +135,6 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel):
Phase response to stimulus on the second measured axis. Phase response to stimulus on the second measured axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_2_phase_map"] = Field("axis_2_phase_map") name: Literal["axis_2_phase_map"] = Field("axis_2_phase_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -171,7 +154,6 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel):
Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_2_power_map"] = Field("axis_2_power_map") name: Literal["axis_2_power_map"] = Field("axis_2_power_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -191,7 +173,6 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel):
Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns]. Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["focal_depth_image"] = Field("focal_depth_image") name: Literal["focal_depth_image"] = Field("focal_depth_image")
bits_per_pixel: Optional[int] = Field( bits_per_pixel: Optional[int] = Field(
None, None,
@ -218,7 +199,6 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel):
Sine of the angle between the direction of the gradient in axis_1 and axis_2. Sine of the angle between the direction of the gradient in axis_1 and axis_2.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["sign_map"] = Field("sign_map") name: Literal["sign_map"] = Field("sign_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -235,7 +215,6 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel):
Gray-scale anatomical image of cortical surface. Array structure: [rows][columns] Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["vasculature_image"] = Field("vasculature_image") name: Literal["vasculature_image"] = Field("vasculature_image")
bits_per_pixel: Optional[int] = Field( bits_per_pixel: Optional[int] = Field(
None, None,
@ -252,15 +231,3 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel):
None, description="""Format of image. Right now only 'raw' is supported.""" None, description="""Format of image. Right now only 'raw' is supported."""
) )
array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field(None) array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ImagingRetinotopy.model_rebuild()
ImagingRetinotopyAxis1PhaseMap.model_rebuild()
ImagingRetinotopyAxis1PowerMap.model_rebuild()
ImagingRetinotopyAxis2PhaseMap.model_rebuild()
ImagingRetinotopyAxis2PowerMap.model_rebuild()
ImagingRetinotopyFocalDepthImage.model_rebuild()
ImagingRetinotopySignMap.model_rebuild()
ImagingRetinotopyVasculatureImage.model_rebuild()

View file

@ -205,13 +205,6 @@ version = "2.3.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -229,13 +222,3 @@ class ConfiguredBaseModel(BaseModel):
self.array[i] = value self.array[i] = value
else: else:
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model

View file

@ -27,9 +27,9 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, VectorData from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container
from ...hdmf_common.v1_5_0.hdmf_common_base import Container, Data from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, VectorData
metamodel_version = "None" metamodel_version = "None"
@ -37,13 +37,6 @@ version = "2.4.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -63,18 +56,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class NWBData(Data): class NWBData(Data):
""" """
An abstract data type for a dataset. An abstract data type for a dataset.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -83,7 +69,6 @@ class TimeSeriesReferenceVectorData(VectorData):
Column storing references to a TimeSeries (rows). For each TimeSeries this VectorData column stores the start_index and count to indicate the range in time to be selected as well as an object reference to the TimeSeries. Column storing references to a TimeSeries (rows). For each TimeSeries this VectorData column stores the start_index and count to indicate the range in time to be selected as well as an object reference to the TimeSeries.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("timeseries") name: str = Field("timeseries")
idx_start: int = Field( idx_start: int = Field(
..., ...,
@ -114,7 +99,6 @@ class Image(NWBData):
An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)). An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -136,7 +120,6 @@ class NWBContainer(Container):
An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers. An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -145,7 +128,6 @@ class NWBDataInterface(NWBContainer):
An abstract data type for a generic container storing collections of data, as opposed to metadata. An abstract data type for a generic container storing collections of data, as opposed to metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -154,7 +136,6 @@ class TimeSeries(NWBDataInterface):
General purpose time series. General purpose time series.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of the time series.""" None, description="""Description of the time series."""
@ -194,7 +175,6 @@ class TimeSeriesData(ConfiguredBaseModel):
Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file. Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
conversion: Optional[float] = Field( conversion: Optional[float] = Field(
None, None,
@ -227,7 +207,6 @@ class TimeSeriesStartingTime(ConfiguredBaseModel):
Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute. Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["starting_time"] = Field("starting_time") name: Literal["starting_time"] = Field("starting_time")
rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""") rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""")
unit: Optional[str] = Field( unit: Optional[str] = Field(
@ -242,7 +221,6 @@ class TimeSeriesSync(ConfiguredBaseModel):
Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes. Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["sync"] = Field("sync") name: Literal["sync"] = Field("sync")
@ -251,7 +229,6 @@ class ProcessingModule(NWBContainer):
A collection of processed data. A collection of processed data.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[ children: Optional[
List[Union[BaseModel, DynamicTable, NWBDataInterface]] List[Union[BaseModel, DynamicTable, NWBDataInterface]]
| Union[BaseModel, DynamicTable, NWBDataInterface] | Union[BaseModel, DynamicTable, NWBDataInterface]
@ -264,7 +241,6 @@ class Images(NWBDataInterface):
A collection of images. A collection of images.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("Images") name: str = Field("Images")
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of this collection of images.""" None, description="""Description of this collection of images."""
@ -272,18 +248,3 @@ class Images(NWBDataInterface):
image: List[str] | str = Field( image: List[str] | str = Field(
default_factory=list, description="""Images stored in this collection.""" default_factory=list, description="""Images stored in this collection."""
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
NWBData.model_rebuild()
TimeSeriesReferenceVectorData.model_rebuild()
Image.model_rebuild()
NWBContainer.model_rebuild()
NWBDataInterface.model_rebuild()
TimeSeries.model_rebuild()
TimeSeriesData.model_rebuild()
TimeSeriesStartingTime.model_rebuild()
TimeSeriesSync.model_rebuild()
ProcessingModule.model_rebuild()
Images.model_rebuild()

View file

@ -28,9 +28,9 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesStartingTime, TimeSeriesStartingTime,
NWBDataInterface,
TimeSeriesSync, TimeSeriesSync,
) )
@ -42,13 +42,6 @@ version = "2.4.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -68,18 +61,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class SpatialSeries(TimeSeries): class SpatialSeries(TimeSeries):
""" """
Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values. Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field( data: str = Field(
..., ...,
@ -123,7 +109,6 @@ class SpatialSeriesData(ConfiguredBaseModel):
1-D or 2-D array storing position or direction relative to some reference frame. 1-D or 2-D array storing position or direction relative to some reference frame.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -142,7 +127,6 @@ class BehavioralEpochs(NWBDataInterface):
TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data. TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[IntervalSeries] | IntervalSeries] = Field( children: Optional[List[IntervalSeries] | IntervalSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -154,7 +138,6 @@ class BehavioralEvents(NWBDataInterface):
TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details. TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict) children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -164,7 +147,6 @@ class BehavioralTimeSeries(NWBDataInterface):
TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details. TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict) children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -174,7 +156,6 @@ class PupilTracking(NWBDataInterface):
Eye-tracking data, representing pupil size. Eye-tracking data, representing pupil size.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict) children: Optional[List[TimeSeries] | TimeSeries] = Field(default_factory=dict)
name: str = Field(...) name: str = Field(...)
@ -184,7 +165,6 @@ class EyeTracking(NWBDataInterface):
Eye-tracking data, representing direction of gaze. Eye-tracking data, representing direction of gaze.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpatialSeries] | SpatialSeries] = Field( children: Optional[List[SpatialSeries] | SpatialSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -196,7 +176,6 @@ class CompassDirection(NWBDataInterface):
With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees. With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpatialSeries] | SpatialSeries] = Field( children: Optional[List[SpatialSeries] | SpatialSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -208,21 +187,7 @@ class Position(NWBDataInterface):
Position data, whether along the x, x/y or x/y/z axis. Position data, whether along the x, x/y or x/y/z axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpatialSeries] | SpatialSeries] = Field( children: Optional[List[SpatialSeries] | SpatialSeries] = Field(
default_factory=dict default_factory=dict
) )
name: str = Field(...) name: str = Field(...)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
SpatialSeries.model_rebuild()
SpatialSeriesData.model_rebuild()
BehavioralEpochs.model_rebuild()
BehavioralEvents.model_rebuild()
BehavioralTimeSeries.model_rebuild()
PupilTracking.model_rebuild()
EyeTracking.model_rebuild()
CompassDirection.model_rebuild()
Position.model_rebuild()

View file

@ -35,13 +35,6 @@ version = "2.4.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class Device(NWBContainer): class Device(NWBContainer):
""" """
Metadata about a data acquisition device, e.g., recording system, electrode, microscope. Metadata about a data acquisition device, e.g., recording system, electrode, microscope.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, None,
@ -81,8 +67,3 @@ class Device(NWBContainer):
manufacturer: Optional[str] = Field( manufacturer: Optional[str] = Field(
None, description="""The name of the manufacturer of the device.""" None, description="""The name of the manufacturer of the device."""
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
Device.model_rebuild()

View file

@ -27,29 +27,22 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTableRegion, DynamicTable
from .core_nwb_base import ( from .core_nwb_base import (
NWBContainer,
TimeSeriesStartingTime,
NWBDataInterface, NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesStartingTime,
NWBContainer,
TimeSeriesSync, TimeSeriesSync,
) )
from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTableRegion, DynamicTable
metamodel_version = "None" metamodel_version = "None"
version = "2.4.0" version = "2.4.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -69,18 +62,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class ElectricalSeries(TimeSeries): class ElectricalSeries(TimeSeries):
""" """
A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels. A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
filtering: Optional[str] = Field( filtering: Optional[str] = Field(
None, None,
@ -133,7 +119,6 @@ class ElectricalSeriesElectrodes(DynamicTableRegion):
DynamicTableRegion pointer to the electrodes that this time series was generated from. DynamicTableRegion pointer to the electrodes that this time series was generated from.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -157,7 +142,6 @@ class SpikeEventSeries(ElectricalSeries):
Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode). Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Union[ data: Union[
NDArray[Shape["* num_events, * num_channels, * num_samples"], float], NDArray[Shape["* num_events, * num_channels, * num_samples"], float],
@ -209,7 +193,6 @@ class FeatureExtraction(NWBDataInterface):
Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("FeatureExtraction") name: str = Field("FeatureExtraction")
description: NDArray[Shape["* num_features"], str] = Field( description: NDArray[Shape["* num_features"], str] = Field(
..., ...,
@ -236,7 +219,6 @@ class FeatureExtractionElectrodes(DynamicTableRegion):
DynamicTableRegion pointer to the electrodes that this time series was generated from. DynamicTableRegion pointer to the electrodes that this time series was generated from.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -260,7 +242,6 @@ class EventDetection(NWBDataInterface):
Detected spike events from voltage trace(s). Detected spike events from voltage trace(s).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("EventDetection") name: str = Field("EventDetection")
detection_method: str = Field( detection_method: str = Field(
..., ...,
@ -280,7 +261,6 @@ class EventWaveform(NWBDataInterface):
Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition. Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[SpikeEventSeries] | SpikeEventSeries] = Field( children: Optional[List[SpikeEventSeries] | SpikeEventSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -292,7 +272,6 @@ class FilteredEphys(NWBDataInterface):
Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries 'filtering' attribute. Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries 'filtering' attribute.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field( children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -304,7 +283,6 @@ class LFP(NWBDataInterface):
LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries 'filtering' attribute. LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries 'filtering' attribute.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field( children: Optional[List[ElectricalSeries] | ElectricalSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -316,7 +294,6 @@ class ElectrodeGroup(NWBContainer):
A physical grouping of electrodes, e.g. a shank of an array. A physical grouping of electrodes, e.g. a shank of an array.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of this electrode group.""" None, description="""Description of this electrode group."""
@ -335,7 +312,6 @@ class ElectrodeGroupPosition(ConfiguredBaseModel):
stereotaxic or common framework coordinates stereotaxic or common framework coordinates
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["position"] = Field("position") name: Literal["position"] = Field("position")
x: Optional[float] = Field(None, description="""x coordinate""") x: Optional[float] = Field(None, description="""x coordinate""")
y: Optional[float] = Field(None, description="""y coordinate""") y: Optional[float] = Field(None, description="""y coordinate""")
@ -347,7 +323,6 @@ class ClusterWaveforms(NWBDataInterface):
DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one. DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("ClusterWaveforms") name: str = Field("ClusterWaveforms")
waveform_filtering: str = Field( waveform_filtering: str = Field(
..., description="""Filtering applied to data before generating mean/sd""" ..., description="""Filtering applied to data before generating mean/sd"""
@ -367,7 +342,6 @@ class Clustering(NWBDataInterface):
DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("Clustering") name: str = Field("Clustering")
description: str = Field( description: str = Field(
..., ...,
@ -384,20 +358,3 @@ class Clustering(NWBDataInterface):
..., ...,
description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""", description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ElectricalSeries.model_rebuild()
ElectricalSeriesElectrodes.model_rebuild()
SpikeEventSeries.model_rebuild()
FeatureExtraction.model_rebuild()
FeatureExtractionElectrodes.model_rebuild()
EventDetection.model_rebuild()
EventWaveform.model_rebuild()
FilteredEphys.model_rebuild()
LFP.model_rebuild()
ElectrodeGroup.model_rebuild()
ElectrodeGroupPosition.model_rebuild()
ClusterWaveforms.model_rebuild()
Clustering.model_rebuild()

View file

@ -27,27 +27,20 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import TimeSeries
from ...hdmf_common.v1_5_0.hdmf_common_table import ( from ...hdmf_common.v1_5_0.hdmf_common_table import (
DynamicTable,
VectorIndex, VectorIndex,
DynamicTable,
VectorData, VectorData,
) )
from .core_nwb_base import TimeSeries
metamodel_version = "None" metamodel_version = "None"
version = "2.4.0" version = "2.4.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -67,18 +60,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class TimeIntervals(DynamicTable): class TimeIntervals(DynamicTable):
""" """
A container for aggregating epoch data and the TimeSeries that each epoch applies to. A container for aggregating epoch data and the TimeSeries that each epoch applies to.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
start_time: Optional[List[float] | float] = Field( start_time: Optional[List[float] | float] = Field(
default_factory=list, description="""Start time of epoch, in seconds.""" default_factory=list, description="""Start time of epoch, in seconds."""
@ -119,7 +105,6 @@ class TimeIntervalsTagsIndex(VectorIndex):
Index for tags. Index for tags.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["tags_index"] = Field("tags_index") name: Literal["tags_index"] = Field("tags_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -143,7 +128,6 @@ class TimeIntervalsTimeseries(VectorData):
An index into a TimeSeries object. An index into a TimeSeries object.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["timeseries"] = Field("timeseries") name: Literal["timeseries"] = Field("timeseries")
idx_start: Optional[int] = Field( idx_start: Optional[int] = Field(
None, None,
@ -174,7 +158,6 @@ class TimeIntervalsTimeseriesIndex(VectorIndex):
Index for timeseries. Index for timeseries.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["timeseries_index"] = Field("timeseries_index") name: Literal["timeseries_index"] = Field("timeseries_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -191,11 +174,3 @@ class TimeIntervalsTimeseriesIndex(VectorIndex):
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any],
] ]
] = Field(None) ] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
TimeIntervals.model_rebuild()
TimeIntervalsTagsIndex.model_rebuild()
TimeIntervalsTimeseries.model_rebuild()
TimeIntervalsTimeseriesIndex.model_rebuild()

View file

@ -27,37 +27,37 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_ophys import ImagingPlane from .core_nwb_icephys import (
SweepTable,
from .core_nwb_base import ( SimultaneousRecordingsTable,
TimeSeries, SequentialRecordingsTable,
NWBDataInterface, RepetitionsTable,
ProcessingModule, ExperimentalConditionsTable,
NWBContainer, IntracellularElectrode,
NWBData, IntracellularRecordingsTable,
) )
from .core_nwb_epoch import TimeIntervals from .core_nwb_epoch import TimeIntervals
from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, VectorData from .core_nwb_ecephys import ElectrodeGroup
from .core_nwb_icephys import ( from .core_nwb_base import (
RepetitionsTable, NWBContainer,
IntracellularElectrode, ProcessingModule,
SequentialRecordingsTable, NWBData,
IntracellularRecordingsTable, NWBDataInterface,
SweepTable, TimeSeries,
ExperimentalConditionsTable,
SimultaneousRecordingsTable,
) )
from .core_nwb_ogen import OptogeneticStimulusSite from .core_nwb_device import Device
from .core_nwb_misc import Units from .core_nwb_misc import Units
from .core_nwb_ecephys import ElectrodeGroup from .core_nwb_ogen import OptogeneticStimulusSite
from .core_nwb_device import Device from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, VectorData
from .core_nwb_ophys import ImagingPlane
metamodel_version = "None" metamodel_version = "None"
@ -65,13 +65,6 @@ version = "2.4.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -91,18 +84,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class ScratchData(NWBData): class ScratchData(NWBData):
""" """
Any one-off datasets Any one-off datasets
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
notes: Optional[str] = Field( notes: Optional[str] = Field(
None, description="""Any notes the user has about the dataset being stored""" None, description="""Any notes the user has about the dataset being stored"""
@ -114,7 +100,6 @@ class NWBFile(NWBContainer):
An NWB:N file storing cellular-based neurophysiology data from a single experimental session. An NWB:N file storing cellular-based neurophysiology data from a single experimental session.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: Literal["root"] = Field("root") name: Literal["root"] = Field("root")
nwb_version: Optional[str] = Field( nwb_version: Optional[str] = Field(
None, None,
@ -185,7 +170,6 @@ class NWBFileStimulus(ConfiguredBaseModel):
Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file. Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["stimulus"] = Field("stimulus") name: Literal["stimulus"] = Field("stimulus")
presentation: Optional[List[TimeSeries] | TimeSeries] = Field( presentation: Optional[List[TimeSeries] | TimeSeries] = Field(
default_factory=dict, description="""Stimuli presented during the experiment.""" default_factory=dict, description="""Stimuli presented during the experiment."""
@ -201,7 +185,6 @@ class NWBFileGeneral(ConfiguredBaseModel):
Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them. Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["general"] = Field("general") name: Literal["general"] = Field("general")
data_collection: Optional[str] = Field( data_collection: Optional[str] = Field(
None, description="""Notes about data collection and analysis.""" None, description="""Notes about data collection and analysis."""
@ -291,7 +274,6 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel):
Script file or link to public source code used to create this NWB file. Script file or link to public source code used to create this NWB file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["source_script"] = Field("source_script") name: Literal["source_script"] = Field("source_script")
file_name: Optional[str] = Field(None, description="""Name of script file.""") file_name: Optional[str] = Field(None, description="""Name of script file.""")
value: str = Field(...) value: str = Field(...)
@ -302,7 +284,6 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel):
Metadata related to extracellular electrophysiology. Metadata related to extracellular electrophysiology.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["extracellular_ephys"] = Field("extracellular_ephys") name: Literal["extracellular_ephys"] = Field("extracellular_ephys")
electrode_group: Optional[List[str] | str] = Field( electrode_group: Optional[List[str] | str] = Field(
default_factory=list, description="""Physical group of electrodes.""" default_factory=list, description="""Physical group of electrodes."""
@ -318,7 +299,6 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
A table of all electrodes (i.e. channels) used for recording. A table of all electrodes (i.e. channels) used for recording.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
x: Optional[List[float] | float] = Field( x: Optional[List[float] | float] = Field(
default_factory=list, default_factory=list,
@ -386,7 +366,6 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel):
Metadata related to intracellular electrophysiology. Metadata related to intracellular electrophysiology.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["intracellular_ephys"] = Field("intracellular_ephys") name: Literal["intracellular_ephys"] = Field("intracellular_ephys")
filtering: Optional[str] = Field( filtering: Optional[str] = Field(
None, None,
@ -426,7 +405,6 @@ class LabMetaData(NWBContainer):
Lab-specific meta-data. Lab-specific meta-data.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
@ -435,7 +413,6 @@ class Subject(NWBContainer):
Information about the animal or person from which the data was measured. Information about the animal or person from which the data was measured.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
age: Optional[str] = Field( age: Optional[str] = Field(
None, None,
@ -463,17 +440,3 @@ class Subject(NWBContainer):
None, None,
description="""Weight at time of experiment, at time of surgery and at other important times.""", description="""Weight at time of experiment, at time of surgery and at other important times.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ScratchData.model_rebuild()
NWBFile.model_rebuild()
NWBFileStimulus.model_rebuild()
NWBFileGeneral.model_rebuild()
NWBFileGeneralSourceScript.model_rebuild()
NWBFileGeneralExtracellularEphys.model_rebuild()
NWBFileGeneralExtracellularEphysElectrodes.model_rebuild()
NWBFileGeneralIntracellularEphys.model_rebuild()
LabMetaData.model_rebuild()
Subject.model_rebuild()

View file

@ -27,20 +27,20 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import ( from ...hdmf_common.v1_5_0.hdmf_common_table import (
TimeSeries, AlignedDynamicTable,
TimeSeriesSync, DynamicTableRegion,
TimeSeriesStartingTime, VectorIndex,
NWBContainer, DynamicTable,
TimeSeriesReferenceVectorData, VectorData,
) )
from ...hdmf_common.v1_5_0.hdmf_common_table import ( from .core_nwb_base import (
DynamicTableRegion, NWBContainer,
DynamicTable, TimeSeriesSync,
AlignedDynamicTable, TimeSeriesStartingTime,
VectorData, TimeSeriesReferenceVectorData,
VectorIndex, TimeSeries,
) )
@ -49,13 +49,6 @@ version = "2.4.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -75,18 +68,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class PatchClampSeries(TimeSeries): class PatchClampSeries(TimeSeries):
""" """
An abstract base class for patch-clamp data - stimulus or response, current or voltage. An abstract base class for patch-clamp data - stimulus or response, current or voltage.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
None, description="""Protocol/stimulus name for this patch-clamp dataset.""" None, description="""Protocol/stimulus name for this patch-clamp dataset."""
@ -134,7 +120,6 @@ class PatchClampSeriesData(ConfiguredBaseModel):
Recorded voltage or current. Recorded voltage or current.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -148,7 +133,6 @@ class CurrentClampSeries(PatchClampSeries):
Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected. Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Recorded voltage.""") data: str = Field(..., description="""Recorded voltage.""")
bias_current: Optional[float] = Field( bias_current: Optional[float] = Field(
@ -205,7 +189,6 @@ class CurrentClampSeriesData(ConfiguredBaseModel):
Recorded voltage. Recorded voltage.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -219,7 +202,6 @@ class IZeroClampSeries(CurrentClampSeries):
Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell. Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
None, None,
@ -277,7 +259,6 @@ class CurrentClampStimulusSeries(PatchClampSeries):
Stimulus current applied during current clamp recording. Stimulus current applied during current clamp recording.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Stimulus current applied.""") data: str = Field(..., description="""Stimulus current applied.""")
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
@ -325,7 +306,6 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel):
Stimulus current applied. Stimulus current applied.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -339,7 +319,6 @@ class VoltageClampSeries(PatchClampSeries):
Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected. Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Recorded current.""") data: str = Field(..., description="""Recorded current.""")
capacitance_fast: Optional[str] = Field( capacitance_fast: Optional[str] = Field(
@ -408,7 +387,6 @@ class VoltageClampSeriesData(ConfiguredBaseModel):
Recorded current. Recorded current.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -422,7 +400,6 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel):
Fast capacitance, in farads. Fast capacitance, in farads.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["capacitance_fast"] = Field("capacitance_fast") name: Literal["capacitance_fast"] = Field("capacitance_fast")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -436,7 +413,6 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel):
Slow capacitance, in farads. Slow capacitance, in farads.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["capacitance_slow"] = Field("capacitance_slow") name: Literal["capacitance_slow"] = Field("capacitance_slow")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -450,7 +426,6 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel):
Resistance compensation bandwidth, in hertz. Resistance compensation bandwidth, in hertz.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["resistance_comp_bandwidth"] = Field("resistance_comp_bandwidth") name: Literal["resistance_comp_bandwidth"] = Field("resistance_comp_bandwidth")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -464,7 +439,6 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel):
Resistance compensation correction, in percent. Resistance compensation correction, in percent.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["resistance_comp_correction"] = Field("resistance_comp_correction") name: Literal["resistance_comp_correction"] = Field("resistance_comp_correction")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -478,7 +452,6 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel):
Resistance compensation prediction, in percent. Resistance compensation prediction, in percent.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["resistance_comp_prediction"] = Field("resistance_comp_prediction") name: Literal["resistance_comp_prediction"] = Field("resistance_comp_prediction")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -492,7 +465,6 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel):
Whole cell capacitance compensation, in farads. Whole cell capacitance compensation, in farads.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["whole_cell_capacitance_comp"] = Field("whole_cell_capacitance_comp") name: Literal["whole_cell_capacitance_comp"] = Field("whole_cell_capacitance_comp")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -506,7 +478,6 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel):
Whole cell series resistance compensation, in ohms. Whole cell series resistance compensation, in ohms.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["whole_cell_series_resistance_comp"] = Field( name: Literal["whole_cell_series_resistance_comp"] = Field(
"whole_cell_series_resistance_comp" "whole_cell_series_resistance_comp"
) )
@ -522,7 +493,6 @@ class VoltageClampStimulusSeries(PatchClampSeries):
Stimulus voltage applied during a voltage clamp recording. Stimulus voltage applied during a voltage clamp recording.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Stimulus voltage applied.""") data: str = Field(..., description="""Stimulus voltage applied.""")
stimulus_description: Optional[str] = Field( stimulus_description: Optional[str] = Field(
@ -570,7 +540,6 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel):
Stimulus voltage applied. Stimulus voltage applied.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -584,7 +553,6 @@ class IntracellularElectrode(NWBContainer):
An intracellular electrode and its metadata. An intracellular electrode and its metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: str = Field( description: str = Field(
..., ...,
@ -616,7 +584,6 @@ class SweepTable(DynamicTable):
[DEPRECATED] Table used to group different PatchClampSeries. SweepTable is being replaced by IntracellularRecordingsTable and SimultaneousRecordingsTable tables. Additional SequentialRecordingsTable, RepetitionsTable, and ExperimentalConditions tables provide enhanced support for experiment metadata. [DEPRECATED] Table used to group different PatchClampSeries. SweepTable is being replaced by IntracellularRecordingsTable and SimultaneousRecordingsTable tables. Additional SequentialRecordingsTable, RepetitionsTable, and ExperimentalConditions tables provide enhanced support for experiment metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
sweep_number: Optional[List[int] | int] = Field( sweep_number: Optional[List[int] | int] = Field(
default_factory=list, default_factory=list,
@ -649,7 +616,6 @@ class SweepTableSeriesIndex(VectorIndex):
Index for series. Index for series.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["series_index"] = Field("series_index") name: Literal["series_index"] = Field("series_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -673,7 +639,6 @@ class IntracellularElectrodesTable(DynamicTable):
Table for storing intracellular electrode related metadata. Table for storing intracellular electrode related metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of what is in this dynamic table.""" None, description="""Description of what is in this dynamic table."""
@ -701,7 +666,6 @@ class IntracellularStimuliTable(DynamicTable):
Table for storing intracellular stimulus related metadata. Table for storing intracellular stimulus related metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of what is in this dynamic table.""" None, description="""Description of what is in this dynamic table."""
@ -729,7 +693,6 @@ class IntracellularStimuliTableStimulus(TimeSeriesReferenceVectorData):
Column storing the reference to the recorded stimulus for the recording (rows). Column storing the reference to the recorded stimulus for the recording (rows).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["stimulus"] = Field("stimulus") name: Literal["stimulus"] = Field("stimulus")
idx_start: int = Field( idx_start: int = Field(
..., ...,
@ -760,7 +723,6 @@ class IntracellularResponsesTable(DynamicTable):
Table for storing intracellular response related metadata. Table for storing intracellular response related metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: Optional[str] = Field( description: Optional[str] = Field(
None, description="""Description of what is in this dynamic table.""" None, description="""Description of what is in this dynamic table."""
@ -788,7 +750,6 @@ class IntracellularResponsesTableResponse(TimeSeriesReferenceVectorData):
Column storing the reference to the recorded response for the recording (rows) Column storing the reference to the recorded response for the recording (rows)
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["response"] = Field("response") name: Literal["response"] = Field("response")
idx_start: int = Field( idx_start: int = Field(
..., ...,
@ -819,7 +780,6 @@ class IntracellularRecordingsTable(AlignedDynamicTable):
A table to group together a stimulus and response from a single electrode and a single simultaneous recording. Each row in the table represents a single recording consisting typically of a stimulus and a corresponding response. In some cases, however, only a stimulus or a response is recorded as part of an experiment. In this case, both the stimulus and response will point to the same TimeSeries while the idx_start and count of the invalid column will be set to -1, thus, indicating that no values have been recorded for the stimulus or response, respectively. Note, a recording MUST contain at least a stimulus or a response. Typically the stimulus and response are PatchClampSeries. However, the use of AD/DA channels that are not associated to an electrode is also common in intracellular electrophysiology, in which case other TimeSeries may be used. A table to group together a stimulus and response from a single electrode and a single simultaneous recording. Each row in the table represents a single recording consisting typically of a stimulus and a corresponding response. In some cases, however, only a stimulus or a response is recorded as part of an experiment. In this case, both the stimulus and response will point to the same TimeSeries while the idx_start and count of the invalid column will be set to -1, thus, indicating that no values have been recorded for the stimulus or response, respectively. Note, a recording MUST contain at least a stimulus or a response. Typically the stimulus and response are PatchClampSeries. However, the use of AD/DA channels that are not associated to an electrode is also common in intracellular electrophysiology, in which case other TimeSeries may be used.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: Literal["intracellular_recordings"] = Field("intracellular_recordings") name: Literal["intracellular_recordings"] = Field("intracellular_recordings")
description: Optional[str] = Field( description: Optional[str] = Field(
None, None,
@ -859,7 +819,6 @@ class SimultaneousRecordingsTable(DynamicTable):
A table for grouping different intracellular recordings from the IntracellularRecordingsTable table together that were recorded simultaneously from different electrodes. A table for grouping different intracellular recordings from the IntracellularRecordingsTable table together that were recorded simultaneously from different electrodes.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: Literal["simultaneous_recordings"] = Field("simultaneous_recordings") name: Literal["simultaneous_recordings"] = Field("simultaneous_recordings")
recordings: str = Field( recordings: str = Field(
..., ...,
@ -890,7 +849,6 @@ class SimultaneousRecordingsTableRecordings(DynamicTableRegion):
A reference to one or more rows in the IntracellularRecordingsTable table. A reference to one or more rows in the IntracellularRecordingsTable table.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["recordings"] = Field("recordings") name: Literal["recordings"] = Field("recordings")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -914,7 +872,6 @@ class SimultaneousRecordingsTableRecordingsIndex(VectorIndex):
Index dataset for the recordings column. Index dataset for the recordings column.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["recordings_index"] = Field("recordings_index") name: Literal["recordings_index"] = Field("recordings_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -938,7 +895,6 @@ class SequentialRecordingsTable(DynamicTable):
A table for grouping different sequential recordings from the SimultaneousRecordingsTable table together. This is typically used to group together sequential recordings where a sequence of stimuli of the same type with varying parameters have been presented in a sequence. A table for grouping different sequential recordings from the SimultaneousRecordingsTable table together. This is typically used to group together sequential recordings where a sequence of stimuli of the same type with varying parameters have been presented in a sequence.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: Literal["sequential_recordings"] = Field("sequential_recordings") name: Literal["sequential_recordings"] = Field("sequential_recordings")
simultaneous_recordings: str = Field( simultaneous_recordings: str = Field(
..., ...,
@ -973,7 +929,6 @@ class SequentialRecordingsTableSimultaneousRecordings(DynamicTableRegion):
A reference to one or more rows in the SimultaneousRecordingsTable table. A reference to one or more rows in the SimultaneousRecordingsTable table.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["simultaneous_recordings"] = Field("simultaneous_recordings") name: Literal["simultaneous_recordings"] = Field("simultaneous_recordings")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -997,7 +952,6 @@ class SequentialRecordingsTableSimultaneousRecordingsIndex(VectorIndex):
Index dataset for the simultaneous_recordings column. Index dataset for the simultaneous_recordings column.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["simultaneous_recordings_index"] = Field( name: Literal["simultaneous_recordings_index"] = Field(
"simultaneous_recordings_index" "simultaneous_recordings_index"
) )
@ -1023,7 +977,6 @@ class RepetitionsTable(DynamicTable):
A table for grouping different sequential intracellular recordings together. With each SequentialRecording typically representing a particular type of stimulus, the RepetitionsTable table is typically used to group sets of stimuli applied in sequence. A table for grouping different sequential intracellular recordings together. With each SequentialRecording typically representing a particular type of stimulus, the RepetitionsTable table is typically used to group sets of stimuli applied in sequence.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: Literal["repetitions"] = Field("repetitions") name: Literal["repetitions"] = Field("repetitions")
sequential_recordings: str = Field( sequential_recordings: str = Field(
..., ...,
@ -1054,7 +1007,6 @@ class RepetitionsTableSequentialRecordings(DynamicTableRegion):
A reference to one or more rows in the SequentialRecordingsTable table. A reference to one or more rows in the SequentialRecordingsTable table.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["sequential_recordings"] = Field("sequential_recordings") name: Literal["sequential_recordings"] = Field("sequential_recordings")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -1078,7 +1030,6 @@ class RepetitionsTableSequentialRecordingsIndex(VectorIndex):
Index dataset for the sequential_recordings column. Index dataset for the sequential_recordings column.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["sequential_recordings_index"] = Field("sequential_recordings_index") name: Literal["sequential_recordings_index"] = Field("sequential_recordings_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -1102,7 +1053,6 @@ class ExperimentalConditionsTable(DynamicTable):
A table for grouping different intracellular recording repetitions together that belong to the same experimental condition. A table for grouping different intracellular recording repetitions together that belong to the same experimental condition.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: Literal["experimental_conditions"] = Field("experimental_conditions") name: Literal["experimental_conditions"] = Field("experimental_conditions")
repetitions: str = Field( repetitions: str = Field(
..., ...,
@ -1133,7 +1083,6 @@ class ExperimentalConditionsTableRepetitions(DynamicTableRegion):
A reference to one or more rows in the RepetitionsTable table. A reference to one or more rows in the RepetitionsTable table.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["repetitions"] = Field("repetitions") name: Literal["repetitions"] = Field("repetitions")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -1157,7 +1106,6 @@ class ExperimentalConditionsTableRepetitionsIndex(VectorIndex):
Index dataset for the repetitions column. Index dataset for the repetitions column.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["repetitions_index"] = Field("repetitions_index") name: Literal["repetitions_index"] = Field("repetitions_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -1174,46 +1122,3 @@ class ExperimentalConditionsTableRepetitionsIndex(VectorIndex):
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any],
] ]
] = Field(None) ] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
PatchClampSeries.model_rebuild()
PatchClampSeriesData.model_rebuild()
CurrentClampSeries.model_rebuild()
CurrentClampSeriesData.model_rebuild()
IZeroClampSeries.model_rebuild()
CurrentClampStimulusSeries.model_rebuild()
CurrentClampStimulusSeriesData.model_rebuild()
VoltageClampSeries.model_rebuild()
VoltageClampSeriesData.model_rebuild()
VoltageClampSeriesCapacitanceFast.model_rebuild()
VoltageClampSeriesCapacitanceSlow.model_rebuild()
VoltageClampSeriesResistanceCompBandwidth.model_rebuild()
VoltageClampSeriesResistanceCompCorrection.model_rebuild()
VoltageClampSeriesResistanceCompPrediction.model_rebuild()
VoltageClampSeriesWholeCellCapacitanceComp.model_rebuild()
VoltageClampSeriesWholeCellSeriesResistanceComp.model_rebuild()
VoltageClampStimulusSeries.model_rebuild()
VoltageClampStimulusSeriesData.model_rebuild()
IntracellularElectrode.model_rebuild()
SweepTable.model_rebuild()
SweepTableSeriesIndex.model_rebuild()
IntracellularElectrodesTable.model_rebuild()
IntracellularStimuliTable.model_rebuild()
IntracellularStimuliTableStimulus.model_rebuild()
IntracellularResponsesTable.model_rebuild()
IntracellularResponsesTableResponse.model_rebuild()
IntracellularRecordingsTable.model_rebuild()
SimultaneousRecordingsTable.model_rebuild()
SimultaneousRecordingsTableRecordings.model_rebuild()
SimultaneousRecordingsTableRecordingsIndex.model_rebuild()
SequentialRecordingsTable.model_rebuild()
SequentialRecordingsTableSimultaneousRecordings.model_rebuild()
SequentialRecordingsTableSimultaneousRecordingsIndex.model_rebuild()
RepetitionsTable.model_rebuild()
RepetitionsTableSequentialRecordings.model_rebuild()
RepetitionsTableSequentialRecordingsIndex.model_rebuild()
ExperimentalConditionsTable.model_rebuild()
ExperimentalConditionsTableRepetitions.model_rebuild()
ExperimentalConditionsTableRepetitionsIndex.model_rebuild()

View file

@ -27,7 +27,7 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync from .core_nwb_base import Image, TimeSeriesStartingTime, TimeSeries, TimeSeriesSync
metamodel_version = "None" metamodel_version = "None"
@ -35,13 +35,6 @@ version = "2.4.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class GrayscaleImage(Image): class GrayscaleImage(Image):
""" """
A grayscale image. A grayscale image.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -94,7 +80,6 @@ class RGBImage(Image):
A color image. A color image.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -116,7 +101,6 @@ class RGBAImage(Image):
A color image with transparency. A color image with transparency.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter.""" None, description="""Pixel resolution of the image, in pixels per centimeter."""
@ -138,7 +122,6 @@ class ImageSeries(TimeSeries):
General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z]. General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z].
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Union[ data: Union[
NDArray[Shape["* frame, * x, * y"], float], NDArray[Shape["* frame, * x, * y"], float],
@ -192,7 +175,6 @@ class ImageSeriesExternalFile(ConfiguredBaseModel):
Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file. Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["external_file"] = Field("external_file") name: Literal["external_file"] = Field("external_file")
starting_frame: Optional[int] = Field( starting_frame: Optional[int] = Field(
None, None,
@ -206,7 +188,6 @@ class ImageMaskSeries(ImageSeries):
An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed. An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Union[ data: Union[
NDArray[Shape["* frame, * x, * y"], float], NDArray[Shape["* frame, * x, * y"], float],
@ -260,7 +241,6 @@ class OpticalSeries(ImageSeries):
Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important. Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
distance: Optional[float] = Field( distance: Optional[float] = Field(
None, description="""Distance from camera/monitor to target/eye.""" None, description="""Distance from camera/monitor to target/eye."""
@ -329,7 +309,6 @@ class IndexSeries(TimeSeries):
Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed. Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], int] = Field( data: NDArray[Shape["* num_times"], int] = Field(
..., description="""Index of the frame in the referenced ImageSeries.""" ..., description="""Index of the frame in the referenced ImageSeries."""
@ -361,15 +340,3 @@ class IndexSeries(TimeSeries):
None, None,
description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""", description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
GrayscaleImage.model_rebuild()
RGBImage.model_rebuild()
RGBAImage.model_rebuild()
ImageSeries.model_rebuild()
ImageSeriesExternalFile.model_rebuild()
ImageMaskSeries.model_rebuild()
OpticalSeries.model_rebuild()
IndexSeries.model_rebuild()

View file

@ -32,13 +32,6 @@ version = "None"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -56,13 +49,3 @@ class ConfiguredBaseModel(BaseModel):
self.array[i] = value self.array[i] = value
else: else:
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model

View file

@ -27,16 +27,16 @@ if TYPE_CHECKING:
import numpy as np import numpy as np
from .core_nwb_base import TimeSeries, TimeSeriesSync, TimeSeriesStartingTime from .core_nwb_ecephys import ElectrodeGroup
from ...hdmf_common.v1_5_0.hdmf_common_table import ( from ...hdmf_common.v1_5_0.hdmf_common_table import (
DynamicTableRegion, DynamicTableRegion,
VectorIndex,
DynamicTable, DynamicTable,
VectorData, VectorData,
VectorIndex,
) )
from .core_nwb_ecephys import ElectrodeGroup from .core_nwb_base import TimeSeriesSync, TimeSeriesStartingTime, TimeSeries
metamodel_version = "None" metamodel_version = "None"
@ -44,13 +44,6 @@ version = "2.4.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -70,18 +63,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class AbstractFeatureSeries(TimeSeries): class AbstractFeatureSeries(TimeSeries):
""" """
Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical. Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Values of each feature at each time.""") data: str = Field(..., description="""Values of each feature at each time.""")
feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field( feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field(
@ -125,7 +111,6 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel):
Values of each feature at each time. Values of each feature at each time.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -144,7 +129,6 @@ class AnnotationSeries(TimeSeries):
Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way. Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], str] = Field( data: NDArray[Shape["* num_times"], str] = Field(
..., description="""Annotations made during an experiment.""" ..., description="""Annotations made during an experiment."""
@ -183,7 +167,6 @@ class IntervalSeries(TimeSeries):
Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way. Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], int] = Field( data: NDArray[Shape["* num_times"], int] = Field(
..., description="""Use values >0 if interval started, <0 if interval ended.""" ..., description="""Use values >0 if interval started, <0 if interval ended."""
@ -222,7 +205,6 @@ class DecompositionSeries(TimeSeries):
Spectral analysis of a time series, e.g. of an LFP or a speech signal. Spectral analysis of a time series, e.g. of an LFP or a speech signal.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: str = Field(..., description="""Data decomposed into frequency bands.""") data: str = Field(..., description="""Data decomposed into frequency bands.""")
metric: str = Field( metric: str = Field(
@ -270,7 +252,6 @@ class DecompositionSeriesData(ConfiguredBaseModel):
Data decomposed into frequency bands. Data decomposed into frequency bands.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["data"] = Field("data") name: Literal["data"] = Field("data")
unit: Optional[str] = Field( unit: Optional[str] = Field(
None, None,
@ -286,7 +267,6 @@ class DecompositionSeriesSourceChannels(DynamicTableRegion):
DynamicTableRegion pointer to the channels that this decomposition series was generated from. DynamicTableRegion pointer to the channels that this decomposition series was generated from.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["source_channels"] = Field("source_channels") name: Literal["source_channels"] = Field("source_channels")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -310,7 +290,6 @@ class DecompositionSeriesBands(DynamicTable):
Table for describing the bands that this series was generated from. There should be one row in this table for each band. Table for describing the bands that this series was generated from. There should be one row in this table for each band.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["bands"] = Field("bands") name: Literal["bands"] = Field("bands")
band_name: Optional[List[str] | str] = Field( band_name: Optional[List[str] | str] = Field(
default_factory=list, description="""Name of the band, e.g. theta.""" default_factory=list, description="""Name of the band, e.g. theta."""
@ -347,7 +326,6 @@ class Units(DynamicTable):
Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times. Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("Units") name: str = Field("Units")
spike_times_index: Optional[str] = Field( spike_times_index: Optional[str] = Field(
None, description="""Index into the spike_times dataset.""" None, description="""Index into the spike_times dataset."""
@ -422,7 +400,6 @@ class UnitsSpikeTimesIndex(VectorIndex):
Index into the spike_times dataset. Index into the spike_times dataset.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["spike_times_index"] = Field("spike_times_index") name: Literal["spike_times_index"] = Field("spike_times_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -446,7 +423,6 @@ class UnitsSpikeTimes(VectorData):
Spike times for each unit. Spike times for each unit.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["spike_times"] = Field("spike_times") name: Literal["spike_times"] = Field("spike_times")
resolution: Optional[float] = Field( resolution: Optional[float] = Field(
None, None,
@ -470,7 +446,6 @@ class UnitsObsIntervalsIndex(VectorIndex):
Index into the obs_intervals dataset. Index into the obs_intervals dataset.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["obs_intervals_index"] = Field("obs_intervals_index") name: Literal["obs_intervals_index"] = Field("obs_intervals_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -494,7 +469,6 @@ class UnitsElectrodesIndex(VectorIndex):
Index into electrodes. Index into electrodes.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes_index"] = Field("electrodes_index") name: Literal["electrodes_index"] = Field("electrodes_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -518,7 +492,6 @@ class UnitsElectrodes(DynamicTableRegion):
Electrode that each spike unit came from, specified using a DynamicTableRegion. Electrode that each spike unit came from, specified using a DynamicTableRegion.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["electrodes"] = Field("electrodes") name: Literal["electrodes"] = Field("electrodes")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -542,7 +515,6 @@ class UnitsWaveformsIndex(VectorIndex):
Index into the waveforms dataset. One value for every spike event. See 'waveforms' for more detail. Index into the waveforms dataset. One value for every spike event. See 'waveforms' for more detail.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["waveforms_index"] = Field("waveforms_index") name: Literal["waveforms_index"] = Field("waveforms_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -566,7 +538,6 @@ class UnitsWaveformsIndexIndex(VectorIndex):
Index into the waveforms_index dataset. One value for every unit (row in the table). See 'waveforms' for more detail. Index into the waveforms_index dataset. One value for every unit (row in the table). See 'waveforms' for more detail.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["waveforms_index_index"] = Field("waveforms_index_index") name: Literal["waveforms_index_index"] = Field("waveforms_index_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -583,23 +554,3 @@ class UnitsWaveformsIndexIndex(VectorIndex):
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any],
] ]
] = Field(None) ] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
AbstractFeatureSeries.model_rebuild()
AbstractFeatureSeriesData.model_rebuild()
AnnotationSeries.model_rebuild()
IntervalSeries.model_rebuild()
DecompositionSeries.model_rebuild()
DecompositionSeriesData.model_rebuild()
DecompositionSeriesSourceChannels.model_rebuild()
DecompositionSeriesBands.model_rebuild()
Units.model_rebuild()
UnitsSpikeTimesIndex.model_rebuild()
UnitsSpikeTimes.model_rebuild()
UnitsObsIntervalsIndex.model_rebuild()
UnitsElectrodesIndex.model_rebuild()
UnitsElectrodes.model_rebuild()
UnitsWaveformsIndex.model_rebuild()
UnitsWaveformsIndexIndex.model_rebuild()

View file

@ -29,9 +29,9 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeriesSync, TimeSeriesSync,
TimeSeries,
NWBContainer, NWBContainer,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeries,
) )
@ -40,13 +40,6 @@ version = "2.4.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -66,18 +59,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class OptogeneticSeries(TimeSeries): class OptogeneticSeries(TimeSeries):
""" """
An optogenetic stimulus. An optogenetic stimulus.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: NDArray[Shape["* num_times"], float] = Field( data: NDArray[Shape["* num_times"], float] = Field(
..., description="""Applied power for optogenetic stimulus, in watts.""" ..., description="""Applied power for optogenetic stimulus, in watts."""
@ -116,7 +102,6 @@ class OptogeneticStimulusSite(NWBContainer):
A site of optogenetic stimulation. A site of optogenetic stimulation.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: str = Field(..., description="""Description of stimulation site.""") description: str = Field(..., description="""Description of stimulation site.""")
excitation_lambda: float = Field( excitation_lambda: float = Field(
@ -126,9 +111,3 @@ class OptogeneticStimulusSite(NWBContainer):
..., ...,
description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""", description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
OptogeneticSeries.model_rebuild()
OptogeneticStimulusSite.model_rebuild()

View file

@ -28,18 +28,18 @@ if TYPE_CHECKING:
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeries,
TimeSeriesSync,
NWBDataInterface,
TimeSeriesStartingTime,
NWBContainer, NWBContainer,
TimeSeriesSync,
TimeSeriesStartingTime,
NWBDataInterface,
TimeSeries,
) )
from ...hdmf_common.v1_5_0.hdmf_common_table import ( from ...hdmf_common.v1_5_0.hdmf_common_table import (
DynamicTableRegion, DynamicTableRegion,
VectorIndex,
DynamicTable, DynamicTable,
VectorData, VectorData,
VectorIndex,
) )
from .core_nwb_image import ImageSeries, ImageSeriesExternalFile from .core_nwb_image import ImageSeries, ImageSeriesExternalFile
@ -50,13 +50,6 @@ version = "2.4.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -76,18 +69,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class TwoPhotonSeries(ImageSeries): class TwoPhotonSeries(ImageSeries):
""" """
Image stack recorded over time from 2-photon microscope. Image stack recorded over time from 2-photon microscope.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""") pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""")
scan_line_rate: Optional[float] = Field( scan_line_rate: Optional[float] = Field(
@ -155,7 +141,6 @@ class RoiResponseSeries(TimeSeries):
ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
data: Union[ data: Union[
NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times"], float],
@ -199,7 +184,6 @@ class RoiResponseSeriesRois(DynamicTableRegion):
DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries. DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["rois"] = Field("rois") name: Literal["rois"] = Field("rois")
table: Optional[str] = Field( table: Optional[str] = Field(
None, None,
@ -223,7 +207,6 @@ class DfOverF(NWBDataInterface):
dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes). dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field( children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -235,7 +218,6 @@ class Fluorescence(NWBDataInterface):
Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes). Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field( children: Optional[List[RoiResponseSeries] | RoiResponseSeries] = Field(
default_factory=dict default_factory=dict
) )
@ -247,7 +229,6 @@ class ImageSegmentation(NWBDataInterface):
Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them. Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[PlaneSegmentation] | PlaneSegmentation] = Field( children: Optional[List[PlaneSegmentation] | PlaneSegmentation] = Field(
default_factory=dict default_factory=dict
) )
@ -259,7 +240,6 @@ class PlaneSegmentation(DynamicTable):
Results from image segmentation of a specific imaging plane. Results from image segmentation of a specific imaging plane.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
image_mask: Optional[ image_mask: Optional[
Union[ Union[
@ -310,7 +290,6 @@ class PlaneSegmentationPixelMaskIndex(VectorIndex):
Index into pixel_mask. Index into pixel_mask.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["pixel_mask_index"] = Field("pixel_mask_index") name: Literal["pixel_mask_index"] = Field("pixel_mask_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -334,7 +313,6 @@ class PlaneSegmentationPixelMask(VectorData):
Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["pixel_mask"] = Field("pixel_mask") name: Literal["pixel_mask"] = Field("pixel_mask")
x: Optional[int] = Field(None, description="""Pixel x-coordinate.""") x: Optional[int] = Field(None, description="""Pixel x-coordinate.""")
y: Optional[int] = Field(None, description="""Pixel y-coordinate.""") y: Optional[int] = Field(None, description="""Pixel y-coordinate.""")
@ -357,7 +335,6 @@ class PlaneSegmentationVoxelMaskIndex(VectorIndex):
Index into voxel_mask. Index into voxel_mask.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["voxel_mask_index"] = Field("voxel_mask_index") name: Literal["voxel_mask_index"] = Field("voxel_mask_index")
target: Optional[str] = Field( target: Optional[str] = Field(
None, None,
@ -381,7 +358,6 @@ class PlaneSegmentationVoxelMask(VectorData):
Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["voxel_mask"] = Field("voxel_mask") name: Literal["voxel_mask"] = Field("voxel_mask")
x: Optional[int] = Field(None, description="""Voxel x-coordinate.""") x: Optional[int] = Field(None, description="""Voxel x-coordinate.""")
y: Optional[int] = Field(None, description="""Voxel y-coordinate.""") y: Optional[int] = Field(None, description="""Voxel y-coordinate.""")
@ -405,7 +381,6 @@ class ImagingPlane(NWBContainer):
An imaging plane and its metadata. An imaging plane and its metadata.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[OpticalChannel] | OpticalChannel] = Field( children: Optional[List[OpticalChannel] | OpticalChannel] = Field(
default_factory=dict default_factory=dict
) )
@ -417,7 +392,6 @@ class OpticalChannel(NWBContainer):
An optical channel used to record from an imaging plane. An optical channel used to record from an imaging plane.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
description: str = Field( description: str = Field(
..., description="""Description or other notes about the channel.""" ..., description="""Description or other notes about the channel."""
@ -432,7 +406,6 @@ class MotionCorrection(NWBDataInterface):
An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions). An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
children: Optional[List[CorrectedImageStack] | CorrectedImageStack] = Field( children: Optional[List[CorrectedImageStack] | CorrectedImageStack] = Field(
default_factory=dict default_factory=dict
) )
@ -444,7 +417,6 @@ class CorrectedImageStack(NWBDataInterface):
Reuslts from motion correction of an image stack. Reuslts from motion correction of an image stack.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field(...) name: str = Field(...)
corrected: str = Field( corrected: str = Field(
..., ...,
@ -454,22 +426,3 @@ class CorrectedImageStack(NWBDataInterface):
..., ...,
description="""Stores the x,y delta necessary to align each frame to the common coordinates, for example, to align each frame to a reference image.""", description="""Stores the x,y delta necessary to align each frame to the common coordinates, for example, to align each frame to a reference image.""",
) )
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
TwoPhotonSeries.model_rebuild()
RoiResponseSeries.model_rebuild()
RoiResponseSeriesRois.model_rebuild()
DfOverF.model_rebuild()
Fluorescence.model_rebuild()
ImageSegmentation.model_rebuild()
PlaneSegmentation.model_rebuild()
PlaneSegmentationPixelMaskIndex.model_rebuild()
PlaneSegmentationPixelMask.model_rebuild()
PlaneSegmentationVoxelMaskIndex.model_rebuild()
PlaneSegmentationVoxelMask.model_rebuild()
ImagingPlane.model_rebuild()
OpticalChannel.model_rebuild()
MotionCorrection.model_rebuild()
CorrectedImageStack.model_rebuild()

View file

@ -35,13 +35,6 @@ version = "2.4.0"
class ConfiguredBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
arbitrary_types_allowed=True,
use_enum_values=True,
)
hdf5_path: Optional[str] = Field( hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file" None, description="The absolute path that this object is stored in an NWB file"
) )
@ -61,18 +54,11 @@ class ConfiguredBaseModel(BaseModel):
super().__setitem__(i, value) super().__setitem__(i, value)
class LinkML_Meta(BaseModel):
"""Extra LinkML Metadata stored as a class attribute"""
tree_root: bool = False
class ImagingRetinotopy(NWBDataInterface): class ImagingRetinotopy(NWBDataInterface):
""" """
Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. This group does not store the raw responses imaged during retinotopic mapping or the stimuli presented, but rather the resulting phase and power maps after applying a Fourier transform on the averaged responses. Note: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x). Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. This group does not store the raw responses imaged during retinotopic mapping or the stimuli presented, but rather the resulting phase and power maps after applying a Fourier transform on the averaged responses. Note: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x).
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(tree_root=True), frozen=True)
name: str = Field("ImagingRetinotopy") name: str = Field("ImagingRetinotopy")
axis_1_phase_map: str = Field( axis_1_phase_map: str = Field(
..., description="""Phase response to stimulus on the first measured axis.""" ..., description="""Phase response to stimulus on the first measured axis."""
@ -111,7 +97,6 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel):
Phase response to stimulus on the first measured axis. Phase response to stimulus on the first measured axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_1_phase_map"] = Field("axis_1_phase_map") name: Literal["axis_1_phase_map"] = Field("axis_1_phase_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -131,7 +116,6 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel):
Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_1_power_map"] = Field("axis_1_power_map") name: Literal["axis_1_power_map"] = Field("axis_1_power_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -151,7 +135,6 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel):
Phase response to stimulus on the second measured axis. Phase response to stimulus on the second measured axis.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_2_phase_map"] = Field("axis_2_phase_map") name: Literal["axis_2_phase_map"] = Field("axis_2_phase_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -171,7 +154,6 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel):
Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["axis_2_power_map"] = Field("axis_2_power_map") name: Literal["axis_2_power_map"] = Field("axis_2_power_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -191,7 +173,6 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel):
Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns]. Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["focal_depth_image"] = Field("focal_depth_image") name: Literal["focal_depth_image"] = Field("focal_depth_image")
bits_per_pixel: Optional[int] = Field( bits_per_pixel: Optional[int] = Field(
None, None,
@ -218,7 +199,6 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel):
Sine of the angle between the direction of the gradient in axis_1 and axis_2. Sine of the angle between the direction of the gradient in axis_1 and axis_2.
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["sign_map"] = Field("sign_map") name: Literal["sign_map"] = Field("sign_map")
dimension: Optional[int] = Field( dimension: Optional[int] = Field(
None, None,
@ -235,7 +215,6 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel):
Gray-scale anatomical image of cortical surface. Array structure: [rows][columns] Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]
""" """
linkml_meta: ClassVar[LinkML_Meta] = Field(LinkML_Meta(), frozen=True)
name: Literal["vasculature_image"] = Field("vasculature_image") name: Literal["vasculature_image"] = Field("vasculature_image")
bits_per_pixel: Optional[int] = Field( bits_per_pixel: Optional[int] = Field(
None, None,
@ -252,15 +231,3 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel):
None, description="""Format of image. Right now only 'raw' is supported.""" None, description="""Format of image. Right now only 'raw' is supported."""
) )
array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field(None) array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ImagingRetinotopy.model_rebuild()
ImagingRetinotopyAxis1PhaseMap.model_rebuild()
ImagingRetinotopyAxis1PowerMap.model_rebuild()
ImagingRetinotopyAxis2PhaseMap.model_rebuild()
ImagingRetinotopyAxis2PowerMap.model_rebuild()
ImagingRetinotopyFocalDepthImage.model_rebuild()
ImagingRetinotopySignMap.model_rebuild()
ImagingRetinotopyVasculatureImage.model_rebuild()

Some files were not shown because too many files have changed in this diff Show more