diff --git a/nwb_linkml/src/nwb_linkml/adapters/adapter.py b/nwb_linkml/src/nwb_linkml/adapters/adapter.py index 2e49965..a7d0523 100644 --- a/nwb_linkml/src/nwb_linkml/adapters/adapter.py +++ b/nwb_linkml/src/nwb_linkml/adapters/adapter.py @@ -119,7 +119,7 @@ class Adapter(BaseModel): Convenience wrapper around :meth:`.walk_field_values` """ - return next(self.walk_field_values(self, 'neurodata_type_def', name)) + return next(self.walk_field_values(self, "neurodata_type_def", name)) def get_model_with_field(self, field: str) -> Generator[Union[Group, Dataset], None, None]: """ diff --git a/nwb_linkml/src/nwb_linkml/adapters/dataset.py b/nwb_linkml/src/nwb_linkml/adapters/dataset.py index 71900e0..547e00f 100644 --- a/nwb_linkml/src/nwb_linkml/adapters/dataset.py +++ b/nwb_linkml/src/nwb_linkml/adapters/dataset.py @@ -1,12 +1,11 @@ """ Adapter for NWB datasets to linkml Classes """ + from abc import abstractmethod from typing import ClassVar, Optional, Type -from linkml_runtime.linkml_model.meta import ( - SlotDefinition, ArrayExpression -) +from linkml_runtime.linkml_model.meta import ArrayExpression, SlotDefinition from nwb_linkml.adapters.adapter import BuildResult from nwb_linkml.adapters.array import ArrayAdapter @@ -276,7 +275,7 @@ class MapListlike(DatasetMap): """ dtype = ClassAdapter.handle_dtype(cls.dtype) return ( - not cls.neurodata_type_inc != 'VectorData' + cls.neurodata_type_inc != "VectorData" and is_1d(cls) and dtype != "AnyType" and dtype not in flat_to_linkml @@ -383,7 +382,7 @@ class MapArraylike(DatasetMap): dtype = ClassAdapter.handle_dtype(cls.dtype) return ( cls.name - and (all([cls.dims, cls.shape]) or cls.neurodata_type_inc == 'VectorData') + and (all([cls.dims, cls.shape]) or cls.neurodata_type_inc == "VectorData") and not has_attrs(cls) and not is_compound(cls) and dtype in flat_to_linkml @@ -398,7 +397,9 @@ class MapArraylike(DatasetMap): """ if cls.neurodata_type_inc == "VectorData" and not (cls.dims and cls.shape): expressions = { - "array": ArrayExpression(minimum_number_dimensions=1, maximum_number_dimensions=False) + "array": ArrayExpression( + minimum_number_dimensions=1, maximum_number_dimensions=False + ) } else: array_adapter = ArrayAdapter(cls.dims, cls.shape) @@ -545,6 +546,7 @@ class MapClassRange(DatasetMap): Datasets that are a simple named reference to another type without any additional modification to that type. """ + @classmethod def check(c, cls: Dataset) -> bool: """ @@ -572,7 +574,7 @@ class MapClassRange(DatasetMap): name=cls.name, description=cls.doc, range=f"{cls.neurodata_type_inc}", - annotations=[{'named': True}], + annotations=[{"named": True}], **QUANTITY_MAP[cls.quantity], ) res = BuildResult(slots=[this_slot]) @@ -583,6 +585,7 @@ class MapClassRange(DatasetMap): # DynamicTable special cases # -------------------------------------------------- + class MapVectorClassRange(DatasetMap): """ Map a ``VectorData`` class that is a reference to another class as simply @@ -591,6 +594,10 @@ class MapVectorClassRange(DatasetMap): @classmethod def check(c, cls: Dataset) -> bool: + """ + Check that we are a VectorData object without any additional attributes + with a dtype that refers to another class + """ dtype = ClassAdapter.handle_dtype(cls.dtype) return ( cls.neurodata_type_inc == "VectorData" @@ -605,6 +612,9 @@ class MapVectorClassRange(DatasetMap): def apply( c, cls: Dataset, res: Optional[BuildResult] = None, name: Optional[str] = None ) -> BuildResult: + """ + Create a slot that replaces the base class just as a list[ClassRef] + """ this_slot = SlotDefinition( name=cls.name, description=cls.doc, diff --git a/nwb_linkml/src/nwb_linkml/generators/pydantic.py b/nwb_linkml/src/nwb_linkml/generators/pydantic.py index 89e117b..188c422 100644 --- a/nwb_linkml/src/nwb_linkml/generators/pydantic.py +++ b/nwb_linkml/src/nwb_linkml/generators/pydantic.py @@ -156,6 +156,7 @@ class AfterGenerateSlot: """ Container class for slot-modification methods """ + @staticmethod def skip_meta(slot: SlotResult, skip_meta: tuple[str]) -> SlotResult: for key in skip_meta: @@ -195,7 +196,7 @@ class AfterGenerateSlot: When a slot has a ``named`` annotation, wrap it in :class:`.Named` """ - if 'named' in slot.source.annotations and slot.source.annotations['named'].value: + if "named" in slot.source.annotations and slot.source.annotations["named"].value: slot.attribute.range = f"Named[{slot.attribute.range}]" named_injects = [ModelTypeString, _get_name, NamedString] if slot.injected_classes is None: @@ -208,6 +209,7 @@ class AfterGenerateSlot: slot.imports = NamedImports return slot + def compile_python( text_or_fn: str, package_path: Path = None, module_name: str = "test" ) -> ModuleType: diff --git a/nwb_linkml/src/nwb_linkml/includes/__init__.py b/nwb_linkml/src/nwb_linkml/includes/__init__.py index e69de29..db4318f 100644 --- a/nwb_linkml/src/nwb_linkml/includes/__init__.py +++ b/nwb_linkml/src/nwb_linkml/includes/__init__.py @@ -0,0 +1,3 @@ +""" +Classes to inject into generated pydantic modules +""" diff --git a/nwb_linkml/src/nwb_linkml/includes/hdmf.py b/nwb_linkml/src/nwb_linkml/includes/hdmf.py index 4b07ca5..32647e7 100644 --- a/nwb_linkml/src/nwb_linkml/includes/hdmf.py +++ b/nwb_linkml/src/nwb_linkml/includes/hdmf.py @@ -2,12 +2,17 @@ Special types for mimicking HDMF special case behavior """ -from typing import Optional -from pydantic import BaseModel, ConfigDict, model_validator +from typing import Any + +from pydantic import BaseModel, ConfigDict class DynamicTableMixin(BaseModel): - model_config = ConfigDict(extra='allow') + """ + Mixin to make DynamicTable subclasses behave like tables/dataframes + """ + + model_config = ConfigDict(extra="allow") # @model_validator(mode='after') # def ensure_equal_length(cls, model: 'DynamicTableMixin') -> 'DynamicTableMixin': @@ -23,15 +28,12 @@ class DynamicTableMixin(BaseModel): # """ # raise NotImplementedError('TODO') - def __getitem__(self, item): - raise NotImplementedError('TODO') + def __getitem__(self, item: str) -> Any: + raise NotImplementedError("TODO") - def __setitem__(self, key, value): - raise NotImplementedError('TODO') - - - -class VectorDataMixin(BaseModel): - index: Optional[BaseModel] = None + def __setitem__(self, key: str, value: Any) -> None: + raise NotImplementedError("TODO") +# class VectorDataMixin(BaseModel): +# index: Optional[BaseModel] = None diff --git a/nwb_linkml/src/nwb_linkml/includes/types.py b/nwb_linkml/src/nwb_linkml/includes/types.py index 5c63de4..049aa65 100644 --- a/nwb_linkml/src/nwb_linkml/includes/types.py +++ b/nwb_linkml/src/nwb_linkml/includes/types.py @@ -6,25 +6,28 @@ Used to customize behavior of pydantic classes either to match pynwb behavior or reduce the verbosity of the generated models with convenience classes. """ -from pydantic import BaseModel, ValidationInfo, BeforeValidator -from typing import Annotated, TypeVar, Type +from typing import Annotated, Type, TypeVar, Union -from linkml.generators.pydanticgen.template import Imports, Import, ObjectImport +from linkml.generators.pydanticgen.template import Import, Imports, ObjectImport +from pydantic import BaseModel, BeforeValidator, ValidationInfo ModelType = TypeVar("ModelType", bound=Type[BaseModel]) # inspect.getsource() doesn't work for typevars because everything in the typing module # doesn't behave like a normal python object ModelTypeString = """ModelType = TypeVar("ModelType", bound=Type[BaseModel])""" -def _get_name(item: BaseModel | dict, info: ValidationInfo): + +def _get_name(item: ModelType | dict, info: ValidationInfo) -> Union[ModelType, dict]: + """Get the name of the slot that refers to this object""" assert isinstance(item, (BaseModel, dict)) name = info.field_name if isinstance(item, BaseModel): item.name = name else: - item['name'] = name + item["name"] = name return item + Named = Annotated[ModelType, BeforeValidator(_get_name)] """ Generic annotated type that sets the ``name`` field of a model @@ -44,7 +47,19 @@ Examples: """ NamedString = """Named = Annotated[ModelType, BeforeValidator(_get_name)]""" -NamedImports = Imports(imports=[ - Import(module="typing", objects=[ObjectImport(name="Annotated"),ObjectImport(name="Type"), ObjectImport(name="TypeVar"), ]), - Import(module="pydantic", objects=[ObjectImport(name="ValidationInfo"), ObjectImport(name="BeforeValidator")]) -]) \ No newline at end of file +NamedImports = Imports( + imports=[ + Import( + module="typing", + objects=[ + ObjectImport(name="Annotated"), + ObjectImport(name="Type"), + ObjectImport(name="TypeVar"), + ], + ), + Import( + module="pydantic", + objects=[ObjectImport(name="ValidationInfo"), ObjectImport(name="BeforeValidator")], + ), + ] +) diff --git a/nwb_linkml/src/nwb_linkml/models/__init__.py b/nwb_linkml/src/nwb_linkml/models/__init__.py index 97cb846..fa3cf1e 100644 --- a/nwb_linkml/src/nwb_linkml/models/__init__.py +++ b/nwb_linkml/src/nwb_linkml/models/__init__.py @@ -1 +1 @@ -from .pydantic.core.v2_7_0.namespace import * \ No newline at end of file +from .pydantic.core.v2_7_0.namespace import * diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/__init__.py index 0519ecb..e69de29 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/__init__.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/__init__.py @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/__init__.py index 8d1c8b6..8b13789 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/__init__.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/__init__.py @@ -1 +1 @@ - + diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_base.py index 60ac1a0..517ed29 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_base.py @@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,7 +81,9 @@ class NWBData(Data): An abstract data type for a dataset. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -89,7 +93,9 @@ 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)). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -110,7 +116,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -120,7 +128,9 @@ class NWBDataInterface(NWBContainer): An abstract data type for a generic container storing collections of data, as opposed to metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -130,7 +140,9 @@ class TimeSeries(NWBDataInterface): General purpose time series. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of the time series.""") @@ -159,7 +171,9 @@ class TimeSeries(NWBDataInterface): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -175,7 +189,8 @@ class TimeSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) conversion: Optional[np.float32] = Field( None, @@ -208,10 +223,14 @@ class TimeSeriesStartingTime(ConfiguredBaseModel): name: Literal["starting_time"] = Field( "starting_time", - json_schema_extra={"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"} + }, ) rate: Optional[np.float32] = Field(None, description="""Sampling rate, in Hz.""") - unit: Optional[str] = Field(None, description="""Unit of measurement for time, which is fixed to 'seconds'.""") + unit: Optional[str] = Field( + None, description="""Unit of measurement for time, which is fixed to 'seconds'.""" + ) value: np.float64 = Field(...) @@ -223,7 +242,8 @@ class TimeSeriesSync(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"}) name: Literal["sync"] = Field( - "sync", json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}} + "sync", + json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}}, ) @@ -232,10 +252,15 @@ class ProcessingModule(NWBContainer): A collection of processed data. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) children: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field( - None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}} + None, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]} + }, ) name: str = Field(...) @@ -245,10 +270,14 @@ class Images(NWBDataInterface): A collection of images. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field("Images", json_schema_extra={"linkml_meta": {"ifabsent": "string(Images)"}}) - description: Optional[str] = Field(None, description="""Description of this collection of images.""") + description: Optional[str] = Field( + None, description="""Description of this collection of images.""" + ) image: List[Image] = Field(..., description="""Images stored in this collection.""") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_behavior.py index 7f6167e..cd96ce2 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_behavior.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_behavior.py @@ -44,7 +44,12 @@ from ...core.v2_2_0.core_nwb_base import ( ProcessingModule, Images, ) -from ...hdmf_common.v1_1_0.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_0.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_0.hdmf_common_table import ( Data, Index, @@ -70,7 +75,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -126,11 +133,14 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) name: str = Field(...) data: SpatialSeriesData = Field( - ..., description="""1-D or 2-D array storing position or direction relative to some reference frame.""" + ..., + description="""1-D or 2-D array storing position or direction relative to some reference frame.""", ) reference_frame: Optional[str] = Field( None, description="""Description defining what exactly 'straight-ahead' means.""" @@ -157,7 +167,9 @@ class SpatialSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -173,14 +185,18 @@ class SpatialSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, description="""Base unit of measurement for working with the data. The default value is 'meters'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) array: Optional[ - Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]] + Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_features"], np.number], + ] ] = Field(None) @@ -189,7 +205,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[IntervalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "IntervalSeries"}]}} @@ -202,7 +220,9 @@ class BehavioralEvents(NWBDataInterface): TimeSeries for storing behavioral events. See description of BehavioralEpochs for more details. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -215,7 +235,9 @@ class BehavioralTimeSeries(NWBDataInterface): TimeSeries for storing Behavoioral time series data. See description of BehavioralEpochs for more details. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -228,7 +250,9 @@ class PupilTracking(NWBDataInterface): Eye-tracking data, representing pupil size. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -241,7 +265,9 @@ class EyeTracking(NWBDataInterface): Eye-tracking data, representing direction of gaze. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} @@ -254,7 +280,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} @@ -267,7 +295,9 @@ class Position(NWBDataInterface): Position data, whether along the x, x/y or x/y/z axis. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_device.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_device.py index 419a32e..1d43d1b 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_device.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_device.py @@ -22,7 +22,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -62,14 +64,18 @@ class Device(NWBContainer): Metadata about a data acquisition device, e.g., recording system, electrode, microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.device", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.device", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field( None, description="""Description of the device (e.g., model, firmware version, processing software version, etc.) as free-form text.""", ) - manufacturer: Optional[str] = Field(None, description="""The name of the manufacturer of the device.""") + manufacturer: Optional[str] = Field( + None, description="""The name of the manufacturer of the device.""" + ) # Model rebuild diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ecephys.py index d5ff3c3..009acb6 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ecephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ecephys.py @@ -7,7 +7,15 @@ import sys import numpy as np from ...hdmf_common.v1_1_0.hdmf_common_table import DynamicTableRegion from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from ...core.v2_2_0.core_nwb_base import ( TimeSeries, TimeSeriesStartingTime, @@ -30,7 +38,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -75,7 +85,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.ecephys/", "id": "core.nwb.ecephys", - "imports": ["core.nwb.base", "../../hdmf_common/v1_1_0/namespace", "core.nwb.device", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "../../hdmf_common/v1_1_0/namespace", + "core.nwb.device", + "core.nwb.language", + ], "name": "core.nwb.ecephys", } ) @@ -86,7 +101,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) data: Union[ @@ -97,7 +114,9 @@ class ElectricalSeries(TimeSeries): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( None, @@ -126,7 +145,9 @@ class ElectricalSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -139,7 +160,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) data: Union[ @@ -154,7 +177,9 @@ class SpikeEventSeries(ElectricalSeries): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( None, @@ -178,7 +203,9 @@ class SpikeEventSeries(ElectricalSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -191,9 +218,14 @@ class FeatureExtraction(NWBDataInterface): Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("FeatureExtraction", json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}}) + name: str = Field( + "FeatureExtraction", + json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}}, + ) description: NDArray[Shape["* num_features"], str] = Field( ..., description="""Description of features (eg, ''PC1'') for each of the extracted features.""", @@ -204,7 +236,13 @@ class FeatureExtraction(NWBDataInterface): description="""Multi-dimensional array of features extracted from each event.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_events"}, {"alias": "num_channels"}, {"alias": "num_features"}]} + "array": { + "dimensions": [ + {"alias": "num_events"}, + {"alias": "num_channels"}, + {"alias": "num_features"}, + ] + } } }, ) @@ -216,7 +254,9 @@ class FeatureExtraction(NWBDataInterface): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) @@ -225,9 +265,13 @@ class EventDetection(NWBDataInterface): Detected spike events from voltage trace(s). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}}) + name: str = Field( + "EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}} + ) detection_method: str = Field( ..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""", @@ -249,7 +293,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[SpikeEventSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpikeEventSeries"}]}} @@ -262,7 +308,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[ElectricalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}} @@ -275,7 +323,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[ElectricalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}} @@ -288,7 +338,9 @@ class ElectrodeGroup(NWBContainer): A physical grouping of electrodes, e.g. a shank of an array. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of this electrode group.""") @@ -309,7 +361,10 @@ class ElectrodeGroupPosition(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"}) name: Literal["position"] = Field( - "position", json_schema_extra={"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}} + "position", + json_schema_extra={ + "linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"} + }, ) x: Optional[np.float32] = Field(None, description="""x coordinate""") y: Optional[np.float32] = Field(None, description="""y coordinate""") @@ -321,22 +376,33 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("ClusterWaveforms", json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}}) - waveform_filtering: str = Field(..., description="""Filtering applied to data before generating mean/sd""") + name: str = Field( + "ClusterWaveforms", + json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}}, + ) + waveform_filtering: str = Field( + ..., description="""Filtering applied to data before generating mean/sd""" + ) waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( ..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]} + } }, ) waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( ..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]} + } }, ) @@ -346,9 +412,13 @@ class Clustering(NWBDataInterface): DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}}) + name: str = Field( + "Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}} + ) description: str = Field( ..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_epoch.py index 06fd2ef..0422862 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_epoch.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_epoch.py @@ -6,7 +6,15 @@ import re import sys import numpy as np from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape from ...hdmf_common.v1_1_0.hdmf_common_table import DynamicTable, VectorIndex, VectorData from ...core.v2_2_0.core_nwb_base import TimeSeries @@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -80,52 +90,70 @@ class TimeIntervals(DynamicTable): A container for aggregating epoch data and the TimeSeries that each epoch applies to. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.epoch", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.epoch", "tree_root": True} + ) name: str = Field(...) start_time: NDArray[Any, np.float32] = Field( ..., description="""Start time of epoch, in seconds.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) stop_time: NDArray[Any, np.float32] = Field( ..., description="""Stop time of epoch, in seconds.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) tags: Optional[NDArray[Any, str]] = Field( None, description="""User-defined tags that identify or categorize events.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) tags_index: Named[Optional[VectorIndex]] = Field( None, description="""Index for tags.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, + ) + timeseries: Optional[TimeIntervalsTimeseries] = Field( + None, description="""An index into a TimeSeries object.""" ) - timeseries: Optional[TimeIntervalsTimeseries] = Field(None, description="""An index into a TimeSeries object.""") timeseries_index: Named[Optional[VectorIndex]] = Field( None, description="""Index for timeseries.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -140,17 +168,24 @@ class TimeIntervalsTimeseries(VectorData): name: Literal["timeseries"] = Field( "timeseries", - json_schema_extra={"linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"} + }, ) idx_start: Optional[np.int32] = Field( None, description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) count: Optional[np.int32] = Field( - None, description="""Number of data samples available in this time series, during this epoch.""" + None, + description="""Number of data samples available in this time series, during this epoch.""", + ) + timeseries: Optional[TimeSeries] = Field( + None, description="""the TimeSeries that this index applies to.""" + ) + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" ) - timeseries: Optional[TimeSeries] = Field(None, description="""the TimeSeries that this index applies to.""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") # Model rebuild diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_file.py index dd103a6..21cd7b7 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_file.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_file.py @@ -44,7 +44,12 @@ from ...core.v2_2_0.core_nwb_base import ( ProcessingModule, Images, ) -from ...hdmf_common.v1_1_0.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_0.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_0.hdmf_common_table import ( Data, Index, @@ -117,7 +122,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -184,10 +191,13 @@ class NWBFile(NWBContainer): An NWB:N file storing cellular-based neurophysiology data from a single experimental session. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: Literal["root"] = Field( - "root", json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}} + "root", + json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}}, ) nwb_version: Optional[str] = Field( None, @@ -196,7 +206,9 @@ class NWBFile(NWBContainer): file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = Field( ..., description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}} + }, ) identifier: str = Field( ..., @@ -216,17 +228,23 @@ class NWBFile(NWBContainer): acquisition: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field( None, description="""Data streams recorded from the system, including ephys, ophys, tracking, etc. This group should be read-only after the experiment is completed and timestamps are corrected to a common timebase. The data stored here may be links to raw data stored in external NWB files. This will allow keeping bulky raw data out of the file while preserving the option of keeping some/all in the file. Acquired data includes tracking and experimental data streams (i.e., everything measured from the system). If bulky data is stored in the /acquisition group, the data can exist in a separate NWB file that is linked to by the file being used for processing and analysis.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]} + }, ) analysis: Optional[List[Union[DynamicTable, NWBContainer]]] = Field( None, description="""Lab-specific and custom scientific analysis of data. There is no defined format for the content of this group - the format is up to the individual user/lab. To facilitate sharing analysis data between labs, the contents here should be stored in standard types (e.g., neurodata_types) and appropriately documented. The file can store lab-specific and custom data analysis without restriction on its form or schema, reducing data formatting restrictions on end users. Such data should be placed in the analysis group. The analysis data should be documented so that it could be shared with other labs.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]} + }, ) scratch: Optional[List[Union[DynamicTable, NWBContainer]]] = Field( None, description="""A place to store one-off analysis results. Data placed here is not intended for sharing. By placing data here, users acknowledge that there is no guarantee that their data meets any standard.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]} + }, ) processing: Optional[List[ProcessingModule]] = Field( None, @@ -266,7 +284,10 @@ class NWBFileStimulus(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["stimulus"] = Field( - "stimulus", json_schema_extra={"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}} + "stimulus", + json_schema_extra={ + "linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"} + }, ) presentation: Optional[List[TimeSeries]] = Field( None, @@ -288,16 +309,27 @@ class NWBFileGeneral(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["general"] = Field( - "general", json_schema_extra={"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}} + "general", + json_schema_extra={ + "linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"} + }, + ) + data_collection: Optional[str] = Field( + None, description="""Notes about data collection and analysis.""" + ) + experiment_description: Optional[str] = Field( + None, description="""General description of the experiment.""" ) - data_collection: Optional[str] = Field(None, description="""Notes about data collection and analysis.""") - experiment_description: Optional[str] = Field(None, description="""General description of the experiment.""") experimenter: Optional[NDArray[Shape["* num_experimenters"], str]] = Field( None, description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}} + }, + ) + institution: Optional[str] = Field( + None, description="""Institution(s) where experiment was performed.""" ) - institution: Optional[str] = Field(None, description="""Institution(s) where experiment was performed.""") keywords: Optional[NDArray[Shape["* num_keywords"], str]] = Field( None, description="""Terms to search over.""", @@ -310,12 +342,15 @@ class NWBFileGeneral(ConfiguredBaseModel): description="""Description of drugs used, including how and when they were administered. Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc.""", ) protocol: Optional[str] = Field( - None, description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""" + None, + description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""", ) related_publications: Optional[NDArray[Shape["* num_publications"], str]] = Field( None, description="""Publication information. PMID, DOI, URL, etc.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}} + }, ) session_id: Optional[str] = Field(None, description="""Lab-specific ID for the session.""") slices: Optional[str] = Field( @@ -323,7 +358,8 @@ class NWBFileGeneral(ConfiguredBaseModel): description="""Description of slices, including information about preparation thickness, orientation, temperature, and bath solution.""", ) source_script: Optional[NWBFileGeneralSourceScript] = Field( - None, description="""Script file or link to public source code used to create this NWB file.""" + None, + description="""Script file or link to public source code used to create this NWB file.""", ) stimulus: Optional[str] = Field( None, description="""Notes about stimuli, such as how and where they were presented.""" @@ -346,7 +382,8 @@ class NWBFileGeneral(ConfiguredBaseModel): json_schema_extra={"linkml_meta": {"any_of": [{"range": "Device"}]}}, ) subject: Optional[Subject] = Field( - None, description="""Information about the animal or person from which the data was measured.""" + None, + description="""Information about the animal or person from which the data was measured.""", ) extracellular_ephys: Optional[NWBFileGeneralExtracellularEphys] = Field( None, description="""Metadata related to extracellular electrophysiology.""" @@ -375,7 +412,9 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel): name: Literal["source_script"] = Field( "source_script", - json_schema_extra={"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"} + }, ) file_name: Optional[str] = Field(None, description="""Name of script file.""") value: str = Field(...) @@ -389,23 +428,33 @@ class Subject(NWBContainer): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["subject"] = Field( - "subject", json_schema_extra={"linkml_meta": {"equals_string": "subject", "ifabsent": "string(subject)"}} + "subject", + json_schema_extra={ + "linkml_meta": {"equals_string": "subject", "ifabsent": "string(subject)"} + }, + ) + age: Optional[str] = Field( + None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""" ) - age: Optional[str] = Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""") date_of_birth: Optional[np.datetime64] = Field( None, description="""Date of birth of subject. Can be supplied instead of 'age'.""" ) description: Optional[str] = Field( - None, description="""Description of subject and where subject came from (e.g., breeder, if animal).""" + None, + description="""Description of subject and where subject came from (e.g., breeder, if animal).""", + ) + genotype: Optional[str] = Field( + None, description="""Genetic strain. If absent, assume Wild Type (WT).""" ) - genotype: Optional[str] = Field(None, description="""Genetic strain. If absent, assume Wild Type (WT).""") sex: Optional[str] = Field(None, description="""Gender of subject.""") species: Optional[str] = Field(None, description="""Species of subject.""") subject_id: Optional[str] = Field( - None, description="""ID of animal/person used/participating in experiment (lab convention).""" + None, + description="""ID of animal/person used/participating in experiment (lab convention).""", ) weight: Optional[str] = Field( - None, description="""Weight at time of experiment, at time of surgery and at other important times.""" + None, + description="""Weight at time of experiment, at time of surgery and at other important times.""", ) @@ -419,10 +468,15 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel): name: Literal["extracellular_ephys"] = Field( "extracellular_ephys", json_schema_extra={ - "linkml_meta": {"equals_string": "extracellular_ephys", "ifabsent": "string(extracellular_ephys)"} + "linkml_meta": { + "equals_string": "extracellular_ephys", + "ifabsent": "string(extracellular_ephys)", + } }, ) - electrode_group: Optional[List[ElectrodeGroup]] = Field(None, description="""Physical group of electrodes.""") + electrode_group: Optional[List[ElectrodeGroup]] = Field( + None, description="""Physical group of electrodes.""" + ) electrodes: Optional[NWBFileGeneralExtracellularEphysElectrodes] = Field( None, description="""A table of all electrodes (i.e. channels) used for recording.""" ) @@ -437,48 +491,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): name: Literal["electrodes"] = Field( "electrodes", - json_schema_extra={"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"} + }, ) x: NDArray[Any, np.float32] = Field( ..., description="""x coordinate of the channel location in the brain (+x is posterior).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) y: NDArray[Any, np.float32] = Field( ..., description="""y coordinate of the channel location in the brain (+y is inferior).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) z: NDArray[Any, np.float32] = Field( ..., description="""z coordinate of the channel location in the brain (+z is right).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) imp: NDArray[Any, np.float32] = Field( ..., description="""Impedance of the channel.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) location: NDArray[Any, str] = Field( ..., description="""Location of the electrode (channel). 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.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) filtering: NDArray[Any, np.float32] = Field( ..., description="""Description of hardware filtering.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) group: List[ElectrodeGroup] = Field( @@ -488,48 +556,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): ..., description="""Name of the ElectrodeGroup this electrode is a part of.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_x: Optional[NDArray[Any, np.float32]] = Field( None, description="""x coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_y: Optional[NDArray[Any, np.float32]] = Field( None, description="""y coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_z: Optional[NDArray[Any, np.float32]] = Field( None, description="""z coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) reference: Optional[NDArray[Any, str]] = Field( None, description="""Description of the reference used for this electrode.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -545,7 +627,10 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel): name: Literal["intracellular_ephys"] = Field( "intracellular_ephys", json_schema_extra={ - "linkml_meta": {"equals_string": "intracellular_ephys", "ifabsent": "string(intracellular_ephys)"} + "linkml_meta": { + "equals_string": "intracellular_ephys", + "ifabsent": "string(intracellular_ephys)", + } }, ) filtering: Optional[str] = Field( diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_icephys.py index 9b18aa4..ec612cf 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_icephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_icephys.py @@ -5,7 +5,12 @@ from enum import Enum import re import sys import numpy as np -from ...hdmf_common.v1_1_0.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_0.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_0.hdmf_common_table import ( Data, Index, @@ -30,7 +35,15 @@ from ...core.v2_2_0.core_nwb_base import ( Images, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape metamodel_version = "None" @@ -46,7 +59,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -91,7 +106,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.icephys/", "id": "core.nwb.icephys", - "imports": ["core.nwb.base", "core.nwb.device", "../../hdmf_common/v1_1_0/namespace", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "core.nwb.device", + "../../hdmf_common/v1_1_0/namespace", + "core.nwb.language", + ], "name": "core.nwb.icephys", } ) @@ -102,7 +122,9 @@ class PatchClampSeries(TimeSeries): An abstract base class for patch-clamp data - stimulus or response, current or voltage. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) stimulus_description: Optional[str] = Field( @@ -113,7 +135,8 @@ class PatchClampSeries(TimeSeries): ) data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""") gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -137,7 +160,9 @@ class PatchClampSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -153,7 +178,8 @@ class PatchClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -169,13 +195,17 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""") bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""") - capacitance_compensation: Optional[np.float32] = Field(None, description="""Capacitance compensation, in farads.""") + capacitance_compensation: Optional[np.float32] = Field( + None, description="""Capacitance compensation, in farads.""" + ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) @@ -183,7 +213,8 @@ class CurrentClampSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -207,7 +238,9 @@ class CurrentClampSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -223,7 +256,8 @@ class CurrentClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -237,11 +271,15 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""") - bridge_balance: np.float32 = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + bridge_balance: np.float32 = Field( + ..., description="""Bridge balance, in ohms, fixed to 0.0.""" + ) capacitance_compensation: np.float32 = Field( ..., description="""Capacitance compensation, in farads, fixed to 0.0.""" ) @@ -253,7 +291,8 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -277,7 +316,9 @@ class IZeroClampSeries(CurrentClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -290,7 +331,9 @@ class CurrentClampStimulusSeries(PatchClampSeries): Stimulus current applied during current clamp recording. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: CurrentClampStimulusSeriesData = Field(..., description="""Stimulus current applied.""") @@ -301,7 +344,8 @@ class CurrentClampStimulusSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -325,7 +369,9 @@ class CurrentClampStimulusSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -341,7 +387,8 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -355,7 +402,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: VoltageClampSeriesData = Field(..., description="""Recorded current.""") @@ -377,8 +426,8 @@ class VoltageClampSeries(PatchClampSeries): whole_cell_capacitance_comp: Optional[VoltageClampSeriesWholeCellCapacitanceComp] = Field( None, description="""Whole cell capacitance compensation, in farads.""" ) - whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = Field( - None, description="""Whole cell series resistance compensation, in ohms.""" + whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = ( + Field(None, description="""Whole cell series resistance compensation, in ohms.""") ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" @@ -387,7 +436,8 @@ class VoltageClampSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -411,7 +461,9 @@ class VoltageClampSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -427,7 +479,8 @@ class VoltageClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -446,11 +499,15 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): name: Literal["capacitance_fast"] = Field( "capacitance_fast", json_schema_extra={ - "linkml_meta": {"equals_string": "capacitance_fast", "ifabsent": "string(capacitance_fast)"} + "linkml_meta": { + "equals_string": "capacitance_fast", + "ifabsent": "string(capacitance_fast)", + } }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -465,11 +522,15 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): name: Literal["capacitance_slow"] = Field( "capacitance_slow", json_schema_extra={ - "linkml_meta": {"equals_string": "capacitance_slow", "ifabsent": "string(capacitance_slow)"} + "linkml_meta": { + "equals_string": "capacitance_slow", + "ifabsent": "string(capacitance_slow)", + } }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -491,7 +552,8 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""" + None, + description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""", ) value: np.float32 = Field(...) @@ -513,7 +575,8 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""" + None, + description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""", ) value: np.float32 = Field(...) @@ -535,7 +598,8 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""" + None, + description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""", ) value: np.float32 = Field(...) @@ -557,7 +621,8 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -579,7 +644,8 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""" + None, + description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""", ) value: np.float32 = Field(...) @@ -589,7 +655,9 @@ class VoltageClampStimulusSeries(PatchClampSeries): Stimulus voltage applied during a voltage clamp recording. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: VoltageClampStimulusSeriesData = Field(..., description="""Stimulus voltage applied.""") @@ -600,7 +668,8 @@ class VoltageClampStimulusSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -624,7 +693,9 @@ class VoltageClampStimulusSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -640,7 +711,8 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -654,19 +726,27 @@ class IntracellularElectrode(NWBContainer): An intracellular electrode and its metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) - description: str = Field(..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""") + description: str = Field( + ..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""" + ) filtering: Optional[str] = Field(None, description="""Electrode specific filtering.""") - initial_access_resistance: Optional[str] = Field(None, description="""Initial access resistance.""") + initial_access_resistance: Optional[str] = Field( + None, description="""Initial access resistance.""" + ) location: Optional[str] = Field( None, description="""Location of the electrode. 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.""", ) resistance: Optional[str] = Field(None, description="""Electrode resistance, in ohms.""") seal: Optional[str] = Field(None, description="""Information about seal used for recording.""") - slice: Optional[str] = Field(None, description="""Information about slice used for recording.""") + slice: Optional[str] = Field( + None, description="""Information about slice used for recording.""" + ) class SweepTable(DynamicTable): @@ -674,14 +754,18 @@ class SweepTable(DynamicTable): The table which groups different PatchClampSeries together. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) sweep_number: NDArray[Any, np.uint32] = Field( ..., description="""Sweep number of the PatchClampSeries in that row.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) series: List[PatchClampSeries] = Field( @@ -690,19 +774,25 @@ class SweepTable(DynamicTable): series_index: Named[VectorIndex] = Field( ..., description="""Index for series.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_image.py index 35c993d..223b0b5 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_image.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_image.py @@ -19,7 +19,12 @@ from ...core.v2_2_0.core_nwb_base import ( ProcessingModule, Images, ) -from ...hdmf_common.v1_1_0.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_0.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_0.hdmf_common_table import ( Data, Index, @@ -45,7 +50,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -101,7 +108,9 @@ class GrayscaleImage(Image): A grayscale image. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -122,7 +131,9 @@ class RGBImage(Image): A color image. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -143,7 +154,9 @@ class RGBAImage(Image): A color image with transparency. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -164,11 +177,16 @@ 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]. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: Optional[ - Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] + Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] ] = Field(None, description="""Binary data representing images across frames.""") dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -205,7 +223,9 @@ class ImageSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -222,7 +242,9 @@ class ImageSeriesExternalFile(ConfiguredBaseModel): name: Literal["external_file"] = Field( "external_file", - json_schema_extra={"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"} + }, ) starting_frame: Optional[np.int32] = Field( None, @@ -238,11 +260,16 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: Optional[ - Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] + Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] ] = Field(None, description="""Binary data representing images across frames.""") dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -279,7 +306,9 @@ class ImageMaskSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -292,19 +321,29 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) - distance: Optional[np.float32] = Field(None, description="""Distance from camera/monitor to target/eye.""") + distance: Optional[np.float32] = Field( + None, description="""Distance from camera/monitor to target/eye.""" + ) field_of_view: Optional[ - Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]] + Union[ + NDArray[Shape["2 width_height"], np.float32], + NDArray[Shape["3 width_height_depth"], np.float32], + ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") orientation: Optional[str] = Field( None, description="""Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.""", ) data: Optional[ - Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] + Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] ] = Field(None, description="""Binary data representing images across frames.""") dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -341,7 +380,9 @@ class OpticalSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -354,7 +395,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.int32] = Field( @@ -384,7 +427,9 @@ class IndexSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_misc.py index b6959c0..612058d 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_misc.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_misc.py @@ -7,10 +7,23 @@ import sys import numpy as np from ...core.v2_2_0.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from ...core.v2_2_0.core_nwb_ecephys import ElectrodeGroup from numpydantic import NDArray, Shape -from ...hdmf_common.v1_1_0.hdmf_common_table import DynamicTable, VectorData, VectorIndex, DynamicTableRegion +from ...hdmf_common.v1_1_0.hdmf_common_table import ( + DynamicTable, + VectorData, + VectorIndex, + DynamicTableRegion, +) metamodel_version = "None" version = "2.2.0" @@ -25,7 +38,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -70,7 +85,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.misc/", "id": "core.nwb.misc", - "imports": ["core.nwb.base", "../../hdmf_common/v1_1_0/namespace", "core.nwb.ecephys", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "../../hdmf_common/v1_1_0/namespace", + "core.nwb.ecephys", + "core.nwb.language", + ], "name": "core.nwb.misc", } ) @@ -81,10 +101,14 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) - data: AbstractFeatureSeriesData = Field(..., description="""Values of each feature at each time.""") + data: AbstractFeatureSeriesData = Field( + ..., description="""Values of each feature at each time.""" + ) feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field( None, description="""Units of each feature.""", @@ -117,7 +141,9 @@ class AbstractFeatureSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -133,14 +159,18 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, description="""Since there can be different units for different features, store the units in 'feature_units'. The default value for this attribute is \"see 'feature_units'\".""", ) array: Optional[ - Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]] + Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_features"], np.number], + ] ] = Field(None) @@ -149,7 +179,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], str] = Field( @@ -179,7 +211,9 @@ class AnnotationSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -192,7 +226,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.int8] = Field( @@ -222,7 +258,9 @@ class IntervalSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -235,10 +273,14 @@ class DecompositionSeries(TimeSeries): Spectral analysis of a time series, e.g. of an LFP or a speech signal. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) - data: DecompositionSeriesData = Field(..., description="""Data decomposed into frequency bands.""") + data: DecompositionSeriesData = Field( + ..., description="""Data decomposed into frequency bands.""" + ) metric: str = Field(..., description="""The metric used, e.g. phase, amplitude, power.""") bands: DecompositionSeriesBands = Field( ..., @@ -266,7 +308,9 @@ class DecompositionSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -282,7 +326,8 @@ class DecompositionSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -292,7 +337,13 @@ class DecompositionSeriesData(ConfiguredBaseModel): None, json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_times"}, {"alias": "num_channels"}, {"alias": "num_bands"}]} + "array": { + "dimensions": [ + {"alias": "num_times"}, + {"alias": "num_channels"}, + {"alias": "num_bands"}, + ] + } } }, ) @@ -306,13 +357,16 @@ class DecompositionSeriesBands(DynamicTable): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["bands"] = Field( - "bands", json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}} + "bands", + json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}}, ) band_name: NDArray[Any, str] = Field( ..., description="""Name of the band, e.g. theta.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field( @@ -320,7 +374,12 @@ class DecompositionSeriesBands(DynamicTable): description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_bands"}, {"alias": "low_high", "exact_cardinality": 2}]} + "array": { + "dimensions": [ + {"alias": "num_bands"}, + {"alias": "low_high", "exact_cardinality": 2}, + ] + } } }, ) @@ -338,13 +397,17 @@ class DecompositionSeriesBands(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -355,38 +418,55 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field("Units", json_schema_extra={"linkml_meta": {"ifabsent": "string(Units)"}}) spike_times_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the spike_times dataset.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, + ) + spike_times: Optional[UnitsSpikeTimes] = Field( + None, description="""Spike times for each unit.""" ) - spike_times: Optional[UnitsSpikeTimes] = Field(None, description="""Spike times for each unit.""") obs_intervals_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the obs_intervals dataset.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field( None, description="""Observation intervals for each unit.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_intervals"}, {"alias": "start_end", "exact_cardinality": 2}]} + "array": { + "dimensions": [ + {"alias": "num_intervals"}, + {"alias": "start_end", "exact_cardinality": 2}, + ] + } } }, ) electrodes_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into electrodes.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) electrodes: Named[Optional[DynamicTableRegion]] = Field( None, description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) electrode_group: Optional[List[ElectrodeGroup]] = Field( None, description="""Electrode group that each spike unit came from.""" @@ -407,13 +487,17 @@ class Units(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -428,13 +512,17 @@ class UnitsSpikeTimes(VectorData): name: Literal["spike_times"] = Field( "spike_times", - json_schema_extra={"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"} + }, ) resolution: Optional[np.float64] = Field( None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""", ) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) # Model rebuild diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ogen.py index a503df3..a290f59 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ogen.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ogen.py @@ -8,7 +8,12 @@ from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator import numpy as np from numpydantic import NDArray, Shape -from ...core.v2_2_0.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync, NWBContainer +from ...core.v2_2_0.core_nwb_base import ( + TimeSeries, + TimeSeriesStartingTime, + TimeSeriesSync, + NWBContainer, +) metamodel_version = "None" version = "2.2.0" @@ -23,7 +28,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,7 +86,9 @@ class OptogeneticSeries(TimeSeries): An optogenetic stimulus. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ogen", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.number] = Field( @@ -109,7 +118,9 @@ class OptogeneticSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -122,7 +133,9 @@ class OptogeneticStimulusSite(NWBContainer): A site of optogenetic stimulation. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ogen", "tree_root": True} + ) name: str = Field(...) description: str = Field(..., description="""Description of stimulation site.""") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ophys.py index b1e3c4d..12d6cd1 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ophys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ophys.py @@ -18,7 +18,12 @@ from ...core.v2_2_0.core_nwb_base import ( ProcessingModule, Images, ) -from ...hdmf_common.v1_1_0.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_0.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_0.hdmf_common_table import ( Data, Index, @@ -40,7 +45,15 @@ from ...core.v2_2_0.core_nwb_image import ( IndexSeries, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape metamodel_version = "None" @@ -56,7 +69,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -118,7 +133,9 @@ class TwoPhotonSeries(ImageSeries): Image stack recorded over time from 2-photon microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") @@ -127,10 +144,16 @@ class TwoPhotonSeries(ImageSeries): description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) field_of_view: Optional[ - Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height"], np.float32]] + Union[ + NDArray[Shape["2 width_height"], np.float32], + NDArray[Shape["3 width_height"], np.float32], + ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Optional[ - Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] + Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] ] = Field(None, description="""Binary data representing images across frames.""") dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -167,7 +190,9 @@ class TwoPhotonSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -180,16 +205,21 @@ class RoiResponseSeries(TimeSeries): ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) - data: Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_rois"], np.number]] = Field( - ..., description="""Signals from ROIs.""" - ) + data: Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_rois"], np.number], + ] = Field(..., description="""Signals from ROIs.""") rois: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -213,7 +243,9 @@ class RoiResponseSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -226,7 +258,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[RoiResponseSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}} @@ -239,7 +273,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[RoiResponseSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}} @@ -252,7 +288,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[DynamicTable]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "DynamicTable"}]}} @@ -265,7 +303,9 @@ class ImagingPlane(NWBContainer): An imaging plane and its metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of the imaging plane.""") @@ -305,14 +345,18 @@ class ImagingPlaneManifold(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys"}) name: Literal["manifold"] = Field( - "manifold", json_schema_extra={"linkml_meta": {"equals_string": "manifold", "ifabsent": "string(manifold)"}} + "manifold", + json_schema_extra={ + "linkml_meta": {"equals_string": "manifold", "ifabsent": "string(manifold)"} + }, ) conversion: Optional[np.float32] = Field( None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as pixels from x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then the 'conversion' multiplier to get from raw data acquisition pixel units to meters is 2/1000.""", ) unit: Optional[str] = Field( - None, description="""Base unit of measurement for working with the data. The default value is 'meters'.""" + None, + description="""Base unit of measurement for working with the data. The default value is 'meters'.""", ) array: Optional[ Union[ @@ -331,7 +375,9 @@ class ImagingPlaneOriginCoords(ConfiguredBaseModel): name: Literal["origin_coords"] = Field( "origin_coords", - json_schema_extra={"linkml_meta": {"equals_string": "origin_coords", "ifabsent": "string(origin_coords)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "origin_coords", "ifabsent": "string(origin_coords)"} + }, ) unit: Optional[str] = Field( None, description="""Measurement units for origin_coords. The default value is 'meters'.""" @@ -341,7 +387,10 @@ class ImagingPlaneOriginCoords(ConfiguredBaseModel): json_schema_extra={ "linkml_meta": { "array": { - "dimensions": [{"alias": "x_y", "exact_cardinality": 2}, {"alias": "x_y_z", "exact_cardinality": 3}] + "dimensions": [ + {"alias": "x_y", "exact_cardinality": 2}, + {"alias": "x_y_z", "exact_cardinality": 3}, + ] } } }, @@ -357,7 +406,9 @@ class ImagingPlaneGridSpacing(ConfiguredBaseModel): name: Literal["grid_spacing"] = Field( "grid_spacing", - json_schema_extra={"linkml_meta": {"equals_string": "grid_spacing", "ifabsent": "string(grid_spacing)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "grid_spacing", "ifabsent": "string(grid_spacing)"} + }, ) unit: Optional[str] = Field( None, description="""Measurement units for grid_spacing. The default value is 'meters'.""" @@ -367,7 +418,10 @@ class ImagingPlaneGridSpacing(ConfiguredBaseModel): json_schema_extra={ "linkml_meta": { "array": { - "dimensions": [{"alias": "x_y", "exact_cardinality": 2}, {"alias": "x_y_z", "exact_cardinality": 3}] + "dimensions": [ + {"alias": "x_y", "exact_cardinality": 2}, + {"alias": "x_y_z", "exact_cardinality": 3}, + ] } } }, @@ -383,7 +437,9 @@ class OpticalChannel(NWBContainer): name: str = Field(...) description: str = Field(..., description="""Description or other notes about the channel.""") - emission_lambda: np.float32 = Field(..., description="""Emission wavelength for channel, in nm.""") + emission_lambda: np.float32 = Field( + ..., description="""Emission wavelength for channel, in nm.""" + ) class MotionCorrection(NWBDataInterface): @@ -391,7 +447,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[NWBDataInterface]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_retinotopy.py index 5d8af35..7127d66 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_retinotopy.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_retinotopy.py @@ -9,7 +9,15 @@ from ...core.v2_2_0.core_nwb_image import GrayscaleImage from ...core.v2_2_0.core_nwb_base import NWBData, NWBDataInterface from numpydantic import NDArray, Shape from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) metamodel_version = "None" version = "2.2.0" @@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -80,17 +90,23 @@ class RetinotopyMap(NWBData): Abstract two-dimensional map of responses. Array structure: [num_rows][num_columns] """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.retinotopy", "tree_root": True} + ) name: str = Field(...) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -99,19 +115,27 @@ class AxisMap(RetinotopyMap): Abstract two-dimensional map of responses to stimuli along a single response axis (e.g. eccentricity) """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.retinotopy", "tree_root": True} + ) name: str = Field(...) - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) class RetinotopyImage(GrayscaleImage): @@ -119,7 +143,9 @@ class RetinotopyImage(GrayscaleImage): Gray-scale image related to retinotopic mapping. Array structure: [num_rows][num_columns] """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.retinotopy", "tree_root": True} + ) name: str = Field(...) bits_per_pixel: Optional[np.int32] = Field( @@ -130,8 +156,12 @@ class RetinotopyImage(GrayscaleImage): None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + format: Optional[str] = Field( + None, description="""Format of image. Right now only 'raw' is supported.""" + ) resolution: Optional[np.float32] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) @@ -150,38 +180,57 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.retinotopy", "tree_root": True} + ) - name: str = Field("ImagingRetinotopy", json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}}) + name: str = Field( + "ImagingRetinotopy", + json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}}, + ) axis_1_phase_map: Named[AxisMap] = Field( ..., description="""Phase response to stimulus on the first measured axis.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) axis_1_power_map: Named[Optional[AxisMap]] = Field( None, description="""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.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) axis_2_phase_map: Named[AxisMap] = Field( ..., description="""Phase response to stimulus on the second measured axis.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) axis_2_power_map: Named[Optional[AxisMap]] = Field( None, description="""Power response to stimulus on the second measured axis.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) sign_map: Named[RetinotopyMap] = Field( ..., description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) axis_descriptions: NDArray[Shape["2 num_axes"], str] = Field( ..., description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_axes", "exact_cardinality": 2}]}}}, + json_schema_extra={ + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_axes", "exact_cardinality": 2}]} + } + }, ) focal_depth_image: ImagingRetinotopyFocalDepthImage = Field( ..., @@ -190,7 +239,9 @@ class ImagingRetinotopy(NWBDataInterface): vasculature_image: Named[RetinotopyImage] = Field( ..., description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) @@ -204,10 +255,15 @@ class ImagingRetinotopyFocalDepthImage(RetinotopyImage): name: Literal["focal_depth_image"] = Field( "focal_depth_image", json_schema_extra={ - "linkml_meta": {"equals_string": "focal_depth_image", "ifabsent": "string(focal_depth_image)"} + "linkml_meta": { + "equals_string": "focal_depth_image", + "ifabsent": "string(focal_depth_image)", + } }, ) - focal_depth: Optional[np.float32] = Field(None, description="""Focal depth offset, in meters.""") + focal_depth: Optional[np.float32] = Field( + None, description="""Focal depth offset, in meters.""" + ) bits_per_pixel: Optional[np.int32] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""", @@ -216,8 +272,12 @@ class ImagingRetinotopyFocalDepthImage(RetinotopyImage): None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + format: Optional[str] = Field( + None, description="""Format of image. Right now only 'raw' is supported.""" + ) resolution: Optional[np.float32] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/namespace.py index 85c691b..e2d169d 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/namespace.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/namespace.py @@ -7,7 +7,12 @@ import sys from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator import numpy as np -from ...hdmf_common.v1_1_0.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_0.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_0.hdmf_common_table import ( Data, Index, @@ -144,7 +149,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/__init__.py index 8d1c8b6..8b13789 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/__init__.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/__init__.py @@ -1 +1 @@ - + diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_base.py index 23f5706..38e7cea 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_base.py @@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,7 +81,9 @@ class NWBData(Data): An abstract data type for a dataset. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -89,7 +93,9 @@ 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)). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -110,7 +116,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -120,7 +128,9 @@ class NWBDataInterface(NWBContainer): An abstract data type for a generic container storing collections of data, as opposed to metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -130,7 +140,9 @@ class TimeSeries(NWBDataInterface): General purpose time series. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of the time series.""") @@ -159,7 +171,9 @@ class TimeSeries(NWBDataInterface): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -175,7 +189,8 @@ class TimeSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) conversion: Optional[np.float32] = Field( None, @@ -208,10 +223,14 @@ class TimeSeriesStartingTime(ConfiguredBaseModel): name: Literal["starting_time"] = Field( "starting_time", - json_schema_extra={"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"} + }, ) rate: Optional[np.float32] = Field(None, description="""Sampling rate, in Hz.""") - unit: Optional[str] = Field(None, description="""Unit of measurement for time, which is fixed to 'seconds'.""") + unit: Optional[str] = Field( + None, description="""Unit of measurement for time, which is fixed to 'seconds'.""" + ) value: np.float64 = Field(...) @@ -223,7 +242,8 @@ class TimeSeriesSync(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"}) name: Literal["sync"] = Field( - "sync", json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}} + "sync", + json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}}, ) @@ -232,10 +252,15 @@ class ProcessingModule(NWBContainer): A collection of processed data. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) children: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field( - None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}} + None, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]} + }, ) name: str = Field(...) @@ -245,10 +270,14 @@ class Images(NWBDataInterface): A collection of images. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field("Images", json_schema_extra={"linkml_meta": {"ifabsent": "string(Images)"}}) - description: Optional[str] = Field(None, description="""Description of this collection of images.""") + description: Optional[str] = Field( + None, description="""Description of this collection of images.""" + ) image: List[Image] = Field(..., description="""Images stored in this collection.""") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_behavior.py index 2cfb592..35cca64 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_behavior.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_behavior.py @@ -44,7 +44,12 @@ from ...core.v2_2_1.core_nwb_base import ( ProcessingModule, Images, ) -from ...hdmf_common.v1_1_2.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_2.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_2.hdmf_common_table import ( Data, Index, @@ -70,7 +75,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -126,11 +133,14 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) name: str = Field(...) data: SpatialSeriesData = Field( - ..., description="""1-D or 2-D array storing position or direction relative to some reference frame.""" + ..., + description="""1-D or 2-D array storing position or direction relative to some reference frame.""", ) reference_frame: Optional[str] = Field( None, description="""Description defining what exactly 'straight-ahead' means.""" @@ -157,7 +167,9 @@ class SpatialSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -173,14 +185,18 @@ class SpatialSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, description="""Base unit of measurement for working with the data. The default value is 'meters'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) array: Optional[ - Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]] + Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_features"], np.number], + ] ] = Field(None) @@ -189,7 +205,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[IntervalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "IntervalSeries"}]}} @@ -202,7 +220,9 @@ class BehavioralEvents(NWBDataInterface): TimeSeries for storing behavioral events. See description of BehavioralEpochs for more details. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -215,7 +235,9 @@ class BehavioralTimeSeries(NWBDataInterface): TimeSeries for storing Behavoioral time series data. See description of BehavioralEpochs for more details. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -228,7 +250,9 @@ class PupilTracking(NWBDataInterface): Eye-tracking data, representing pupil size. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -241,7 +265,9 @@ class EyeTracking(NWBDataInterface): Eye-tracking data, representing direction of gaze. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} @@ -254,7 +280,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} @@ -267,7 +295,9 @@ class Position(NWBDataInterface): Position data, whether along the x, x/y or x/y/z axis. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_device.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_device.py index 50b6d62..83d2f3c 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_device.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_device.py @@ -22,7 +22,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -62,14 +64,18 @@ class Device(NWBContainer): Metadata about a data acquisition device, e.g., recording system, electrode, microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.device", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.device", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field( None, description="""Description of the device (e.g., model, firmware version, processing software version, etc.) as free-form text.""", ) - manufacturer: Optional[str] = Field(None, description="""The name of the manufacturer of the device.""") + manufacturer: Optional[str] = Field( + None, description="""The name of the manufacturer of the device.""" + ) # Model rebuild diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ecephys.py index 7c8f5d1..cc00287 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ecephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ecephys.py @@ -7,7 +7,15 @@ import sys import numpy as np from ...hdmf_common.v1_1_2.hdmf_common_table import DynamicTableRegion from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from ...core.v2_2_1.core_nwb_base import ( TimeSeries, TimeSeriesStartingTime, @@ -30,7 +38,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -75,7 +85,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.ecephys/", "id": "core.nwb.ecephys", - "imports": ["core.nwb.base", "../../hdmf_common/v1_1_2/namespace", "core.nwb.device", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "../../hdmf_common/v1_1_2/namespace", + "core.nwb.device", + "core.nwb.language", + ], "name": "core.nwb.ecephys", } ) @@ -86,7 +101,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) data: Union[ @@ -97,7 +114,9 @@ class ElectricalSeries(TimeSeries): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( None, @@ -126,7 +145,9 @@ class ElectricalSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -139,7 +160,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) data: Union[ @@ -154,7 +177,9 @@ class SpikeEventSeries(ElectricalSeries): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( None, @@ -178,7 +203,9 @@ class SpikeEventSeries(ElectricalSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -191,9 +218,14 @@ class FeatureExtraction(NWBDataInterface): Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("FeatureExtraction", json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}}) + name: str = Field( + "FeatureExtraction", + json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}}, + ) description: NDArray[Shape["* num_features"], str] = Field( ..., description="""Description of features (eg, ''PC1'') for each of the extracted features.""", @@ -204,7 +236,13 @@ class FeatureExtraction(NWBDataInterface): description="""Multi-dimensional array of features extracted from each event.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_events"}, {"alias": "num_channels"}, {"alias": "num_features"}]} + "array": { + "dimensions": [ + {"alias": "num_events"}, + {"alias": "num_channels"}, + {"alias": "num_features"}, + ] + } } }, ) @@ -216,7 +254,9 @@ class FeatureExtraction(NWBDataInterface): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) @@ -225,9 +265,13 @@ class EventDetection(NWBDataInterface): Detected spike events from voltage trace(s). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}}) + name: str = Field( + "EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}} + ) detection_method: str = Field( ..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""", @@ -249,7 +293,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[SpikeEventSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpikeEventSeries"}]}} @@ -262,7 +308,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[ElectricalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}} @@ -275,7 +323,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[ElectricalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}} @@ -288,7 +338,9 @@ class ElectrodeGroup(NWBContainer): A physical grouping of electrodes, e.g. a shank of an array. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of this electrode group.""") @@ -309,7 +361,10 @@ class ElectrodeGroupPosition(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"}) name: Literal["position"] = Field( - "position", json_schema_extra={"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}} + "position", + json_schema_extra={ + "linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"} + }, ) x: Optional[np.float32] = Field(None, description="""x coordinate""") y: Optional[np.float32] = Field(None, description="""y coordinate""") @@ -321,22 +376,33 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("ClusterWaveforms", json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}}) - waveform_filtering: str = Field(..., description="""Filtering applied to data before generating mean/sd""") + name: str = Field( + "ClusterWaveforms", + json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}}, + ) + waveform_filtering: str = Field( + ..., description="""Filtering applied to data before generating mean/sd""" + ) waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( ..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]} + } }, ) waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( ..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]} + } }, ) @@ -346,9 +412,13 @@ class Clustering(NWBDataInterface): DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}}) + name: str = Field( + "Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}} + ) description: str = Field( ..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_epoch.py index e299b88..ec59bad 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_epoch.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_epoch.py @@ -6,7 +6,15 @@ import re import sys import numpy as np from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape from ...hdmf_common.v1_1_2.hdmf_common_table import DynamicTable, VectorIndex, VectorData from ...core.v2_2_1.core_nwb_base import TimeSeries @@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -80,52 +90,70 @@ class TimeIntervals(DynamicTable): A container for aggregating epoch data and the TimeSeries that each epoch applies to. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.epoch", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.epoch", "tree_root": True} + ) name: str = Field(...) start_time: NDArray[Any, np.float32] = Field( ..., description="""Start time of epoch, in seconds.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) stop_time: NDArray[Any, np.float32] = Field( ..., description="""Stop time of epoch, in seconds.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) tags: Optional[NDArray[Any, str]] = Field( None, description="""User-defined tags that identify or categorize events.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) tags_index: Named[Optional[VectorIndex]] = Field( None, description="""Index for tags.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, + ) + timeseries: Optional[TimeIntervalsTimeseries] = Field( + None, description="""An index into a TimeSeries object.""" ) - timeseries: Optional[TimeIntervalsTimeseries] = Field(None, description="""An index into a TimeSeries object.""") timeseries_index: Named[Optional[VectorIndex]] = Field( None, description="""Index for timeseries.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -140,17 +168,24 @@ class TimeIntervalsTimeseries(VectorData): name: Literal["timeseries"] = Field( "timeseries", - json_schema_extra={"linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"} + }, ) idx_start: Optional[np.int32] = Field( None, description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) count: Optional[np.int32] = Field( - None, description="""Number of data samples available in this time series, during this epoch.""" + None, + description="""Number of data samples available in this time series, during this epoch.""", + ) + timeseries: Optional[TimeSeries] = Field( + None, description="""the TimeSeries that this index applies to.""" + ) + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" ) - timeseries: Optional[TimeSeries] = Field(None, description="""the TimeSeries that this index applies to.""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") # Model rebuild diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_file.py index 28bbdff..2e87c11 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_file.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_file.py @@ -44,7 +44,12 @@ from ...core.v2_2_1.core_nwb_base import ( ProcessingModule, Images, ) -from ...hdmf_common.v1_1_2.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_2.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_2.hdmf_common_table import ( Data, Index, @@ -117,7 +122,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -184,10 +191,13 @@ class NWBFile(NWBContainer): An NWB:N file storing cellular-based neurophysiology data from a single experimental session. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: Literal["root"] = Field( - "root", json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}} + "root", + json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}}, ) nwb_version: Optional[str] = Field( None, @@ -196,7 +206,9 @@ class NWBFile(NWBContainer): file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = Field( ..., description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}} + }, ) identifier: str = Field( ..., @@ -216,17 +228,23 @@ class NWBFile(NWBContainer): acquisition: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field( None, description="""Data streams recorded from the system, including ephys, ophys, tracking, etc. This group should be read-only after the experiment is completed and timestamps are corrected to a common timebase. The data stored here may be links to raw data stored in external NWB files. This will allow keeping bulky raw data out of the file while preserving the option of keeping some/all in the file. Acquired data includes tracking and experimental data streams (i.e., everything measured from the system). If bulky data is stored in the /acquisition group, the data can exist in a separate NWB file that is linked to by the file being used for processing and analysis.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]} + }, ) analysis: Optional[List[Union[DynamicTable, NWBContainer]]] = Field( None, description="""Lab-specific and custom scientific analysis of data. There is no defined format for the content of this group - the format is up to the individual user/lab. To facilitate sharing analysis data between labs, the contents here should be stored in standard types (e.g., neurodata_types) and appropriately documented. The file can store lab-specific and custom data analysis without restriction on its form or schema, reducing data formatting restrictions on end users. Such data should be placed in the analysis group. The analysis data should be documented so that it could be shared with other labs.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]} + }, ) scratch: Optional[List[Union[DynamicTable, NWBContainer]]] = Field( None, description="""A place to store one-off analysis results. Data placed here is not intended for sharing. By placing data here, users acknowledge that there is no guarantee that their data meets any standard.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]} + }, ) processing: Optional[List[ProcessingModule]] = Field( None, @@ -266,7 +284,10 @@ class NWBFileStimulus(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["stimulus"] = Field( - "stimulus", json_schema_extra={"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}} + "stimulus", + json_schema_extra={ + "linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"} + }, ) presentation: Optional[List[TimeSeries]] = Field( None, @@ -288,16 +309,27 @@ class NWBFileGeneral(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["general"] = Field( - "general", json_schema_extra={"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}} + "general", + json_schema_extra={ + "linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"} + }, + ) + data_collection: Optional[str] = Field( + None, description="""Notes about data collection and analysis.""" + ) + experiment_description: Optional[str] = Field( + None, description="""General description of the experiment.""" ) - data_collection: Optional[str] = Field(None, description="""Notes about data collection and analysis.""") - experiment_description: Optional[str] = Field(None, description="""General description of the experiment.""") experimenter: Optional[NDArray[Shape["* num_experimenters"], str]] = Field( None, description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}} + }, + ) + institution: Optional[str] = Field( + None, description="""Institution(s) where experiment was performed.""" ) - institution: Optional[str] = Field(None, description="""Institution(s) where experiment was performed.""") keywords: Optional[NDArray[Shape["* num_keywords"], str]] = Field( None, description="""Terms to search over.""", @@ -310,12 +342,15 @@ class NWBFileGeneral(ConfiguredBaseModel): description="""Description of drugs used, including how and when they were administered. Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc.""", ) protocol: Optional[str] = Field( - None, description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""" + None, + description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""", ) related_publications: Optional[NDArray[Shape["* num_publications"], str]] = Field( None, description="""Publication information. PMID, DOI, URL, etc.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}} + }, ) session_id: Optional[str] = Field(None, description="""Lab-specific ID for the session.""") slices: Optional[str] = Field( @@ -323,7 +358,8 @@ class NWBFileGeneral(ConfiguredBaseModel): description="""Description of slices, including information about preparation thickness, orientation, temperature, and bath solution.""", ) source_script: Optional[NWBFileGeneralSourceScript] = Field( - None, description="""Script file or link to public source code used to create this NWB file.""" + None, + description="""Script file or link to public source code used to create this NWB file.""", ) stimulus: Optional[str] = Field( None, description="""Notes about stimuli, such as how and where they were presented.""" @@ -346,7 +382,8 @@ class NWBFileGeneral(ConfiguredBaseModel): json_schema_extra={"linkml_meta": {"any_of": [{"range": "Device"}]}}, ) subject: Optional[Subject] = Field( - None, description="""Information about the animal or person from which the data was measured.""" + None, + description="""Information about the animal or person from which the data was measured.""", ) extracellular_ephys: Optional[NWBFileGeneralExtracellularEphys] = Field( None, description="""Metadata related to extracellular electrophysiology.""" @@ -375,7 +412,9 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel): name: Literal["source_script"] = Field( "source_script", - json_schema_extra={"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"} + }, ) file_name: Optional[str] = Field(None, description="""Name of script file.""") value: str = Field(...) @@ -389,23 +428,33 @@ class Subject(NWBContainer): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["subject"] = Field( - "subject", json_schema_extra={"linkml_meta": {"equals_string": "subject", "ifabsent": "string(subject)"}} + "subject", + json_schema_extra={ + "linkml_meta": {"equals_string": "subject", "ifabsent": "string(subject)"} + }, + ) + age: Optional[str] = Field( + None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""" ) - age: Optional[str] = Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""") date_of_birth: Optional[np.datetime64] = Field( None, description="""Date of birth of subject. Can be supplied instead of 'age'.""" ) description: Optional[str] = Field( - None, description="""Description of subject and where subject came from (e.g., breeder, if animal).""" + None, + description="""Description of subject and where subject came from (e.g., breeder, if animal).""", + ) + genotype: Optional[str] = Field( + None, description="""Genetic strain. If absent, assume Wild Type (WT).""" ) - genotype: Optional[str] = Field(None, description="""Genetic strain. If absent, assume Wild Type (WT).""") sex: Optional[str] = Field(None, description="""Gender of subject.""") species: Optional[str] = Field(None, description="""Species of subject.""") subject_id: Optional[str] = Field( - None, description="""ID of animal/person used/participating in experiment (lab convention).""" + None, + description="""ID of animal/person used/participating in experiment (lab convention).""", ) weight: Optional[str] = Field( - None, description="""Weight at time of experiment, at time of surgery and at other important times.""" + None, + description="""Weight at time of experiment, at time of surgery and at other important times.""", ) @@ -419,10 +468,15 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel): name: Literal["extracellular_ephys"] = Field( "extracellular_ephys", json_schema_extra={ - "linkml_meta": {"equals_string": "extracellular_ephys", "ifabsent": "string(extracellular_ephys)"} + "linkml_meta": { + "equals_string": "extracellular_ephys", + "ifabsent": "string(extracellular_ephys)", + } }, ) - electrode_group: Optional[List[ElectrodeGroup]] = Field(None, description="""Physical group of electrodes.""") + electrode_group: Optional[List[ElectrodeGroup]] = Field( + None, description="""Physical group of electrodes.""" + ) electrodes: Optional[NWBFileGeneralExtracellularEphysElectrodes] = Field( None, description="""A table of all electrodes (i.e. channels) used for recording.""" ) @@ -437,48 +491,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): name: Literal["electrodes"] = Field( "electrodes", - json_schema_extra={"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"} + }, ) x: NDArray[Any, np.float32] = Field( ..., description="""x coordinate of the channel location in the brain (+x is posterior).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) y: NDArray[Any, np.float32] = Field( ..., description="""y coordinate of the channel location in the brain (+y is inferior).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) z: NDArray[Any, np.float32] = Field( ..., description="""z coordinate of the channel location in the brain (+z is right).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) imp: NDArray[Any, np.float32] = Field( ..., description="""Impedance of the channel.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) location: NDArray[Any, str] = Field( ..., description="""Location of the electrode (channel). 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.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) filtering: NDArray[Any, np.float32] = Field( ..., description="""Description of hardware filtering.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) group: List[ElectrodeGroup] = Field( @@ -488,48 +556,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): ..., description="""Name of the ElectrodeGroup this electrode is a part of.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_x: Optional[NDArray[Any, np.float32]] = Field( None, description="""x coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_y: Optional[NDArray[Any, np.float32]] = Field( None, description="""y coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_z: Optional[NDArray[Any, np.float32]] = Field( None, description="""z coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) reference: Optional[NDArray[Any, str]] = Field( None, description="""Description of the reference used for this electrode.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -545,7 +627,10 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel): name: Literal["intracellular_ephys"] = Field( "intracellular_ephys", json_schema_extra={ - "linkml_meta": {"equals_string": "intracellular_ephys", "ifabsent": "string(intracellular_ephys)"} + "linkml_meta": { + "equals_string": "intracellular_ephys", + "ifabsent": "string(intracellular_ephys)", + } }, ) filtering: Optional[str] = Field( diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_icephys.py index dc49071..e40a2a3 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_icephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_icephys.py @@ -5,7 +5,12 @@ from enum import Enum import re import sys import numpy as np -from ...hdmf_common.v1_1_2.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_2.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_2.hdmf_common_table import ( Data, Index, @@ -30,7 +35,15 @@ from ...core.v2_2_1.core_nwb_base import ( Images, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape metamodel_version = "None" @@ -46,7 +59,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -91,7 +106,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.icephys/", "id": "core.nwb.icephys", - "imports": ["core.nwb.base", "core.nwb.device", "../../hdmf_common/v1_1_2/namespace", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "core.nwb.device", + "../../hdmf_common/v1_1_2/namespace", + "core.nwb.language", + ], "name": "core.nwb.icephys", } ) @@ -102,7 +122,9 @@ class PatchClampSeries(TimeSeries): An abstract base class for patch-clamp data - stimulus or response, current or voltage. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) stimulus_description: Optional[str] = Field( @@ -113,7 +135,8 @@ class PatchClampSeries(TimeSeries): ) data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""") gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -137,7 +160,9 @@ class PatchClampSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -153,7 +178,8 @@ class PatchClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -169,13 +195,17 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""") bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""") - capacitance_compensation: Optional[np.float32] = Field(None, description="""Capacitance compensation, in farads.""") + capacitance_compensation: Optional[np.float32] = Field( + None, description="""Capacitance compensation, in farads.""" + ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) @@ -183,7 +213,8 @@ class CurrentClampSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -207,7 +238,9 @@ class CurrentClampSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -223,7 +256,8 @@ class CurrentClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -237,11 +271,15 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""") - bridge_balance: np.float32 = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + bridge_balance: np.float32 = Field( + ..., description="""Bridge balance, in ohms, fixed to 0.0.""" + ) capacitance_compensation: np.float32 = Field( ..., description="""Capacitance compensation, in farads, fixed to 0.0.""" ) @@ -253,7 +291,8 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -277,7 +316,9 @@ class IZeroClampSeries(CurrentClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -290,7 +331,9 @@ class CurrentClampStimulusSeries(PatchClampSeries): Stimulus current applied during current clamp recording. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: CurrentClampStimulusSeriesData = Field(..., description="""Stimulus current applied.""") @@ -301,7 +344,8 @@ class CurrentClampStimulusSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -325,7 +369,9 @@ class CurrentClampStimulusSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -341,7 +387,8 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -355,7 +402,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: VoltageClampSeriesData = Field(..., description="""Recorded current.""") @@ -377,8 +426,8 @@ class VoltageClampSeries(PatchClampSeries): whole_cell_capacitance_comp: Optional[VoltageClampSeriesWholeCellCapacitanceComp] = Field( None, description="""Whole cell capacitance compensation, in farads.""" ) - whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = Field( - None, description="""Whole cell series resistance compensation, in ohms.""" + whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = ( + Field(None, description="""Whole cell series resistance compensation, in ohms.""") ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" @@ -387,7 +436,8 @@ class VoltageClampSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -411,7 +461,9 @@ class VoltageClampSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -427,7 +479,8 @@ class VoltageClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -446,11 +499,15 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): name: Literal["capacitance_fast"] = Field( "capacitance_fast", json_schema_extra={ - "linkml_meta": {"equals_string": "capacitance_fast", "ifabsent": "string(capacitance_fast)"} + "linkml_meta": { + "equals_string": "capacitance_fast", + "ifabsent": "string(capacitance_fast)", + } }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -465,11 +522,15 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): name: Literal["capacitance_slow"] = Field( "capacitance_slow", json_schema_extra={ - "linkml_meta": {"equals_string": "capacitance_slow", "ifabsent": "string(capacitance_slow)"} + "linkml_meta": { + "equals_string": "capacitance_slow", + "ifabsent": "string(capacitance_slow)", + } }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -491,7 +552,8 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""" + None, + description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""", ) value: np.float32 = Field(...) @@ -513,7 +575,8 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""" + None, + description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""", ) value: np.float32 = Field(...) @@ -535,7 +598,8 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""" + None, + description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""", ) value: np.float32 = Field(...) @@ -557,7 +621,8 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -579,7 +644,8 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""" + None, + description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""", ) value: np.float32 = Field(...) @@ -589,7 +655,9 @@ class VoltageClampStimulusSeries(PatchClampSeries): Stimulus voltage applied during a voltage clamp recording. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: VoltageClampStimulusSeriesData = Field(..., description="""Stimulus voltage applied.""") @@ -600,7 +668,8 @@ class VoltageClampStimulusSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -624,7 +693,9 @@ class VoltageClampStimulusSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -640,7 +711,8 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -654,19 +726,27 @@ class IntracellularElectrode(NWBContainer): An intracellular electrode and its metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) - description: str = Field(..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""") + description: str = Field( + ..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""" + ) filtering: Optional[str] = Field(None, description="""Electrode specific filtering.""") - initial_access_resistance: Optional[str] = Field(None, description="""Initial access resistance.""") + initial_access_resistance: Optional[str] = Field( + None, description="""Initial access resistance.""" + ) location: Optional[str] = Field( None, description="""Location of the electrode. 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.""", ) resistance: Optional[str] = Field(None, description="""Electrode resistance, in ohms.""") seal: Optional[str] = Field(None, description="""Information about seal used for recording.""") - slice: Optional[str] = Field(None, description="""Information about slice used for recording.""") + slice: Optional[str] = Field( + None, description="""Information about slice used for recording.""" + ) class SweepTable(DynamicTable): @@ -674,14 +754,18 @@ class SweepTable(DynamicTable): The table which groups different PatchClampSeries together. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) sweep_number: NDArray[Any, np.uint32] = Field( ..., description="""Sweep number of the PatchClampSeries in that row.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) series: List[PatchClampSeries] = Field( @@ -690,19 +774,25 @@ class SweepTable(DynamicTable): series_index: Named[VectorIndex] = Field( ..., description="""Index for series.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_image.py index 651fbb2..3d34dc8 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_image.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_image.py @@ -19,7 +19,12 @@ from ...core.v2_2_1.core_nwb_base import ( ProcessingModule, Images, ) -from ...hdmf_common.v1_1_2.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_2.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_2.hdmf_common_table import ( Data, Index, @@ -45,7 +50,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -101,7 +108,9 @@ class GrayscaleImage(Image): A grayscale image. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -122,7 +131,9 @@ class RGBImage(Image): A color image. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -143,7 +154,9 @@ class RGBAImage(Image): A color image with transparency. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -164,11 +177,16 @@ 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]. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: Optional[ - Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] + Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] ] = Field(None, description="""Binary data representing images across frames.""") dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -205,7 +223,9 @@ class ImageSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -222,7 +242,9 @@ class ImageSeriesExternalFile(ConfiguredBaseModel): name: Literal["external_file"] = Field( "external_file", - json_schema_extra={"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"} + }, ) starting_frame: Optional[np.int32] = Field( None, @@ -238,11 +260,16 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: Optional[ - Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] + Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] ] = Field(None, description="""Binary data representing images across frames.""") dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -279,7 +306,9 @@ class ImageMaskSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -292,19 +321,29 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) - distance: Optional[np.float32] = Field(None, description="""Distance from camera/monitor to target/eye.""") + distance: Optional[np.float32] = Field( + None, description="""Distance from camera/monitor to target/eye.""" + ) field_of_view: Optional[ - Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]] + Union[ + NDArray[Shape["2 width_height"], np.float32], + NDArray[Shape["3 width_height_depth"], np.float32], + ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") orientation: Optional[str] = Field( None, description="""Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.""", ) data: Optional[ - Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] + Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] ] = Field(None, description="""Binary data representing images across frames.""") dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -341,7 +380,9 @@ class OpticalSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -354,7 +395,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.int32] = Field( @@ -384,7 +427,9 @@ class IndexSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_misc.py index 2ada490..5f1a792 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_misc.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_misc.py @@ -7,10 +7,23 @@ import sys import numpy as np from ...core.v2_2_1.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from ...core.v2_2_1.core_nwb_ecephys import ElectrodeGroup from numpydantic import NDArray, Shape -from ...hdmf_common.v1_1_2.hdmf_common_table import DynamicTable, VectorData, VectorIndex, DynamicTableRegion +from ...hdmf_common.v1_1_2.hdmf_common_table import ( + DynamicTable, + VectorData, + VectorIndex, + DynamicTableRegion, +) metamodel_version = "None" version = "2.2.1" @@ -25,7 +38,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -70,7 +85,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.misc/", "id": "core.nwb.misc", - "imports": ["core.nwb.base", "../../hdmf_common/v1_1_2/namespace", "core.nwb.ecephys", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "../../hdmf_common/v1_1_2/namespace", + "core.nwb.ecephys", + "core.nwb.language", + ], "name": "core.nwb.misc", } ) @@ -81,10 +101,14 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) - data: AbstractFeatureSeriesData = Field(..., description="""Values of each feature at each time.""") + data: AbstractFeatureSeriesData = Field( + ..., description="""Values of each feature at each time.""" + ) feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field( None, description="""Units of each feature.""", @@ -117,7 +141,9 @@ class AbstractFeatureSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -133,14 +159,18 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, description="""Since there can be different units for different features, store the units in 'feature_units'. The default value for this attribute is \"see 'feature_units'\".""", ) array: Optional[ - Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]] + Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_features"], np.number], + ] ] = Field(None) @@ -149,7 +179,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], str] = Field( @@ -179,7 +211,9 @@ class AnnotationSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -192,7 +226,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.int8] = Field( @@ -222,7 +258,9 @@ class IntervalSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -235,10 +273,14 @@ class DecompositionSeries(TimeSeries): Spectral analysis of a time series, e.g. of an LFP or a speech signal. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) - data: DecompositionSeriesData = Field(..., description="""Data decomposed into frequency bands.""") + data: DecompositionSeriesData = Field( + ..., description="""Data decomposed into frequency bands.""" + ) metric: str = Field(..., description="""The metric used, e.g. phase, amplitude, power.""") bands: DecompositionSeriesBands = Field( ..., @@ -266,7 +308,9 @@ class DecompositionSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -282,7 +326,8 @@ class DecompositionSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -292,7 +337,13 @@ class DecompositionSeriesData(ConfiguredBaseModel): None, json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_times"}, {"alias": "num_channels"}, {"alias": "num_bands"}]} + "array": { + "dimensions": [ + {"alias": "num_times"}, + {"alias": "num_channels"}, + {"alias": "num_bands"}, + ] + } } }, ) @@ -306,13 +357,16 @@ class DecompositionSeriesBands(DynamicTable): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["bands"] = Field( - "bands", json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}} + "bands", + json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}}, ) band_name: NDArray[Any, str] = Field( ..., description="""Name of the band, e.g. theta.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field( @@ -320,7 +374,12 @@ class DecompositionSeriesBands(DynamicTable): description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_bands"}, {"alias": "low_high", "exact_cardinality": 2}]} + "array": { + "dimensions": [ + {"alias": "num_bands"}, + {"alias": "low_high", "exact_cardinality": 2}, + ] + } } }, ) @@ -338,13 +397,17 @@ class DecompositionSeriesBands(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -355,38 +418,55 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field("Units", json_schema_extra={"linkml_meta": {"ifabsent": "string(Units)"}}) spike_times_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the spike_times dataset.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, + ) + spike_times: Optional[UnitsSpikeTimes] = Field( + None, description="""Spike times for each unit.""" ) - spike_times: Optional[UnitsSpikeTimes] = Field(None, description="""Spike times for each unit.""") obs_intervals_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the obs_intervals dataset.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field( None, description="""Observation intervals for each unit.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_intervals"}, {"alias": "start_end", "exact_cardinality": 2}]} + "array": { + "dimensions": [ + {"alias": "num_intervals"}, + {"alias": "start_end", "exact_cardinality": 2}, + ] + } } }, ) electrodes_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into electrodes.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) electrodes: Named[Optional[DynamicTableRegion]] = Field( None, description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) electrode_group: Optional[List[ElectrodeGroup]] = Field( None, description="""Electrode group that each spike unit came from.""" @@ -407,13 +487,17 @@ class Units(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -428,13 +512,17 @@ class UnitsSpikeTimes(VectorData): name: Literal["spike_times"] = Field( "spike_times", - json_schema_extra={"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"} + }, ) resolution: Optional[np.float64] = Field( None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""", ) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) # Model rebuild diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ogen.py index 2ee6dbc..79300ad 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ogen.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ogen.py @@ -8,7 +8,12 @@ from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator import numpy as np from numpydantic import NDArray, Shape -from ...core.v2_2_1.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync, NWBContainer +from ...core.v2_2_1.core_nwb_base import ( + TimeSeries, + TimeSeriesStartingTime, + TimeSeriesSync, + NWBContainer, +) metamodel_version = "None" version = "2.2.1" @@ -23,7 +28,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,7 +86,9 @@ class OptogeneticSeries(TimeSeries): An optogenetic stimulus. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ogen", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.number] = Field( @@ -109,7 +118,9 @@ class OptogeneticSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -122,7 +133,9 @@ class OptogeneticStimulusSite(NWBContainer): A site of optogenetic stimulation. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ogen", "tree_root": True} + ) name: str = Field(...) description: str = Field(..., description="""Description of stimulation site.""") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ophys.py index 12c82db..d285d35 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ophys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ophys.py @@ -18,7 +18,12 @@ from ...core.v2_2_1.core_nwb_base import ( ProcessingModule, Images, ) -from ...hdmf_common.v1_1_2.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_2.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_2.hdmf_common_table import ( Data, Index, @@ -40,7 +45,15 @@ from ...core.v2_2_1.core_nwb_image import ( IndexSeries, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape metamodel_version = "None" @@ -56,7 +69,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -118,7 +133,9 @@ class TwoPhotonSeries(ImageSeries): Image stack recorded over time from 2-photon microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") @@ -127,10 +144,16 @@ class TwoPhotonSeries(ImageSeries): description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) field_of_view: Optional[ - Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height"], np.float32]] + Union[ + NDArray[Shape["2 width_height"], np.float32], + NDArray[Shape["3 width_height"], np.float32], + ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Optional[ - Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] + Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] ] = Field(None, description="""Binary data representing images across frames.""") dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -167,7 +190,9 @@ class TwoPhotonSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -180,16 +205,21 @@ class RoiResponseSeries(TimeSeries): ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) - data: Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_rois"], np.number]] = Field( - ..., description="""Signals from ROIs.""" - ) + data: Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_rois"], np.number], + ] = Field(..., description="""Signals from ROIs.""") rois: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -213,7 +243,9 @@ class RoiResponseSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -226,7 +258,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[RoiResponseSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}} @@ -239,7 +273,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[RoiResponseSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}} @@ -252,7 +288,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[DynamicTable]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "DynamicTable"}]}} @@ -265,7 +303,9 @@ class ImagingPlane(NWBContainer): An imaging plane and its metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of the imaging plane.""") @@ -305,14 +345,18 @@ class ImagingPlaneManifold(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys"}) name: Literal["manifold"] = Field( - "manifold", json_schema_extra={"linkml_meta": {"equals_string": "manifold", "ifabsent": "string(manifold)"}} + "manifold", + json_schema_extra={ + "linkml_meta": {"equals_string": "manifold", "ifabsent": "string(manifold)"} + }, ) conversion: Optional[np.float32] = Field( None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as pixels from x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then the 'conversion' multiplier to get from raw data acquisition pixel units to meters is 2/1000.""", ) unit: Optional[str] = Field( - None, description="""Base unit of measurement for working with the data. The default value is 'meters'.""" + None, + description="""Base unit of measurement for working with the data. The default value is 'meters'.""", ) array: Optional[ Union[ @@ -331,7 +375,9 @@ class ImagingPlaneOriginCoords(ConfiguredBaseModel): name: Literal["origin_coords"] = Field( "origin_coords", - json_schema_extra={"linkml_meta": {"equals_string": "origin_coords", "ifabsent": "string(origin_coords)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "origin_coords", "ifabsent": "string(origin_coords)"} + }, ) unit: Optional[str] = Field( None, description="""Measurement units for origin_coords. The default value is 'meters'.""" @@ -341,7 +387,10 @@ class ImagingPlaneOriginCoords(ConfiguredBaseModel): json_schema_extra={ "linkml_meta": { "array": { - "dimensions": [{"alias": "x_y", "exact_cardinality": 2}, {"alias": "x_y_z", "exact_cardinality": 3}] + "dimensions": [ + {"alias": "x_y", "exact_cardinality": 2}, + {"alias": "x_y_z", "exact_cardinality": 3}, + ] } } }, @@ -357,7 +406,9 @@ class ImagingPlaneGridSpacing(ConfiguredBaseModel): name: Literal["grid_spacing"] = Field( "grid_spacing", - json_schema_extra={"linkml_meta": {"equals_string": "grid_spacing", "ifabsent": "string(grid_spacing)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "grid_spacing", "ifabsent": "string(grid_spacing)"} + }, ) unit: Optional[str] = Field( None, description="""Measurement units for grid_spacing. The default value is 'meters'.""" @@ -367,7 +418,10 @@ class ImagingPlaneGridSpacing(ConfiguredBaseModel): json_schema_extra={ "linkml_meta": { "array": { - "dimensions": [{"alias": "x_y", "exact_cardinality": 2}, {"alias": "x_y_z", "exact_cardinality": 3}] + "dimensions": [ + {"alias": "x_y", "exact_cardinality": 2}, + {"alias": "x_y_z", "exact_cardinality": 3}, + ] } } }, @@ -383,7 +437,9 @@ class OpticalChannel(NWBContainer): name: str = Field(...) description: str = Field(..., description="""Description or other notes about the channel.""") - emission_lambda: np.float32 = Field(..., description="""Emission wavelength for channel, in nm.""") + emission_lambda: np.float32 = Field( + ..., description="""Emission wavelength for channel, in nm.""" + ) class MotionCorrection(NWBDataInterface): @@ -391,7 +447,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[NWBDataInterface]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_retinotopy.py index 49f4855..3885a3d 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_retinotopy.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_retinotopy.py @@ -9,7 +9,15 @@ from ...core.v2_2_1.core_nwb_image import GrayscaleImage from ...core.v2_2_1.core_nwb_base import NWBData, NWBDataInterface from numpydantic import NDArray, Shape from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) metamodel_version = "None" version = "2.2.1" @@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -80,17 +90,23 @@ class RetinotopyMap(NWBData): Abstract two-dimensional map of responses. Array structure: [num_rows][num_columns] """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.retinotopy", "tree_root": True} + ) name: str = Field(...) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -99,19 +115,27 @@ class AxisMap(RetinotopyMap): Abstract two-dimensional map of responses to stimuli along a single response axis (e.g. eccentricity) """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.retinotopy", "tree_root": True} + ) name: str = Field(...) - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) class RetinotopyImage(GrayscaleImage): @@ -119,7 +143,9 @@ class RetinotopyImage(GrayscaleImage): Gray-scale image related to retinotopic mapping. Array structure: [num_rows][num_columns] """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.retinotopy", "tree_root": True} + ) name: str = Field(...) bits_per_pixel: Optional[np.int32] = Field( @@ -130,8 +156,12 @@ class RetinotopyImage(GrayscaleImage): None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + format: Optional[str] = Field( + None, description="""Format of image. Right now only 'raw' is supported.""" + ) resolution: Optional[np.float32] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) @@ -150,38 +180,57 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.retinotopy", "tree_root": True} + ) - name: str = Field("ImagingRetinotopy", json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}}) + name: str = Field( + "ImagingRetinotopy", + json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}}, + ) axis_1_phase_map: Named[AxisMap] = Field( ..., description="""Phase response to stimulus on the first measured axis.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) axis_1_power_map: Named[Optional[AxisMap]] = Field( None, description="""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.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) axis_2_phase_map: Named[AxisMap] = Field( ..., description="""Phase response to stimulus on the second measured axis.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) axis_2_power_map: Named[Optional[AxisMap]] = Field( None, description="""Power response to stimulus on the second measured axis.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) sign_map: Named[RetinotopyMap] = Field( ..., description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) axis_descriptions: NDArray[Shape["2 num_axes"], str] = Field( ..., description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_axes", "exact_cardinality": 2}]}}}, + json_schema_extra={ + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_axes", "exact_cardinality": 2}]} + } + }, ) focal_depth_image: ImagingRetinotopyFocalDepthImage = Field( ..., @@ -190,7 +239,9 @@ class ImagingRetinotopy(NWBDataInterface): vasculature_image: Named[RetinotopyImage] = Field( ..., description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) @@ -204,10 +255,15 @@ class ImagingRetinotopyFocalDepthImage(RetinotopyImage): name: Literal["focal_depth_image"] = Field( "focal_depth_image", json_schema_extra={ - "linkml_meta": {"equals_string": "focal_depth_image", "ifabsent": "string(focal_depth_image)"} + "linkml_meta": { + "equals_string": "focal_depth_image", + "ifabsent": "string(focal_depth_image)", + } }, ) - focal_depth: Optional[np.float32] = Field(None, description="""Focal depth offset, in meters.""") + focal_depth: Optional[np.float32] = Field( + None, description="""Focal depth offset, in meters.""" + ) bits_per_pixel: Optional[np.int32] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""", @@ -216,8 +272,12 @@ class ImagingRetinotopyFocalDepthImage(RetinotopyImage): None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + format: Optional[str] = Field( + None, description="""Format of image. Right now only 'raw' is supported.""" + ) resolution: Optional[np.float32] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/namespace.py index e4a1cb2..b798833 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/namespace.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/namespace.py @@ -7,7 +7,12 @@ import sys from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator import numpy as np -from ...hdmf_common.v1_1_2.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_2.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_2.hdmf_common_table import ( Data, Index, @@ -144,7 +149,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/__init__.py index 8d1c8b6..8b13789 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/__init__.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/__init__.py @@ -1 +1 @@ - + diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_base.py index ba1bd93..226082d 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_base.py @@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,7 +81,9 @@ class NWBData(Data): An abstract data type for a dataset. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -89,7 +93,9 @@ 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)). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -110,7 +116,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -120,7 +128,9 @@ class NWBDataInterface(NWBContainer): An abstract data type for a generic container storing collections of data, as opposed to metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -130,7 +140,9 @@ class TimeSeries(NWBDataInterface): General purpose time series. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of the time series.""") @@ -159,7 +171,9 @@ class TimeSeries(NWBDataInterface): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -175,7 +189,8 @@ class TimeSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) conversion: Optional[np.float32] = Field( None, @@ -208,10 +223,14 @@ class TimeSeriesStartingTime(ConfiguredBaseModel): name: Literal["starting_time"] = Field( "starting_time", - json_schema_extra={"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"} + }, ) rate: Optional[np.float32] = Field(None, description="""Sampling rate, in Hz.""") - unit: Optional[str] = Field(None, description="""Unit of measurement for time, which is fixed to 'seconds'.""") + unit: Optional[str] = Field( + None, description="""Unit of measurement for time, which is fixed to 'seconds'.""" + ) value: np.float64 = Field(...) @@ -223,7 +242,8 @@ class TimeSeriesSync(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"}) name: Literal["sync"] = Field( - "sync", json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}} + "sync", + json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}}, ) @@ -232,10 +252,15 @@ class ProcessingModule(NWBContainer): A collection of processed data. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) children: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field( - None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}} + None, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]} + }, ) name: str = Field(...) @@ -245,10 +270,14 @@ class Images(NWBDataInterface): A collection of images. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field("Images", json_schema_extra={"linkml_meta": {"ifabsent": "string(Images)"}}) - description: Optional[str] = Field(None, description="""Description of this collection of images.""") + description: Optional[str] = Field( + None, description="""Description of this collection of images.""" + ) image: List[Image] = Field(..., description="""Images stored in this collection.""") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_behavior.py index 9284b0f..1094150 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_behavior.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_behavior.py @@ -44,7 +44,12 @@ from ...core.v2_2_2.core_nwb_base import ( ProcessingModule, Images, ) -from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_3.hdmf_common_table import ( Data, Index, @@ -70,7 +75,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -126,11 +133,14 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) name: str = Field(...) data: SpatialSeriesData = Field( - ..., description="""1-D or 2-D array storing position or direction relative to some reference frame.""" + ..., + description="""1-D or 2-D array storing position or direction relative to some reference frame.""", ) reference_frame: Optional[str] = Field( None, description="""Description defining what exactly 'straight-ahead' means.""" @@ -157,7 +167,9 @@ class SpatialSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -173,14 +185,18 @@ class SpatialSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, description="""Base unit of measurement for working with the data. The default value is 'meters'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) array: Optional[ - Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]] + Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_features"], np.number], + ] ] = Field(None) @@ -189,7 +205,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[IntervalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "IntervalSeries"}]}} @@ -202,7 +220,9 @@ class BehavioralEvents(NWBDataInterface): TimeSeries for storing behavioral events. See description of BehavioralEpochs for more details. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -215,7 +235,9 @@ class BehavioralTimeSeries(NWBDataInterface): TimeSeries for storing Behavoioral time series data. See description of BehavioralEpochs for more details. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -228,7 +250,9 @@ class PupilTracking(NWBDataInterface): Eye-tracking data, representing pupil size. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -241,7 +265,9 @@ class EyeTracking(NWBDataInterface): Eye-tracking data, representing direction of gaze. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} @@ -254,7 +280,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} @@ -267,7 +295,9 @@ class Position(NWBDataInterface): Position data, whether along the x, x/y or x/y/z axis. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_device.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_device.py index a30b713..8f59409 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_device.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_device.py @@ -22,7 +22,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -62,14 +64,18 @@ class Device(NWBContainer): Metadata about a data acquisition device, e.g., recording system, electrode, microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.device", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.device", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field( None, description="""Description of the device (e.g., model, firmware version, processing software version, etc.) as free-form text.""", ) - manufacturer: Optional[str] = Field(None, description="""The name of the manufacturer of the device.""") + manufacturer: Optional[str] = Field( + None, description="""The name of the manufacturer of the device.""" + ) # Model rebuild diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ecephys.py index 303aafd..689e3bd 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ecephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ecephys.py @@ -7,7 +7,15 @@ import sys import numpy as np from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTableRegion from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from ...core.v2_2_2.core_nwb_base import ( TimeSeries, TimeSeriesStartingTime, @@ -30,7 +38,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -75,7 +85,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.ecephys/", "id": "core.nwb.ecephys", - "imports": ["core.nwb.base", "../../hdmf_common/v1_1_3/namespace", "core.nwb.device", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "../../hdmf_common/v1_1_3/namespace", + "core.nwb.device", + "core.nwb.language", + ], "name": "core.nwb.ecephys", } ) @@ -86,7 +101,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) data: Union[ @@ -97,7 +114,9 @@ class ElectricalSeries(TimeSeries): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( None, @@ -126,7 +145,9 @@ class ElectricalSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -139,7 +160,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) data: Union[ @@ -154,7 +177,9 @@ class SpikeEventSeries(ElectricalSeries): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( None, @@ -178,7 +203,9 @@ class SpikeEventSeries(ElectricalSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -191,9 +218,14 @@ class FeatureExtraction(NWBDataInterface): Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("FeatureExtraction", json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}}) + name: str = Field( + "FeatureExtraction", + json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}}, + ) description: NDArray[Shape["* num_features"], str] = Field( ..., description="""Description of features (eg, ''PC1'') for each of the extracted features.""", @@ -204,7 +236,13 @@ class FeatureExtraction(NWBDataInterface): description="""Multi-dimensional array of features extracted from each event.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_events"}, {"alias": "num_channels"}, {"alias": "num_features"}]} + "array": { + "dimensions": [ + {"alias": "num_events"}, + {"alias": "num_channels"}, + {"alias": "num_features"}, + ] + } } }, ) @@ -216,7 +254,9 @@ class FeatureExtraction(NWBDataInterface): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) @@ -225,9 +265,13 @@ class EventDetection(NWBDataInterface): Detected spike events from voltage trace(s). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}}) + name: str = Field( + "EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}} + ) detection_method: str = Field( ..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""", @@ -249,7 +293,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[SpikeEventSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpikeEventSeries"}]}} @@ -262,7 +308,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[ElectricalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}} @@ -275,7 +323,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[ElectricalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}} @@ -288,7 +338,9 @@ class ElectrodeGroup(NWBContainer): A physical grouping of electrodes, e.g. a shank of an array. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of this electrode group.""") @@ -309,7 +361,10 @@ class ElectrodeGroupPosition(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"}) name: Literal["position"] = Field( - "position", json_schema_extra={"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}} + "position", + json_schema_extra={ + "linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"} + }, ) x: Optional[np.float32] = Field(None, description="""x coordinate""") y: Optional[np.float32] = Field(None, description="""y coordinate""") @@ -321,22 +376,33 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("ClusterWaveforms", json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}}) - waveform_filtering: str = Field(..., description="""Filtering applied to data before generating mean/sd""") + name: str = Field( + "ClusterWaveforms", + json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}}, + ) + waveform_filtering: str = Field( + ..., description="""Filtering applied to data before generating mean/sd""" + ) waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( ..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]} + } }, ) waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( ..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]} + } }, ) @@ -346,9 +412,13 @@ class Clustering(NWBDataInterface): DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}}) + name: str = Field( + "Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}} + ) description: str = Field( ..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_epoch.py index 66e29df..e833469 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_epoch.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_epoch.py @@ -6,7 +6,15 @@ import re import sys import numpy as np from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTable, VectorIndex, VectorData from ...core.v2_2_2.core_nwb_base import TimeSeries @@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -80,52 +90,70 @@ class TimeIntervals(DynamicTable): A container for aggregating epoch data and the TimeSeries that each epoch applies to. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.epoch", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.epoch", "tree_root": True} + ) name: str = Field(...) start_time: NDArray[Any, np.float32] = Field( ..., description="""Start time of epoch, in seconds.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) stop_time: NDArray[Any, np.float32] = Field( ..., description="""Stop time of epoch, in seconds.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) tags: Optional[NDArray[Any, str]] = Field( None, description="""User-defined tags that identify or categorize events.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) tags_index: Named[Optional[VectorIndex]] = Field( None, description="""Index for tags.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, + ) + timeseries: Optional[TimeIntervalsTimeseries] = Field( + None, description="""An index into a TimeSeries object.""" ) - timeseries: Optional[TimeIntervalsTimeseries] = Field(None, description="""An index into a TimeSeries object.""") timeseries_index: Named[Optional[VectorIndex]] = Field( None, description="""Index for timeseries.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -140,17 +168,24 @@ class TimeIntervalsTimeseries(VectorData): name: Literal["timeseries"] = Field( "timeseries", - json_schema_extra={"linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"} + }, ) idx_start: Optional[np.int32] = Field( None, description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) count: Optional[np.int32] = Field( - None, description="""Number of data samples available in this time series, during this epoch.""" + None, + description="""Number of data samples available in this time series, during this epoch.""", + ) + timeseries: Optional[TimeSeries] = Field( + None, description="""the TimeSeries that this index applies to.""" + ) + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" ) - timeseries: Optional[TimeSeries] = Field(None, description="""the TimeSeries that this index applies to.""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") array: Optional[ Union[ NDArray[Shape["* dim0"], Any], diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_file.py index 13878ce..6ee5eaa 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_file.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_file.py @@ -44,7 +44,12 @@ from ...core.v2_2_2.core_nwb_base import ( ProcessingModule, Images, ) -from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_3.hdmf_common_table import ( Data, Index, @@ -113,7 +118,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -180,10 +187,13 @@ class NWBFile(NWBContainer): An NWB:N file storing cellular-based neurophysiology data from a single experimental session. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: Literal["root"] = Field( - "root", json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}} + "root", + json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}}, ) nwb_version: Optional[str] = Field( None, @@ -192,7 +202,9 @@ class NWBFile(NWBContainer): file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = Field( ..., description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}} + }, ) identifier: str = Field( ..., @@ -212,17 +224,23 @@ class NWBFile(NWBContainer): acquisition: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field( None, description="""Data streams recorded from the system, including ephys, ophys, tracking, etc. This group should be read-only after the experiment is completed and timestamps are corrected to a common timebase. The data stored here may be links to raw data stored in external NWB files. This will allow keeping bulky raw data out of the file while preserving the option of keeping some/all in the file. Acquired data includes tracking and experimental data streams (i.e., everything measured from the system). If bulky data is stored in the /acquisition group, the data can exist in a separate NWB file that is linked to by the file being used for processing and analysis.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]} + }, ) analysis: Optional[List[Union[DynamicTable, NWBContainer]]] = Field( None, description="""Lab-specific and custom scientific analysis of data. There is no defined format for the content of this group - the format is up to the individual user/lab. To facilitate sharing analysis data between labs, the contents here should be stored in standard types (e.g., neurodata_types) and appropriately documented. The file can store lab-specific and custom data analysis without restriction on its form or schema, reducing data formatting restrictions on end users. Such data should be placed in the analysis group. The analysis data should be documented so that it could be shared with other labs.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]} + }, ) scratch: Optional[List[Union[DynamicTable, NWBContainer]]] = Field( None, description="""A place to store one-off analysis results. Data placed here is not intended for sharing. By placing data here, users acknowledge that there is no guarantee that their data meets any standard.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]} + }, ) processing: Optional[List[ProcessingModule]] = Field( None, @@ -262,7 +280,10 @@ class NWBFileStimulus(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["stimulus"] = Field( - "stimulus", json_schema_extra={"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}} + "stimulus", + json_schema_extra={ + "linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"} + }, ) presentation: Optional[List[TimeSeries]] = Field( None, @@ -284,16 +305,27 @@ class NWBFileGeneral(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["general"] = Field( - "general", json_schema_extra={"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}} + "general", + json_schema_extra={ + "linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"} + }, + ) + data_collection: Optional[str] = Field( + None, description="""Notes about data collection and analysis.""" + ) + experiment_description: Optional[str] = Field( + None, description="""General description of the experiment.""" ) - data_collection: Optional[str] = Field(None, description="""Notes about data collection and analysis.""") - experiment_description: Optional[str] = Field(None, description="""General description of the experiment.""") experimenter: Optional[NDArray[Shape["* num_experimenters"], str]] = Field( None, description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}} + }, + ) + institution: Optional[str] = Field( + None, description="""Institution(s) where experiment was performed.""" ) - institution: Optional[str] = Field(None, description="""Institution(s) where experiment was performed.""") keywords: Optional[NDArray[Shape["* num_keywords"], str]] = Field( None, description="""Terms to search over.""", @@ -306,12 +338,15 @@ class NWBFileGeneral(ConfiguredBaseModel): description="""Description of drugs used, including how and when they were administered. Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc.""", ) protocol: Optional[str] = Field( - None, description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""" + None, + description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""", ) related_publications: Optional[NDArray[Shape["* num_publications"], str]] = Field( None, description="""Publication information. PMID, DOI, URL, etc.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}} + }, ) session_id: Optional[str] = Field(None, description="""Lab-specific ID for the session.""") slices: Optional[str] = Field( @@ -319,7 +354,8 @@ class NWBFileGeneral(ConfiguredBaseModel): description="""Description of slices, including information about preparation thickness, orientation, temperature, and bath solution.""", ) source_script: Optional[NWBFileGeneralSourceScript] = Field( - None, description="""Script file or link to public source code used to create this NWB file.""" + None, + description="""Script file or link to public source code used to create this NWB file.""", ) stimulus: Optional[str] = Field( None, description="""Notes about stimuli, such as how and where they were presented.""" @@ -342,7 +378,8 @@ class NWBFileGeneral(ConfiguredBaseModel): json_schema_extra={"linkml_meta": {"any_of": [{"range": "Device"}]}}, ) subject: Optional[Subject] = Field( - None, description="""Information about the animal or person from which the data was measured.""" + None, + description="""Information about the animal or person from which the data was measured.""", ) extracellular_ephys: Optional[NWBFileGeneralExtracellularEphys] = Field( None, description="""Metadata related to extracellular electrophysiology.""" @@ -371,7 +408,9 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel): name: Literal["source_script"] = Field( "source_script", - json_schema_extra={"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"} + }, ) file_name: Optional[str] = Field(None, description="""Name of script file.""") value: str = Field(...) @@ -385,23 +424,33 @@ class Subject(NWBContainer): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["subject"] = Field( - "subject", json_schema_extra={"linkml_meta": {"equals_string": "subject", "ifabsent": "string(subject)"}} + "subject", + json_schema_extra={ + "linkml_meta": {"equals_string": "subject", "ifabsent": "string(subject)"} + }, + ) + age: Optional[str] = Field( + None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""" ) - age: Optional[str] = Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""") date_of_birth: Optional[np.datetime64] = Field( None, description="""Date of birth of subject. Can be supplied instead of 'age'.""" ) description: Optional[str] = Field( - None, description="""Description of subject and where subject came from (e.g., breeder, if animal).""" + None, + description="""Description of subject and where subject came from (e.g., breeder, if animal).""", + ) + genotype: Optional[str] = Field( + None, description="""Genetic strain. If absent, assume Wild Type (WT).""" ) - genotype: Optional[str] = Field(None, description="""Genetic strain. If absent, assume Wild Type (WT).""") sex: Optional[str] = Field(None, description="""Gender of subject.""") species: Optional[str] = Field(None, description="""Species of subject.""") subject_id: Optional[str] = Field( - None, description="""ID of animal/person used/participating in experiment (lab convention).""" + None, + description="""ID of animal/person used/participating in experiment (lab convention).""", ) weight: Optional[str] = Field( - None, description="""Weight at time of experiment, at time of surgery and at other important times.""" + None, + description="""Weight at time of experiment, at time of surgery and at other important times.""", ) @@ -415,10 +464,15 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel): name: Literal["extracellular_ephys"] = Field( "extracellular_ephys", json_schema_extra={ - "linkml_meta": {"equals_string": "extracellular_ephys", "ifabsent": "string(extracellular_ephys)"} + "linkml_meta": { + "equals_string": "extracellular_ephys", + "ifabsent": "string(extracellular_ephys)", + } }, ) - electrode_group: Optional[List[ElectrodeGroup]] = Field(None, description="""Physical group of electrodes.""") + electrode_group: Optional[List[ElectrodeGroup]] = Field( + None, description="""Physical group of electrodes.""" + ) electrodes: Optional[NWBFileGeneralExtracellularEphysElectrodes] = Field( None, description="""A table of all electrodes (i.e. channels) used for recording.""" ) @@ -433,48 +487,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): name: Literal["electrodes"] = Field( "electrodes", - json_schema_extra={"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"} + }, ) x: NDArray[Any, np.float32] = Field( ..., description="""x coordinate of the channel location in the brain (+x is posterior).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) y: NDArray[Any, np.float32] = Field( ..., description="""y coordinate of the channel location in the brain (+y is inferior).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) z: NDArray[Any, np.float32] = Field( ..., description="""z coordinate of the channel location in the brain (+z is right).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) imp: NDArray[Any, np.float32] = Field( ..., description="""Impedance of the channel.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) location: NDArray[Any, str] = Field( ..., description="""Location of the electrode (channel). 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.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) filtering: NDArray[Any, np.float32] = Field( ..., description="""Description of hardware filtering.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) group: List[ElectrodeGroup] = Field( @@ -484,48 +552,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): ..., description="""Name of the ElectrodeGroup this electrode is a part of.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_x: Optional[NDArray[Any, np.float32]] = Field( None, description="""x coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_y: Optional[NDArray[Any, np.float32]] = Field( None, description="""y coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_z: Optional[NDArray[Any, np.float32]] = Field( None, description="""z coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) reference: Optional[NDArray[Any, str]] = Field( None, description="""Description of the reference used for this electrode.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -541,7 +623,10 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel): name: Literal["intracellular_ephys"] = Field( "intracellular_ephys", json_schema_extra={ - "linkml_meta": {"equals_string": "intracellular_ephys", "ifabsent": "string(intracellular_ephys)"} + "linkml_meta": { + "equals_string": "intracellular_ephys", + "ifabsent": "string(intracellular_ephys)", + } }, ) filtering: Optional[str] = Field( diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_icephys.py index 084608b..2df4422 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_icephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_icephys.py @@ -5,7 +5,12 @@ from enum import Enum import re import sys import numpy as np -from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_3.hdmf_common_table import ( Data, Index, @@ -30,7 +35,15 @@ from ...core.v2_2_2.core_nwb_base import ( Images, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape metamodel_version = "None" @@ -46,7 +59,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -91,7 +106,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.icephys/", "id": "core.nwb.icephys", - "imports": ["core.nwb.base", "core.nwb.device", "../../hdmf_common/v1_1_3/namespace", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "core.nwb.device", + "../../hdmf_common/v1_1_3/namespace", + "core.nwb.language", + ], "name": "core.nwb.icephys", } ) @@ -102,7 +122,9 @@ class PatchClampSeries(TimeSeries): An abstract base class for patch-clamp data - stimulus or response, current or voltage. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) stimulus_description: Optional[str] = Field( @@ -113,7 +135,8 @@ class PatchClampSeries(TimeSeries): ) data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""") gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -137,7 +160,9 @@ class PatchClampSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -153,7 +178,8 @@ class PatchClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -169,13 +195,17 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""") bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""") - capacitance_compensation: Optional[np.float32] = Field(None, description="""Capacitance compensation, in farads.""") + capacitance_compensation: Optional[np.float32] = Field( + None, description="""Capacitance compensation, in farads.""" + ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) @@ -183,7 +213,8 @@ class CurrentClampSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -207,7 +238,9 @@ class CurrentClampSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -223,7 +256,8 @@ class CurrentClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -237,11 +271,15 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""") - bridge_balance: np.float32 = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + bridge_balance: np.float32 = Field( + ..., description="""Bridge balance, in ohms, fixed to 0.0.""" + ) capacitance_compensation: np.float32 = Field( ..., description="""Capacitance compensation, in farads, fixed to 0.0.""" ) @@ -253,7 +291,8 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -277,7 +316,9 @@ class IZeroClampSeries(CurrentClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -290,7 +331,9 @@ class CurrentClampStimulusSeries(PatchClampSeries): Stimulus current applied during current clamp recording. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: CurrentClampStimulusSeriesData = Field(..., description="""Stimulus current applied.""") @@ -301,7 +344,8 @@ class CurrentClampStimulusSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -325,7 +369,9 @@ class CurrentClampStimulusSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -341,7 +387,8 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -355,7 +402,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: VoltageClampSeriesData = Field(..., description="""Recorded current.""") @@ -377,8 +426,8 @@ class VoltageClampSeries(PatchClampSeries): whole_cell_capacitance_comp: Optional[VoltageClampSeriesWholeCellCapacitanceComp] = Field( None, description="""Whole cell capacitance compensation, in farads.""" ) - whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = Field( - None, description="""Whole cell series resistance compensation, in ohms.""" + whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = ( + Field(None, description="""Whole cell series resistance compensation, in ohms.""") ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" @@ -387,7 +436,8 @@ class VoltageClampSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -411,7 +461,9 @@ class VoltageClampSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -427,7 +479,8 @@ class VoltageClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -446,11 +499,15 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): name: Literal["capacitance_fast"] = Field( "capacitance_fast", json_schema_extra={ - "linkml_meta": {"equals_string": "capacitance_fast", "ifabsent": "string(capacitance_fast)"} + "linkml_meta": { + "equals_string": "capacitance_fast", + "ifabsent": "string(capacitance_fast)", + } }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -465,11 +522,15 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): name: Literal["capacitance_slow"] = Field( "capacitance_slow", json_schema_extra={ - "linkml_meta": {"equals_string": "capacitance_slow", "ifabsent": "string(capacitance_slow)"} + "linkml_meta": { + "equals_string": "capacitance_slow", + "ifabsent": "string(capacitance_slow)", + } }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -491,7 +552,8 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""" + None, + description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""", ) value: np.float32 = Field(...) @@ -513,7 +575,8 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""" + None, + description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""", ) value: np.float32 = Field(...) @@ -535,7 +598,8 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""" + None, + description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""", ) value: np.float32 = Field(...) @@ -557,7 +621,8 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -579,7 +644,8 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""" + None, + description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""", ) value: np.float32 = Field(...) @@ -589,7 +655,9 @@ class VoltageClampStimulusSeries(PatchClampSeries): Stimulus voltage applied during a voltage clamp recording. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: VoltageClampStimulusSeriesData = Field(..., description="""Stimulus voltage applied.""") @@ -600,7 +668,8 @@ class VoltageClampStimulusSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -624,7 +693,9 @@ class VoltageClampStimulusSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -640,7 +711,8 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -654,19 +726,27 @@ class IntracellularElectrode(NWBContainer): An intracellular electrode and its metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) - description: str = Field(..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""") + description: str = Field( + ..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""" + ) filtering: Optional[str] = Field(None, description="""Electrode specific filtering.""") - initial_access_resistance: Optional[str] = Field(None, description="""Initial access resistance.""") + initial_access_resistance: Optional[str] = Field( + None, description="""Initial access resistance.""" + ) location: Optional[str] = Field( None, description="""Location of the electrode. 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.""", ) resistance: Optional[str] = Field(None, description="""Electrode resistance, in ohms.""") seal: Optional[str] = Field(None, description="""Information about seal used for recording.""") - slice: Optional[str] = Field(None, description="""Information about slice used for recording.""") + slice: Optional[str] = Field( + None, description="""Information about slice used for recording.""" + ) class SweepTable(DynamicTable): @@ -674,14 +754,18 @@ class SweepTable(DynamicTable): The table which groups different PatchClampSeries together. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) sweep_number: NDArray[Any, np.uint32] = Field( ..., description="""Sweep number of the PatchClampSeries in that row.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) series: List[PatchClampSeries] = Field( @@ -690,19 +774,25 @@ class SweepTable(DynamicTable): series_index: Named[VectorIndex] = Field( ..., description="""Index for series.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_image.py index 9464390..b555724 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_image.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_image.py @@ -19,7 +19,12 @@ from ...core.v2_2_2.core_nwb_base import ( ProcessingModule, Images, ) -from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_3.hdmf_common_table import ( Data, Index, @@ -45,7 +50,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -101,7 +108,9 @@ class GrayscaleImage(Image): A grayscale image. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -122,7 +131,9 @@ class RGBImage(Image): A color image. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -143,7 +154,9 @@ class RGBAImage(Image): A color image with transparency. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -164,11 +177,16 @@ 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]. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: Optional[ - Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] + Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] ] = Field(None, description="""Binary data representing images across frames.""") dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -205,7 +223,9 @@ class ImageSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -222,7 +242,9 @@ class ImageSeriesExternalFile(ConfiguredBaseModel): name: Literal["external_file"] = Field( "external_file", - json_schema_extra={"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"} + }, ) starting_frame: Optional[np.int32] = Field( None, @@ -238,11 +260,16 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: Optional[ - Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] + Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] ] = Field(None, description="""Binary data representing images across frames.""") dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -279,7 +306,9 @@ class ImageMaskSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -292,15 +321,23 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) - distance: Optional[np.float32] = Field(None, description="""Distance from camera/monitor to target/eye.""") + distance: Optional[np.float32] = Field( + None, description="""Distance from camera/monitor to target/eye.""" + ) field_of_view: Optional[ - Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]] + Union[ + NDArray[Shape["2 width_height"], np.float32], + NDArray[Shape["3 width_height_depth"], np.float32], + ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number] + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number], ] = Field(..., description="""Images presented to subject, either grayscale or RGB""") orientation: Optional[str] = Field( None, @@ -341,7 +378,9 @@ class OpticalSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -354,7 +393,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.int32] = Field( @@ -384,7 +425,9 @@ class IndexSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_misc.py index 50402bb..dc05ee6 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_misc.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_misc.py @@ -7,10 +7,23 @@ import sys import numpy as np from ...core.v2_2_2.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from ...core.v2_2_2.core_nwb_ecephys import ElectrodeGroup from numpydantic import NDArray, Shape -from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTable, VectorData, VectorIndex, DynamicTableRegion +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + DynamicTable, + VectorData, + VectorIndex, + DynamicTableRegion, +) metamodel_version = "None" version = "2.2.2" @@ -25,7 +38,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -70,7 +85,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.misc/", "id": "core.nwb.misc", - "imports": ["core.nwb.base", "../../hdmf_common/v1_1_3/namespace", "core.nwb.ecephys", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "../../hdmf_common/v1_1_3/namespace", + "core.nwb.ecephys", + "core.nwb.language", + ], "name": "core.nwb.misc", } ) @@ -81,10 +101,14 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) - data: AbstractFeatureSeriesData = Field(..., description="""Values of each feature at each time.""") + data: AbstractFeatureSeriesData = Field( + ..., description="""Values of each feature at each time.""" + ) feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field( None, description="""Units of each feature.""", @@ -117,7 +141,9 @@ class AbstractFeatureSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -133,14 +159,18 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, description="""Since there can be different units for different features, store the units in 'feature_units'. The default value for this attribute is \"see 'feature_units'\".""", ) array: Optional[ - Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]] + Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_features"], np.number], + ] ] = Field(None) @@ -149,7 +179,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], str] = Field( @@ -179,7 +211,9 @@ class AnnotationSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -192,7 +226,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.int8] = Field( @@ -222,7 +258,9 @@ class IntervalSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -235,10 +273,14 @@ class DecompositionSeries(TimeSeries): Spectral analysis of a time series, e.g. of an LFP or a speech signal. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) - data: DecompositionSeriesData = Field(..., description="""Data decomposed into frequency bands.""") + data: DecompositionSeriesData = Field( + ..., description="""Data decomposed into frequency bands.""" + ) metric: str = Field(..., description="""The metric used, e.g. phase, amplitude, power.""") bands: DecompositionSeriesBands = Field( ..., @@ -266,7 +308,9 @@ class DecompositionSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -282,7 +326,8 @@ class DecompositionSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -292,7 +337,13 @@ class DecompositionSeriesData(ConfiguredBaseModel): None, json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_times"}, {"alias": "num_channels"}, {"alias": "num_bands"}]} + "array": { + "dimensions": [ + {"alias": "num_times"}, + {"alias": "num_channels"}, + {"alias": "num_bands"}, + ] + } } }, ) @@ -306,13 +357,16 @@ class DecompositionSeriesBands(DynamicTable): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["bands"] = Field( - "bands", json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}} + "bands", + json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}}, ) band_name: NDArray[Any, str] = Field( ..., description="""Name of the band, e.g. theta.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field( @@ -320,7 +374,12 @@ class DecompositionSeriesBands(DynamicTable): description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_bands"}, {"alias": "low_high", "exact_cardinality": 2}]} + "array": { + "dimensions": [ + {"alias": "num_bands"}, + {"alias": "low_high", "exact_cardinality": 2}, + ] + } } }, ) @@ -338,13 +397,17 @@ class DecompositionSeriesBands(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -355,38 +418,55 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field("Units", json_schema_extra={"linkml_meta": {"ifabsent": "string(Units)"}}) spike_times_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the spike_times dataset.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, + ) + spike_times: Optional[UnitsSpikeTimes] = Field( + None, description="""Spike times for each unit.""" ) - spike_times: Optional[UnitsSpikeTimes] = Field(None, description="""Spike times for each unit.""") obs_intervals_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the obs_intervals dataset.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field( None, description="""Observation intervals for each unit.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_intervals"}, {"alias": "start_end", "exact_cardinality": 2}]} + "array": { + "dimensions": [ + {"alias": "num_intervals"}, + {"alias": "start_end", "exact_cardinality": 2}, + ] + } } }, ) electrodes_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into electrodes.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) electrodes: Named[Optional[DynamicTableRegion]] = Field( None, description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) electrode_group: Optional[List[ElectrodeGroup]] = Field( None, description="""Electrode group that each spike unit came from.""" @@ -407,13 +487,17 @@ class Units(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -428,13 +512,17 @@ class UnitsSpikeTimes(VectorData): name: Literal["spike_times"] = Field( "spike_times", - json_schema_extra={"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"} + }, ) resolution: Optional[np.float64] = Field( None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""", ) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ogen.py index f5c1728..9dd1568 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ogen.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ogen.py @@ -8,7 +8,12 @@ from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator import numpy as np from numpydantic import NDArray, Shape -from ...core.v2_2_2.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync, NWBContainer +from ...core.v2_2_2.core_nwb_base import ( + TimeSeries, + TimeSeriesStartingTime, + TimeSeriesSync, + NWBContainer, +) metamodel_version = "None" version = "2.2.2" @@ -23,7 +28,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,7 +86,9 @@ class OptogeneticSeries(TimeSeries): An optogenetic stimulus. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ogen", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.number] = Field( @@ -109,7 +118,9 @@ class OptogeneticSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -122,7 +133,9 @@ class OptogeneticStimulusSite(NWBContainer): A site of optogenetic stimulation. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ogen", "tree_root": True} + ) name: str = Field(...) description: str = Field(..., description="""Description of stimulation site.""") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ophys.py index 67de4fa..f0dfc8d 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ophys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ophys.py @@ -18,7 +18,12 @@ from ...core.v2_2_2.core_nwb_base import ( ProcessingModule, Images, ) -from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_3.hdmf_common_table import ( Data, Index, @@ -40,7 +45,15 @@ from ...core.v2_2_2.core_nwb_image import ( IndexSeries, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape metamodel_version = "None" @@ -56,7 +69,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -118,7 +133,9 @@ class TwoPhotonSeries(ImageSeries): Image stack recorded over time from 2-photon microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") @@ -127,10 +144,16 @@ class TwoPhotonSeries(ImageSeries): description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) field_of_view: Optional[ - Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height"], np.float32]] + Union[ + NDArray[Shape["2 width_height"], np.float32], + NDArray[Shape["3 width_height"], np.float32], + ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Optional[ - Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] + Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] ] = Field(None, description="""Binary data representing images across frames.""") dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -167,7 +190,9 @@ class TwoPhotonSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -180,16 +205,21 @@ class RoiResponseSeries(TimeSeries): ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) - data: Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_rois"], np.number]] = Field( - ..., description="""Signals from ROIs.""" - ) + data: Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_rois"], np.number], + ] = Field(..., description="""Signals from ROIs.""") rois: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -213,7 +243,9 @@ class RoiResponseSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -226,7 +258,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[RoiResponseSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}} @@ -239,7 +273,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[RoiResponseSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}} @@ -252,7 +288,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[DynamicTable]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "DynamicTable"}]}} @@ -265,7 +303,9 @@ class ImagingPlane(NWBContainer): An imaging plane and its metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[NWBContainer]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}]}} @@ -278,7 +318,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[NWBDataInterface]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_retinotopy.py index 7acdd6e..c9add37 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_retinotopy.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_retinotopy.py @@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,9 +81,14 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.retinotopy", "tree_root": True} + ) - name: str = Field("ImagingRetinotopy", json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}}) + name: str = Field( + "ImagingRetinotopy", + json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}}, + ) axis_1_phase_map: ImagingRetinotopyAxis1PhaseMap = Field( ..., description="""Phase response to stimulus on the first measured axis.""" ) @@ -100,7 +107,9 @@ class ImagingRetinotopy(NWBDataInterface): ..., description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]} + } }, ) focal_depth_image: Optional[ImagingRetinotopyFocalDepthImage] = Field( @@ -108,10 +117,12 @@ class ImagingRetinotopy(NWBDataInterface): description="""Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].""", ) sign_map: Optional[ImagingRetinotopySignMap] = Field( - None, description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""" + None, + description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""", ) vasculature_image: ImagingRetinotopyVasculatureImage = Field( - ..., description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""" + ..., + description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""", ) @@ -125,18 +136,27 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): name: Literal["axis_1_phase_map"] = Field( "axis_1_phase_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_1_phase_map", "ifabsent": "string(axis_1_phase_map)"} + "linkml_meta": { + "equals_string": "axis_1_phase_map", + "ifabsent": "string(axis_1_phase_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -150,18 +170,27 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): name: Literal["axis_1_power_map"] = Field( "axis_1_power_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_1_power_map", "ifabsent": "string(axis_1_power_map)"} + "linkml_meta": { + "equals_string": "axis_1_power_map", + "ifabsent": "string(axis_1_power_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -175,18 +204,27 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): name: Literal["axis_2_phase_map"] = Field( "axis_2_phase_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_2_phase_map", "ifabsent": "string(axis_2_phase_map)"} + "linkml_meta": { + "equals_string": "axis_2_phase_map", + "ifabsent": "string(axis_2_phase_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -200,18 +238,27 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): name: Literal["axis_2_power_map"] = Field( "axis_2_power_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_2_power_map", "ifabsent": "string(axis_2_power_map)"} + "linkml_meta": { + "equals_string": "axis_2_power_map", + "ifabsent": "string(axis_2_power_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -225,7 +272,10 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): name: Literal["focal_depth_image"] = Field( "focal_depth_image", json_schema_extra={ - "linkml_meta": {"equals_string": "focal_depth_image", "ifabsent": "string(focal_depth_image)"} + "linkml_meta": { + "equals_string": "focal_depth_image", + "ifabsent": "string(focal_depth_image)", + } }, ) bits_per_pixel: Optional[np.int32] = Field( @@ -236,12 +286,20 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - focal_depth: Optional[np.float32] = Field(None, description="""Focal depth offset, in meters.""") - format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + focal_depth: Optional[np.float32] = Field( + None, description="""Focal depth offset, in meters.""" + ) + format: Optional[str] = Field( + None, description="""Format of image. Right now only 'raw' is supported.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -253,16 +311,23 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy"}) name: Literal["sign_map"] = Field( - "sign_map", json_schema_extra={"linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"}} + "sign_map", + json_schema_extra={ + "linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"} + }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -276,7 +341,10 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): name: Literal["vasculature_image"] = Field( "vasculature_image", json_schema_extra={ - "linkml_meta": {"equals_string": "vasculature_image", "ifabsent": "string(vasculature_image)"} + "linkml_meta": { + "equals_string": "vasculature_image", + "ifabsent": "string(vasculature_image)", + } }, ) bits_per_pixel: Optional[np.int32] = Field( @@ -287,11 +355,17 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + format: Optional[str] = Field( + None, description="""Format of image. Right now only 'raw' is supported.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/namespace.py index 915adfc..395e23e 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/namespace.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/namespace.py @@ -7,7 +7,12 @@ import sys from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator import numpy as np -from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_3.hdmf_common_table import ( Data, Index, @@ -143,7 +148,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/__init__.py index 8d1c8b6..8b13789 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/__init__.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/__init__.py @@ -1 +1 @@ - + diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_base.py index a88bd21..9ea7cb3 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_base.py @@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,7 +81,9 @@ class NWBData(Data): An abstract data type for a dataset. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -89,7 +93,9 @@ 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)). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -110,7 +116,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -120,7 +128,9 @@ class NWBDataInterface(NWBContainer): An abstract data type for a generic container storing collections of data, as opposed to metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -130,7 +140,9 @@ class TimeSeries(NWBDataInterface): General purpose time series. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of the time series.""") @@ -159,7 +171,9 @@ class TimeSeries(NWBDataInterface): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -175,7 +189,8 @@ class TimeSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) conversion: Optional[np.float32] = Field( None, @@ -208,10 +223,14 @@ class TimeSeriesStartingTime(ConfiguredBaseModel): name: Literal["starting_time"] = Field( "starting_time", - json_schema_extra={"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"} + }, ) rate: Optional[np.float32] = Field(None, description="""Sampling rate, in Hz.""") - unit: Optional[str] = Field(None, description="""Unit of measurement for time, which is fixed to 'seconds'.""") + unit: Optional[str] = Field( + None, description="""Unit of measurement for time, which is fixed to 'seconds'.""" + ) value: np.float64 = Field(...) @@ -223,7 +242,8 @@ class TimeSeriesSync(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"}) name: Literal["sync"] = Field( - "sync", json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}} + "sync", + json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}}, ) @@ -232,10 +252,15 @@ class ProcessingModule(NWBContainer): A collection of processed data. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) children: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field( - None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}} + None, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]} + }, ) name: str = Field(...) @@ -245,10 +270,14 @@ class Images(NWBDataInterface): A collection of images. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field("Images", json_schema_extra={"linkml_meta": {"ifabsent": "string(Images)"}}) - description: Optional[str] = Field(None, description="""Description of this collection of images.""") + description: Optional[str] = Field( + None, description="""Description of this collection of images.""" + ) image: List[Image] = Field(..., description="""Images stored in this collection.""") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_behavior.py index 8837068..a107f25 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_behavior.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_behavior.py @@ -44,7 +44,12 @@ from ...core.v2_2_4.core_nwb_base import ( ProcessingModule, Images, ) -from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_3.hdmf_common_table import ( Data, Index, @@ -70,7 +75,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -126,11 +133,14 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) name: str = Field(...) data: SpatialSeriesData = Field( - ..., description="""1-D or 2-D array storing position or direction relative to some reference frame.""" + ..., + description="""1-D or 2-D array storing position or direction relative to some reference frame.""", ) reference_frame: Optional[str] = Field( None, description="""Description defining what exactly 'straight-ahead' means.""" @@ -157,7 +167,9 @@ class SpatialSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -173,14 +185,18 @@ class SpatialSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, description="""Base unit of measurement for working with the data. The default value is 'meters'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) array: Optional[ - Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]] + Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_features"], np.number], + ] ] = Field(None) @@ -189,7 +205,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[IntervalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "IntervalSeries"}]}} @@ -202,7 +220,9 @@ class BehavioralEvents(NWBDataInterface): TimeSeries for storing behavioral events. See description of BehavioralEpochs for more details. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -215,7 +235,9 @@ class BehavioralTimeSeries(NWBDataInterface): TimeSeries for storing Behavoioral time series data. See description of BehavioralEpochs for more details. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -228,7 +250,9 @@ class PupilTracking(NWBDataInterface): Eye-tracking data, representing pupil size. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -241,7 +265,9 @@ class EyeTracking(NWBDataInterface): Eye-tracking data, representing direction of gaze. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} @@ -254,7 +280,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} @@ -267,7 +295,9 @@ class Position(NWBDataInterface): Position data, whether along the x, x/y or x/y/z axis. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_device.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_device.py index 24249c2..fc0ff49 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_device.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_device.py @@ -22,7 +22,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -62,14 +64,18 @@ class Device(NWBContainer): Metadata about a data acquisition device, e.g., recording system, electrode, microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.device", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.device", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field( None, description="""Description of the device (e.g., model, firmware version, processing software version, etc.) as free-form text.""", ) - manufacturer: Optional[str] = Field(None, description="""The name of the manufacturer of the device.""") + manufacturer: Optional[str] = Field( + None, description="""The name of the manufacturer of the device.""" + ) # Model rebuild diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ecephys.py index afe1ace..f52bc43 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ecephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ecephys.py @@ -7,7 +7,15 @@ import sys import numpy as np from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTableRegion from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from ...core.v2_2_4.core_nwb_base import ( TimeSeries, TimeSeriesStartingTime, @@ -30,7 +38,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -75,7 +85,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.ecephys/", "id": "core.nwb.ecephys", - "imports": ["core.nwb.base", "../../hdmf_common/v1_1_3/namespace", "core.nwb.device", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "../../hdmf_common/v1_1_3/namespace", + "core.nwb.device", + "core.nwb.language", + ], "name": "core.nwb.ecephys", } ) @@ -86,7 +101,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) data: Union[ @@ -97,7 +114,9 @@ class ElectricalSeries(TimeSeries): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( None, @@ -126,7 +145,9 @@ class ElectricalSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -139,7 +160,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) data: Union[ @@ -154,7 +177,9 @@ class SpikeEventSeries(ElectricalSeries): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( None, @@ -178,7 +203,9 @@ class SpikeEventSeries(ElectricalSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -191,9 +218,14 @@ class FeatureExtraction(NWBDataInterface): Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("FeatureExtraction", json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}}) + name: str = Field( + "FeatureExtraction", + json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}}, + ) description: NDArray[Shape["* num_features"], str] = Field( ..., description="""Description of features (eg, ''PC1'') for each of the extracted features.""", @@ -204,7 +236,13 @@ class FeatureExtraction(NWBDataInterface): description="""Multi-dimensional array of features extracted from each event.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_events"}, {"alias": "num_channels"}, {"alias": "num_features"}]} + "array": { + "dimensions": [ + {"alias": "num_events"}, + {"alias": "num_channels"}, + {"alias": "num_features"}, + ] + } } }, ) @@ -216,7 +254,9 @@ class FeatureExtraction(NWBDataInterface): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) @@ -225,9 +265,13 @@ class EventDetection(NWBDataInterface): Detected spike events from voltage trace(s). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}}) + name: str = Field( + "EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}} + ) detection_method: str = Field( ..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""", @@ -249,7 +293,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[SpikeEventSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpikeEventSeries"}]}} @@ -262,7 +308,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[ElectricalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}} @@ -275,7 +323,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[ElectricalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}} @@ -288,7 +338,9 @@ class ElectrodeGroup(NWBContainer): A physical grouping of electrodes, e.g. a shank of an array. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of this electrode group.""") @@ -309,7 +361,10 @@ class ElectrodeGroupPosition(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"}) name: Literal["position"] = Field( - "position", json_schema_extra={"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}} + "position", + json_schema_extra={ + "linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"} + }, ) x: Optional[np.float32] = Field(None, description="""x coordinate""") y: Optional[np.float32] = Field(None, description="""y coordinate""") @@ -321,22 +376,33 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("ClusterWaveforms", json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}}) - waveform_filtering: str = Field(..., description="""Filtering applied to data before generating mean/sd""") + name: str = Field( + "ClusterWaveforms", + json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}}, + ) + waveform_filtering: str = Field( + ..., description="""Filtering applied to data before generating mean/sd""" + ) waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( ..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]} + } }, ) waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( ..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]} + } }, ) @@ -346,9 +412,13 @@ class Clustering(NWBDataInterface): DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}}) + name: str = Field( + "Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}} + ) description: str = Field( ..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_epoch.py index 1b669f5..e608030 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_epoch.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_epoch.py @@ -6,7 +6,15 @@ import re import sys import numpy as np from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTable, VectorIndex, VectorData from ...core.v2_2_4.core_nwb_base import TimeSeries @@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -80,52 +90,70 @@ class TimeIntervals(DynamicTable): A container for aggregating epoch data and the TimeSeries that each epoch applies to. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.epoch", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.epoch", "tree_root": True} + ) name: str = Field(...) start_time: NDArray[Any, np.float32] = Field( ..., description="""Start time of epoch, in seconds.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) stop_time: NDArray[Any, np.float32] = Field( ..., description="""Stop time of epoch, in seconds.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) tags: Optional[NDArray[Any, str]] = Field( None, description="""User-defined tags that identify or categorize events.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) tags_index: Named[Optional[VectorIndex]] = Field( None, description="""Index for tags.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, + ) + timeseries: Optional[TimeIntervalsTimeseries] = Field( + None, description="""An index into a TimeSeries object.""" ) - timeseries: Optional[TimeIntervalsTimeseries] = Field(None, description="""An index into a TimeSeries object.""") timeseries_index: Named[Optional[VectorIndex]] = Field( None, description="""Index for timeseries.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -140,17 +168,24 @@ class TimeIntervalsTimeseries(VectorData): name: Literal["timeseries"] = Field( "timeseries", - json_schema_extra={"linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"} + }, ) idx_start: Optional[np.int32] = Field( None, description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) count: Optional[np.int32] = Field( - None, description="""Number of data samples available in this time series, during this epoch.""" + None, + description="""Number of data samples available in this time series, during this epoch.""", + ) + timeseries: Optional[TimeSeries] = Field( + None, description="""the TimeSeries that this index applies to.""" + ) + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" ) - timeseries: Optional[TimeSeries] = Field(None, description="""the TimeSeries that this index applies to.""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") array: Optional[ Union[ NDArray[Shape["* dim0"], Any], diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_file.py index 0f1c322..7b33bbc 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_file.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_file.py @@ -44,7 +44,12 @@ from ...core.v2_2_4.core_nwb_base import ( ProcessingModule, Images, ) -from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_3.hdmf_common_table import ( Data, Index, @@ -119,7 +124,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -186,10 +193,14 @@ class ScratchData(NWBData): Any one-off datasets """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: str = Field(...) - notes: Optional[str] = Field(None, description="""Any notes the user has about the dataset being stored""") + notes: Optional[str] = Field( + None, description="""Any notes the user has about the dataset being stored""" + ) class NWBFile(NWBContainer): @@ -197,10 +208,13 @@ class NWBFile(NWBContainer): An NWB:N file storing cellular-based neurophysiology data from a single experimental session. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: Literal["root"] = Field( - "root", json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}} + "root", + json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}}, ) nwb_version: Optional[str] = Field( None, @@ -209,7 +223,9 @@ class NWBFile(NWBContainer): file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = Field( ..., description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}} + }, ) identifier: str = Field( ..., @@ -229,17 +245,23 @@ class NWBFile(NWBContainer): acquisition: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field( None, description="""Data streams recorded from the system, including ephys, ophys, tracking, etc. This group should be read-only after the experiment is completed and timestamps are corrected to a common timebase. The data stored here may be links to raw data stored in external NWB files. This will allow keeping bulky raw data out of the file while preserving the option of keeping some/all in the file. Acquired data includes tracking and experimental data streams (i.e., everything measured from the system). If bulky data is stored in the /acquisition group, the data can exist in a separate NWB file that is linked to by the file being used for processing and analysis.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]} + }, ) analysis: Optional[List[Union[DynamicTable, NWBContainer]]] = Field( None, description="""Lab-specific and custom scientific analysis of data. There is no defined format for the content of this group - the format is up to the individual user/lab. To facilitate sharing analysis data between labs, the contents here should be stored in standard types (e.g., neurodata_types) and appropriately documented. The file can store lab-specific and custom data analysis without restriction on its form or schema, reducing data formatting restrictions on end users. Such data should be placed in the analysis group. The analysis data should be documented so that it could be shared with other labs.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]} + }, ) scratch: Optional[List[Union[DynamicTable, NWBContainer]]] = Field( None, description="""A place to store one-off analysis results. Data placed here is not intended for sharing. By placing data here, users acknowledge that there is no guarantee that their data meets any standard.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]} + }, ) processing: Optional[List[ProcessingModule]] = Field( None, @@ -279,7 +301,10 @@ class NWBFileStimulus(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["stimulus"] = Field( - "stimulus", json_schema_extra={"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}} + "stimulus", + json_schema_extra={ + "linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"} + }, ) presentation: Optional[List[TimeSeries]] = Field( None, @@ -301,16 +326,27 @@ class NWBFileGeneral(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["general"] = Field( - "general", json_schema_extra={"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}} + "general", + json_schema_extra={ + "linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"} + }, + ) + data_collection: Optional[str] = Field( + None, description="""Notes about data collection and analysis.""" + ) + experiment_description: Optional[str] = Field( + None, description="""General description of the experiment.""" ) - data_collection: Optional[str] = Field(None, description="""Notes about data collection and analysis.""") - experiment_description: Optional[str] = Field(None, description="""General description of the experiment.""") experimenter: Optional[NDArray[Shape["* num_experimenters"], str]] = Field( None, description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}} + }, + ) + institution: Optional[str] = Field( + None, description="""Institution(s) where experiment was performed.""" ) - institution: Optional[str] = Field(None, description="""Institution(s) where experiment was performed.""") keywords: Optional[NDArray[Shape["* num_keywords"], str]] = Field( None, description="""Terms to search over.""", @@ -323,12 +359,15 @@ class NWBFileGeneral(ConfiguredBaseModel): description="""Description of drugs used, including how and when they were administered. Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc.""", ) protocol: Optional[str] = Field( - None, description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""" + None, + description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""", ) related_publications: Optional[NDArray[Shape["* num_publications"], str]] = Field( None, description="""Publication information. PMID, DOI, URL, etc.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}} + }, ) session_id: Optional[str] = Field(None, description="""Lab-specific ID for the session.""") slices: Optional[str] = Field( @@ -336,7 +375,8 @@ class NWBFileGeneral(ConfiguredBaseModel): description="""Description of slices, including information about preparation thickness, orientation, temperature, and bath solution.""", ) source_script: Optional[NWBFileGeneralSourceScript] = Field( - None, description="""Script file or link to public source code used to create this NWB file.""" + None, + description="""Script file or link to public source code used to create this NWB file.""", ) stimulus: Optional[str] = Field( None, description="""Notes about stimuli, such as how and where they were presented.""" @@ -359,7 +399,8 @@ class NWBFileGeneral(ConfiguredBaseModel): json_schema_extra={"linkml_meta": {"any_of": [{"range": "Device"}]}}, ) subject: Optional[Subject] = Field( - None, description="""Information about the animal or person from which the data was measured.""" + None, + description="""Information about the animal or person from which the data was measured.""", ) extracellular_ephys: Optional[NWBFileGeneralExtracellularEphys] = Field( None, description="""Metadata related to extracellular electrophysiology.""" @@ -388,7 +429,9 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel): name: Literal["source_script"] = Field( "source_script", - json_schema_extra={"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"} + }, ) file_name: Optional[str] = Field(None, description="""Name of script file.""") value: str = Field(...) @@ -404,10 +447,15 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel): name: Literal["extracellular_ephys"] = Field( "extracellular_ephys", json_schema_extra={ - "linkml_meta": {"equals_string": "extracellular_ephys", "ifabsent": "string(extracellular_ephys)"} + "linkml_meta": { + "equals_string": "extracellular_ephys", + "ifabsent": "string(extracellular_ephys)", + } }, ) - electrode_group: Optional[List[ElectrodeGroup]] = Field(None, description="""Physical group of electrodes.""") + electrode_group: Optional[List[ElectrodeGroup]] = Field( + None, description="""Physical group of electrodes.""" + ) electrodes: Optional[NWBFileGeneralExtracellularEphysElectrodes] = Field( None, description="""A table of all electrodes (i.e. channels) used for recording.""" ) @@ -422,48 +470,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): name: Literal["electrodes"] = Field( "electrodes", - json_schema_extra={"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"} + }, ) x: NDArray[Any, np.float32] = Field( ..., description="""x coordinate of the channel location in the brain (+x is posterior).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) y: NDArray[Any, np.float32] = Field( ..., description="""y coordinate of the channel location in the brain (+y is inferior).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) z: NDArray[Any, np.float32] = Field( ..., description="""z coordinate of the channel location in the brain (+z is right).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) imp: NDArray[Any, np.float32] = Field( ..., description="""Impedance of the channel.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) location: NDArray[Any, str] = Field( ..., description="""Location of the electrode (channel). 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.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) filtering: NDArray[Any, np.float32] = Field( ..., description="""Description of hardware filtering.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) group: List[ElectrodeGroup] = Field( @@ -473,48 +535,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): ..., description="""Name of the ElectrodeGroup this electrode is a part of.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_x: Optional[NDArray[Any, np.float32]] = Field( None, description="""x coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_y: Optional[NDArray[Any, np.float32]] = Field( None, description="""y coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_z: Optional[NDArray[Any, np.float32]] = Field( None, description="""z coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) reference: Optional[NDArray[Any, str]] = Field( None, description="""Description of the reference used for this electrode.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -530,7 +606,10 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel): name: Literal["intracellular_ephys"] = Field( "intracellular_ephys", json_schema_extra={ - "linkml_meta": {"equals_string": "intracellular_ephys", "ifabsent": "string(intracellular_ephys)"} + "linkml_meta": { + "equals_string": "intracellular_ephys", + "ifabsent": "string(intracellular_ephys)", + } }, ) filtering: Optional[str] = Field( @@ -550,7 +629,9 @@ class LabMetaData(NWBContainer): Lab-specific meta-data. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: str = Field(...) @@ -560,24 +641,33 @@ class Subject(NWBContainer): Information about the animal or person from which the data was measured. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: str = Field(...) - age: Optional[str] = Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""") + age: Optional[str] = Field( + None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""" + ) date_of_birth: Optional[np.datetime64] = Field( None, description="""Date of birth of subject. Can be supplied instead of 'age'.""" ) description: Optional[str] = Field( - None, description="""Description of subject and where subject came from (e.g., breeder, if animal).""" + None, + description="""Description of subject and where subject came from (e.g., breeder, if animal).""", + ) + genotype: Optional[str] = Field( + None, description="""Genetic strain. If absent, assume Wild Type (WT).""" ) - genotype: Optional[str] = Field(None, description="""Genetic strain. If absent, assume Wild Type (WT).""") sex: Optional[str] = Field(None, description="""Gender of subject.""") species: Optional[str] = Field(None, description="""Species of subject.""") subject_id: Optional[str] = Field( - None, description="""ID of animal/person used/participating in experiment (lab convention).""" + None, + description="""ID of animal/person used/participating in experiment (lab convention).""", ) weight: Optional[str] = Field( - None, description="""Weight at time of experiment, at time of surgery and at other important times.""" + None, + description="""Weight at time of experiment, at time of surgery and at other important times.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_icephys.py index 86c144b..fccc547 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_icephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_icephys.py @@ -5,7 +5,12 @@ from enum import Enum import re import sys import numpy as np -from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_3.hdmf_common_table import ( Data, Index, @@ -30,7 +35,15 @@ from ...core.v2_2_4.core_nwb_base import ( Images, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape metamodel_version = "None" @@ -46,7 +59,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -91,7 +106,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.icephys/", "id": "core.nwb.icephys", - "imports": ["core.nwb.base", "core.nwb.device", "../../hdmf_common/v1_1_3/namespace", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "core.nwb.device", + "../../hdmf_common/v1_1_3/namespace", + "core.nwb.language", + ], "name": "core.nwb.icephys", } ) @@ -102,7 +122,9 @@ class PatchClampSeries(TimeSeries): An abstract base class for patch-clamp data - stimulus or response, current or voltage. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) stimulus_description: Optional[str] = Field( @@ -113,7 +135,8 @@ class PatchClampSeries(TimeSeries): ) data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""") gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -137,7 +160,9 @@ class PatchClampSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -153,7 +178,8 @@ class PatchClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -169,13 +195,17 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""") bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""") - capacitance_compensation: Optional[np.float32] = Field(None, description="""Capacitance compensation, in farads.""") + capacitance_compensation: Optional[np.float32] = Field( + None, description="""Capacitance compensation, in farads.""" + ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) @@ -183,7 +213,8 @@ class CurrentClampSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -207,7 +238,9 @@ class CurrentClampSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -223,7 +256,8 @@ class CurrentClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -237,11 +271,15 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""") - bridge_balance: np.float32 = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + bridge_balance: np.float32 = Field( + ..., description="""Bridge balance, in ohms, fixed to 0.0.""" + ) capacitance_compensation: np.float32 = Field( ..., description="""Capacitance compensation, in farads, fixed to 0.0.""" ) @@ -253,7 +291,8 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -277,7 +316,9 @@ class IZeroClampSeries(CurrentClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -290,7 +331,9 @@ class CurrentClampStimulusSeries(PatchClampSeries): Stimulus current applied during current clamp recording. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: CurrentClampStimulusSeriesData = Field(..., description="""Stimulus current applied.""") @@ -301,7 +344,8 @@ class CurrentClampStimulusSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -325,7 +369,9 @@ class CurrentClampStimulusSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -341,7 +387,8 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -355,7 +402,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: VoltageClampSeriesData = Field(..., description="""Recorded current.""") @@ -377,8 +426,8 @@ class VoltageClampSeries(PatchClampSeries): whole_cell_capacitance_comp: Optional[VoltageClampSeriesWholeCellCapacitanceComp] = Field( None, description="""Whole cell capacitance compensation, in farads.""" ) - whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = Field( - None, description="""Whole cell series resistance compensation, in ohms.""" + whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = ( + Field(None, description="""Whole cell series resistance compensation, in ohms.""") ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" @@ -387,7 +436,8 @@ class VoltageClampSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -411,7 +461,9 @@ class VoltageClampSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -427,7 +479,8 @@ class VoltageClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -446,11 +499,15 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): name: Literal["capacitance_fast"] = Field( "capacitance_fast", json_schema_extra={ - "linkml_meta": {"equals_string": "capacitance_fast", "ifabsent": "string(capacitance_fast)"} + "linkml_meta": { + "equals_string": "capacitance_fast", + "ifabsent": "string(capacitance_fast)", + } }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -465,11 +522,15 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): name: Literal["capacitance_slow"] = Field( "capacitance_slow", json_schema_extra={ - "linkml_meta": {"equals_string": "capacitance_slow", "ifabsent": "string(capacitance_slow)"} + "linkml_meta": { + "equals_string": "capacitance_slow", + "ifabsent": "string(capacitance_slow)", + } }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -491,7 +552,8 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""" + None, + description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""", ) value: np.float32 = Field(...) @@ -513,7 +575,8 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""" + None, + description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""", ) value: np.float32 = Field(...) @@ -535,7 +598,8 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""" + None, + description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""", ) value: np.float32 = Field(...) @@ -557,7 +621,8 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -579,7 +644,8 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""" + None, + description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""", ) value: np.float32 = Field(...) @@ -589,7 +655,9 @@ class VoltageClampStimulusSeries(PatchClampSeries): Stimulus voltage applied during a voltage clamp recording. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: VoltageClampStimulusSeriesData = Field(..., description="""Stimulus voltage applied.""") @@ -600,7 +668,8 @@ class VoltageClampStimulusSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -624,7 +693,9 @@ class VoltageClampStimulusSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -640,7 +711,8 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -654,19 +726,27 @@ class IntracellularElectrode(NWBContainer): An intracellular electrode and its metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) - description: str = Field(..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""") + description: str = Field( + ..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""" + ) filtering: Optional[str] = Field(None, description="""Electrode specific filtering.""") - initial_access_resistance: Optional[str] = Field(None, description="""Initial access resistance.""") + initial_access_resistance: Optional[str] = Field( + None, description="""Initial access resistance.""" + ) location: Optional[str] = Field( None, description="""Location of the electrode. 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.""", ) resistance: Optional[str] = Field(None, description="""Electrode resistance, in ohms.""") seal: Optional[str] = Field(None, description="""Information about seal used for recording.""") - slice: Optional[str] = Field(None, description="""Information about slice used for recording.""") + slice: Optional[str] = Field( + None, description="""Information about slice used for recording.""" + ) class SweepTable(DynamicTable): @@ -674,14 +754,18 @@ class SweepTable(DynamicTable): The table which groups different PatchClampSeries together. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) sweep_number: NDArray[Any, np.uint32] = Field( ..., description="""Sweep number of the PatchClampSeries in that row.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) series: List[PatchClampSeries] = Field( @@ -690,19 +774,25 @@ class SweepTable(DynamicTable): series_index: Named[VectorIndex] = Field( ..., description="""Index for series.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_image.py index 553819a..a7c3c9a 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_image.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_image.py @@ -19,7 +19,12 @@ from ...core.v2_2_4.core_nwb_base import ( ProcessingModule, Images, ) -from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_3.hdmf_common_table import ( Data, Index, @@ -45,7 +50,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -101,7 +108,9 @@ class GrayscaleImage(Image): A grayscale image. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -122,7 +131,9 @@ class RGBImage(Image): A color image. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -143,7 +154,9 @@ class RGBAImage(Image): A color image with transparency. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -164,11 +177,16 @@ 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]. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: Optional[ - Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] + Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] ] = Field(None, description="""Binary data representing images across frames.""") dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -205,7 +223,9 @@ class ImageSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -222,7 +242,9 @@ class ImageSeriesExternalFile(ConfiguredBaseModel): name: Literal["external_file"] = Field( "external_file", - json_schema_extra={"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"} + }, ) starting_frame: Optional[np.int32] = Field( None, @@ -238,11 +260,16 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: Optional[ - Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] + Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] ] = Field(None, description="""Binary data representing images across frames.""") dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -279,7 +306,9 @@ class ImageMaskSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -292,15 +321,23 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) - distance: Optional[np.float32] = Field(None, description="""Distance from camera/monitor to target/eye.""") + distance: Optional[np.float32] = Field( + None, description="""Distance from camera/monitor to target/eye.""" + ) field_of_view: Optional[ - Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]] + Union[ + NDArray[Shape["2 width_height"], np.float32], + NDArray[Shape["3 width_height_depth"], np.float32], + ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number] + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number], ] = Field(..., description="""Images presented to subject, either grayscale or RGB""") orientation: Optional[str] = Field( None, @@ -341,7 +378,9 @@ class OpticalSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -354,7 +393,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.int32] = Field( @@ -384,7 +425,9 @@ class IndexSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_misc.py index 2e7f977..3273444 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_misc.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_misc.py @@ -7,10 +7,23 @@ import sys import numpy as np from ...core.v2_2_4.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from ...core.v2_2_4.core_nwb_ecephys import ElectrodeGroup from numpydantic import NDArray, Shape -from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTable, VectorData, VectorIndex, DynamicTableRegion +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + DynamicTable, + VectorData, + VectorIndex, + DynamicTableRegion, +) metamodel_version = "None" version = "2.2.4" @@ -25,7 +38,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -70,7 +85,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.misc/", "id": "core.nwb.misc", - "imports": ["core.nwb.base", "../../hdmf_common/v1_1_3/namespace", "core.nwb.ecephys", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "../../hdmf_common/v1_1_3/namespace", + "core.nwb.ecephys", + "core.nwb.language", + ], "name": "core.nwb.misc", } ) @@ -81,10 +101,14 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) - data: AbstractFeatureSeriesData = Field(..., description="""Values of each feature at each time.""") + data: AbstractFeatureSeriesData = Field( + ..., description="""Values of each feature at each time.""" + ) feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field( None, description="""Units of each feature.""", @@ -117,7 +141,9 @@ class AbstractFeatureSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -133,14 +159,18 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, description="""Since there can be different units for different features, store the units in 'feature_units'. The default value for this attribute is \"see 'feature_units'\".""", ) array: Optional[ - Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]] + Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_features"], np.number], + ] ] = Field(None) @@ -149,7 +179,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], str] = Field( @@ -179,7 +211,9 @@ class AnnotationSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -192,7 +226,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.int8] = Field( @@ -222,7 +258,9 @@ class IntervalSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -235,10 +273,14 @@ class DecompositionSeries(TimeSeries): Spectral analysis of a time series, e.g. of an LFP or a speech signal. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) - data: DecompositionSeriesData = Field(..., description="""Data decomposed into frequency bands.""") + data: DecompositionSeriesData = Field( + ..., description="""Data decomposed into frequency bands.""" + ) metric: str = Field(..., description="""The metric used, e.g. phase, amplitude, power.""") bands: DecompositionSeriesBands = Field( ..., @@ -266,7 +308,9 @@ class DecompositionSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -282,7 +326,8 @@ class DecompositionSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -292,7 +337,13 @@ class DecompositionSeriesData(ConfiguredBaseModel): None, json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_times"}, {"alias": "num_channels"}, {"alias": "num_bands"}]} + "array": { + "dimensions": [ + {"alias": "num_times"}, + {"alias": "num_channels"}, + {"alias": "num_bands"}, + ] + } } }, ) @@ -306,13 +357,16 @@ class DecompositionSeriesBands(DynamicTable): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["bands"] = Field( - "bands", json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}} + "bands", + json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}}, ) band_name: NDArray[Any, str] = Field( ..., description="""Name of the band, e.g. theta.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field( @@ -320,7 +374,12 @@ class DecompositionSeriesBands(DynamicTable): description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_bands"}, {"alias": "low_high", "exact_cardinality": 2}]} + "array": { + "dimensions": [ + {"alias": "num_bands"}, + {"alias": "low_high", "exact_cardinality": 2}, + ] + } } }, ) @@ -338,13 +397,17 @@ class DecompositionSeriesBands(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -355,38 +418,55 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field("Units", json_schema_extra={"linkml_meta": {"ifabsent": "string(Units)"}}) spike_times_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the spike_times dataset.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, + ) + spike_times: Optional[UnitsSpikeTimes] = Field( + None, description="""Spike times for each unit.""" ) - spike_times: Optional[UnitsSpikeTimes] = Field(None, description="""Spike times for each unit.""") obs_intervals_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the obs_intervals dataset.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field( None, description="""Observation intervals for each unit.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_intervals"}, {"alias": "start_end", "exact_cardinality": 2}]} + "array": { + "dimensions": [ + {"alias": "num_intervals"}, + {"alias": "start_end", "exact_cardinality": 2}, + ] + } } }, ) electrodes_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into electrodes.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) electrodes: Named[Optional[DynamicTableRegion]] = Field( None, description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) electrode_group: Optional[List[ElectrodeGroup]] = Field( None, description="""Electrode group that each spike unit came from.""" @@ -407,13 +487,17 @@ class Units(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -428,13 +512,17 @@ class UnitsSpikeTimes(VectorData): name: Literal["spike_times"] = Field( "spike_times", - json_schema_extra={"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"} + }, ) resolution: Optional[np.float64] = Field( None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""", ) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ogen.py index cc90ad2..1130b61 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ogen.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ogen.py @@ -8,7 +8,12 @@ from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator import numpy as np from numpydantic import NDArray, Shape -from ...core.v2_2_4.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync, NWBContainer +from ...core.v2_2_4.core_nwb_base import ( + TimeSeries, + TimeSeriesStartingTime, + TimeSeriesSync, + NWBContainer, +) metamodel_version = "None" version = "2.2.4" @@ -23,7 +28,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,7 +86,9 @@ class OptogeneticSeries(TimeSeries): An optogenetic stimulus. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ogen", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.number] = Field( @@ -109,7 +118,9 @@ class OptogeneticSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -122,7 +133,9 @@ class OptogeneticStimulusSite(NWBContainer): A site of optogenetic stimulation. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ogen", "tree_root": True} + ) name: str = Field(...) description: str = Field(..., description="""Description of stimulation site.""") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ophys.py index b70e7ed..45465c9 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ophys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ophys.py @@ -18,7 +18,12 @@ from ...core.v2_2_4.core_nwb_base import ( ProcessingModule, Images, ) -from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_3.hdmf_common_table import ( Data, Index, @@ -40,7 +45,15 @@ from ...core.v2_2_4.core_nwb_image import ( IndexSeries, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape metamodel_version = "None" @@ -56,7 +69,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -118,7 +133,9 @@ class TwoPhotonSeries(ImageSeries): Image stack recorded over time from 2-photon microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") @@ -127,10 +144,16 @@ class TwoPhotonSeries(ImageSeries): description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) field_of_view: Optional[ - Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height"], np.float32]] + Union[ + NDArray[Shape["2 width_height"], np.float32], + NDArray[Shape["3 width_height"], np.float32], + ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Optional[ - Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] + Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] ] = Field(None, description="""Binary data representing images across frames.""") dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -167,7 +190,9 @@ class TwoPhotonSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -180,16 +205,21 @@ class RoiResponseSeries(TimeSeries): ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) - data: Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_rois"], np.number]] = Field( - ..., description="""Signals from ROIs.""" - ) + data: Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_rois"], np.number], + ] = Field(..., description="""Signals from ROIs.""") rois: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -213,7 +243,9 @@ class RoiResponseSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -226,7 +258,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[RoiResponseSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}} @@ -239,7 +273,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[RoiResponseSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}} @@ -252,7 +288,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[PlaneSegmentation]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "PlaneSegmentation"}]}} @@ -265,7 +303,9 @@ class PlaneSegmentation(DynamicTable): Results from image segmentation of a specific imaging plane. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) image_mask: Optional[PlaneSegmentationImageMask] = Field( @@ -275,7 +315,9 @@ class PlaneSegmentation(DynamicTable): pixel_mask_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into pixel_mask.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) pixel_mask: Optional[PlaneSegmentationPixelMask] = Field( None, @@ -284,7 +326,9 @@ class PlaneSegmentation(DynamicTable): voxel_mask_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into voxel_mask.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) voxel_mask: Optional[PlaneSegmentationVoxelMask] = Field( None, @@ -299,13 +343,17 @@ class PlaneSegmentation(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -320,9 +368,13 @@ class PlaneSegmentationImageMask(VectorData): name: Literal["image_mask"] = Field( "image_mask", - json_schema_extra={"linkml_meta": {"equals_string": "image_mask", "ifabsent": "string(image_mask)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "image_mask", "ifabsent": "string(image_mask)"} + }, + ) + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" ) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -342,12 +394,16 @@ class PlaneSegmentationPixelMask(VectorData): name: Literal["pixel_mask"] = Field( "pixel_mask", - json_schema_extra={"linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"} + }, ) x: Optional[np.uint32] = Field(None, description="""Pixel x-coordinate.""") y: Optional[np.uint32] = Field(None, description="""Pixel y-coordinate.""") weight: Optional[np.float32] = Field(None, description="""Weight of the pixel.""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -367,13 +423,17 @@ class PlaneSegmentationVoxelMask(VectorData): name: Literal["voxel_mask"] = Field( "voxel_mask", - json_schema_extra={"linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"} + }, ) x: Optional[np.uint32] = Field(None, description="""Voxel x-coordinate.""") y: Optional[np.uint32] = Field(None, description="""Voxel y-coordinate.""") z: Optional[np.uint32] = Field(None, description="""Voxel z-coordinate.""") weight: Optional[np.float32] = Field(None, description="""Weight of the voxel.""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -389,7 +449,9 @@ class ImagingPlane(NWBContainer): An imaging plane and its metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[OpticalChannel]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "OpticalChannel"}]}} @@ -402,11 +464,15 @@ class OpticalChannel(NWBContainer): An optical channel used to record from an imaging plane. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) description: str = Field(..., description="""Description or other notes about the channel.""") - emission_lambda: np.float32 = Field(..., description="""Emission wavelength for channel, in nm.""") + emission_lambda: np.float32 = Field( + ..., description="""Emission wavelength for channel, in nm.""" + ) class MotionCorrection(NWBDataInterface): @@ -414,7 +480,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[CorrectedImageStack]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "CorrectedImageStack"}]}} @@ -427,10 +495,14 @@ class CorrectedImageStack(NWBDataInterface): Reuslts from motion correction of an image stack. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) - corrected: ImageSeries = Field(..., description="""Image stack with frames shifted to the common coordinates.""") + corrected: ImageSeries = Field( + ..., description="""Image stack with frames shifted to the common coordinates.""" + ) xy_translation: TimeSeries = Field( ..., 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.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_retinotopy.py index b14683b..73cba7f 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_retinotopy.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_retinotopy.py @@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,9 +81,14 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.retinotopy", "tree_root": True} + ) - name: str = Field("ImagingRetinotopy", json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}}) + name: str = Field( + "ImagingRetinotopy", + json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}}, + ) axis_1_phase_map: ImagingRetinotopyAxis1PhaseMap = Field( ..., description="""Phase response to stimulus on the first measured axis.""" ) @@ -100,7 +107,9 @@ class ImagingRetinotopy(NWBDataInterface): ..., description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]} + } }, ) focal_depth_image: Optional[ImagingRetinotopyFocalDepthImage] = Field( @@ -108,10 +117,12 @@ class ImagingRetinotopy(NWBDataInterface): description="""Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].""", ) sign_map: Optional[ImagingRetinotopySignMap] = Field( - None, description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""" + None, + description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""", ) vasculature_image: ImagingRetinotopyVasculatureImage = Field( - ..., description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""" + ..., + description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""", ) @@ -125,18 +136,27 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): name: Literal["axis_1_phase_map"] = Field( "axis_1_phase_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_1_phase_map", "ifabsent": "string(axis_1_phase_map)"} + "linkml_meta": { + "equals_string": "axis_1_phase_map", + "ifabsent": "string(axis_1_phase_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -150,18 +170,27 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): name: Literal["axis_1_power_map"] = Field( "axis_1_power_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_1_power_map", "ifabsent": "string(axis_1_power_map)"} + "linkml_meta": { + "equals_string": "axis_1_power_map", + "ifabsent": "string(axis_1_power_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -175,18 +204,27 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): name: Literal["axis_2_phase_map"] = Field( "axis_2_phase_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_2_phase_map", "ifabsent": "string(axis_2_phase_map)"} + "linkml_meta": { + "equals_string": "axis_2_phase_map", + "ifabsent": "string(axis_2_phase_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -200,18 +238,27 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): name: Literal["axis_2_power_map"] = Field( "axis_2_power_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_2_power_map", "ifabsent": "string(axis_2_power_map)"} + "linkml_meta": { + "equals_string": "axis_2_power_map", + "ifabsent": "string(axis_2_power_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -225,7 +272,10 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): name: Literal["focal_depth_image"] = Field( "focal_depth_image", json_schema_extra={ - "linkml_meta": {"equals_string": "focal_depth_image", "ifabsent": "string(focal_depth_image)"} + "linkml_meta": { + "equals_string": "focal_depth_image", + "ifabsent": "string(focal_depth_image)", + } }, ) bits_per_pixel: Optional[np.int32] = Field( @@ -236,12 +286,20 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - focal_depth: Optional[np.float32] = Field(None, description="""Focal depth offset, in meters.""") - format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + focal_depth: Optional[np.float32] = Field( + None, description="""Focal depth offset, in meters.""" + ) + format: Optional[str] = Field( + None, description="""Format of image. Right now only 'raw' is supported.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -253,16 +311,23 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy"}) name: Literal["sign_map"] = Field( - "sign_map", json_schema_extra={"linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"}} + "sign_map", + json_schema_extra={ + "linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"} + }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -276,7 +341,10 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): name: Literal["vasculature_image"] = Field( "vasculature_image", json_schema_extra={ - "linkml_meta": {"equals_string": "vasculature_image", "ifabsent": "string(vasculature_image)"} + "linkml_meta": { + "equals_string": "vasculature_image", + "ifabsent": "string(vasculature_image)", + } }, ) bits_per_pixel: Optional[np.int32] = Field( @@ -287,11 +355,17 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + format: Optional[str] = Field( + None, description="""Format of image. Right now only 'raw' is supported.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/namespace.py index 47b760e..fc74ca5 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/namespace.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/namespace.py @@ -7,7 +7,12 @@ import sys from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator import numpy as np -from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_3.hdmf_common_table import ( Data, Index, @@ -151,7 +156,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/__init__.py index 8d1c8b6..8b13789 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/__init__.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/__init__.py @@ -1 +1 @@ - + diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_base.py index 76626bf..5fa3d20 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_base.py @@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,7 +81,9 @@ class NWBData(Data): An abstract data type for a dataset. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -89,7 +93,9 @@ 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)). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -110,7 +116,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -120,7 +128,9 @@ class NWBDataInterface(NWBContainer): An abstract data type for a generic container storing collections of data, as opposed to metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -130,7 +140,9 @@ class TimeSeries(NWBDataInterface): General purpose time series. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of the time series.""") @@ -159,7 +171,9 @@ class TimeSeries(NWBDataInterface): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -175,7 +189,8 @@ class TimeSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) conversion: Optional[np.float32] = Field( None, @@ -208,10 +223,14 @@ class TimeSeriesStartingTime(ConfiguredBaseModel): name: Literal["starting_time"] = Field( "starting_time", - json_schema_extra={"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"} + }, ) rate: Optional[np.float32] = Field(None, description="""Sampling rate, in Hz.""") - unit: Optional[str] = Field(None, description="""Unit of measurement for time, which is fixed to 'seconds'.""") + unit: Optional[str] = Field( + None, description="""Unit of measurement for time, which is fixed to 'seconds'.""" + ) value: np.float64 = Field(...) @@ -223,7 +242,8 @@ class TimeSeriesSync(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"}) name: Literal["sync"] = Field( - "sync", json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}} + "sync", + json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}}, ) @@ -232,10 +252,15 @@ class ProcessingModule(NWBContainer): A collection of processed data. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) children: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field( - None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}} + None, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]} + }, ) name: str = Field(...) @@ -245,10 +270,14 @@ class Images(NWBDataInterface): A collection of images. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field("Images", json_schema_extra={"linkml_meta": {"ifabsent": "string(Images)"}}) - description: Optional[str] = Field(None, description="""Description of this collection of images.""") + description: Optional[str] = Field( + None, description="""Description of this collection of images.""" + ) image: List[Image] = Field(..., description="""Images stored in this collection.""") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_behavior.py index 6032f14..7e73e80 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_behavior.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_behavior.py @@ -44,7 +44,12 @@ from ...core.v2_2_5.core_nwb_base import ( ProcessingModule, Images, ) -from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_3.hdmf_common_table import ( Data, Index, @@ -70,7 +75,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -126,11 +133,14 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) name: str = Field(...) data: SpatialSeriesData = Field( - ..., description="""1-D or 2-D array storing position or direction relative to some reference frame.""" + ..., + description="""1-D or 2-D array storing position or direction relative to some reference frame.""", ) reference_frame: Optional[str] = Field( None, description="""Description defining what exactly 'straight-ahead' means.""" @@ -157,7 +167,9 @@ class SpatialSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -173,14 +185,18 @@ class SpatialSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, description="""Base unit of measurement for working with the data. The default value is 'meters'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) array: Optional[ - Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]] + Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_features"], np.number], + ] ] = Field(None) @@ -189,7 +205,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[IntervalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "IntervalSeries"}]}} @@ -202,7 +220,9 @@ class BehavioralEvents(NWBDataInterface): TimeSeries for storing behavioral events. See description of BehavioralEpochs for more details. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -215,7 +235,9 @@ class BehavioralTimeSeries(NWBDataInterface): TimeSeries for storing Behavoioral time series data. See description of BehavioralEpochs for more details. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -228,7 +250,9 @@ class PupilTracking(NWBDataInterface): Eye-tracking data, representing pupil size. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -241,7 +265,9 @@ class EyeTracking(NWBDataInterface): Eye-tracking data, representing direction of gaze. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} @@ -254,7 +280,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} @@ -267,7 +295,9 @@ class Position(NWBDataInterface): Position data, whether along the x, x/y or x/y/z axis. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_device.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_device.py index 70dac3a..afc24d2 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_device.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_device.py @@ -22,7 +22,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -62,14 +64,18 @@ class Device(NWBContainer): Metadata about a data acquisition device, e.g., recording system, electrode, microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.device", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.device", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field( None, description="""Description of the device (e.g., model, firmware version, processing software version, etc.) as free-form text.""", ) - manufacturer: Optional[str] = Field(None, description="""The name of the manufacturer of the device.""") + manufacturer: Optional[str] = Field( + None, description="""The name of the manufacturer of the device.""" + ) # Model rebuild diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ecephys.py index 8e06179..137dc9a 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ecephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ecephys.py @@ -7,7 +7,15 @@ import sys import numpy as np from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTableRegion from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from ...core.v2_2_5.core_nwb_base import ( TimeSeries, TimeSeriesStartingTime, @@ -30,7 +38,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -75,7 +85,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.ecephys/", "id": "core.nwb.ecephys", - "imports": ["core.nwb.base", "../../hdmf_common/v1_1_3/namespace", "core.nwb.device", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "../../hdmf_common/v1_1_3/namespace", + "core.nwb.device", + "core.nwb.language", + ], "name": "core.nwb.ecephys", } ) @@ -86,7 +101,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) data: Union[ @@ -97,7 +114,9 @@ class ElectricalSeries(TimeSeries): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( None, @@ -126,7 +145,9 @@ class ElectricalSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -139,7 +160,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) data: Union[ @@ -154,7 +177,9 @@ class SpikeEventSeries(ElectricalSeries): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( None, @@ -178,7 +203,9 @@ class SpikeEventSeries(ElectricalSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -191,9 +218,14 @@ class FeatureExtraction(NWBDataInterface): Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("FeatureExtraction", json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}}) + name: str = Field( + "FeatureExtraction", + json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}}, + ) description: NDArray[Shape["* num_features"], str] = Field( ..., description="""Description of features (eg, ''PC1'') for each of the extracted features.""", @@ -204,7 +236,13 @@ class FeatureExtraction(NWBDataInterface): description="""Multi-dimensional array of features extracted from each event.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_events"}, {"alias": "num_channels"}, {"alias": "num_features"}]} + "array": { + "dimensions": [ + {"alias": "num_events"}, + {"alias": "num_channels"}, + {"alias": "num_features"}, + ] + } } }, ) @@ -216,7 +254,9 @@ class FeatureExtraction(NWBDataInterface): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) @@ -225,9 +265,13 @@ class EventDetection(NWBDataInterface): Detected spike events from voltage trace(s). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}}) + name: str = Field( + "EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}} + ) detection_method: str = Field( ..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""", @@ -249,7 +293,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[SpikeEventSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpikeEventSeries"}]}} @@ -262,7 +308,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[ElectricalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}} @@ -275,7 +323,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[ElectricalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}} @@ -288,7 +338,9 @@ class ElectrodeGroup(NWBContainer): A physical grouping of electrodes, e.g. a shank of an array. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of this electrode group.""") @@ -309,7 +361,10 @@ class ElectrodeGroupPosition(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"}) name: Literal["position"] = Field( - "position", json_schema_extra={"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}} + "position", + json_schema_extra={ + "linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"} + }, ) x: Optional[np.float32] = Field(None, description="""x coordinate""") y: Optional[np.float32] = Field(None, description="""y coordinate""") @@ -321,22 +376,33 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("ClusterWaveforms", json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}}) - waveform_filtering: str = Field(..., description="""Filtering applied to data before generating mean/sd""") + name: str = Field( + "ClusterWaveforms", + json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}}, + ) + waveform_filtering: str = Field( + ..., description="""Filtering applied to data before generating mean/sd""" + ) waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( ..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]} + } }, ) waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( ..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]} + } }, ) @@ -346,9 +412,13 @@ class Clustering(NWBDataInterface): DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}}) + name: str = Field( + "Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}} + ) description: str = Field( ..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_epoch.py index 59bf523..88ff4f9 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_epoch.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_epoch.py @@ -6,7 +6,15 @@ import re import sys import numpy as np from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTable, VectorIndex, VectorData from ...core.v2_2_5.core_nwb_base import TimeSeries @@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -80,52 +90,70 @@ class TimeIntervals(DynamicTable): A container for aggregating epoch data and the TimeSeries that each epoch applies to. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.epoch", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.epoch", "tree_root": True} + ) name: str = Field(...) start_time: NDArray[Any, np.float32] = Field( ..., description="""Start time of epoch, in seconds.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) stop_time: NDArray[Any, np.float32] = Field( ..., description="""Stop time of epoch, in seconds.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) tags: Optional[NDArray[Any, str]] = Field( None, description="""User-defined tags that identify or categorize events.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) tags_index: Named[Optional[VectorIndex]] = Field( None, description="""Index for tags.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, + ) + timeseries: Optional[TimeIntervalsTimeseries] = Field( + None, description="""An index into a TimeSeries object.""" ) - timeseries: Optional[TimeIntervalsTimeseries] = Field(None, description="""An index into a TimeSeries object.""") timeseries_index: Named[Optional[VectorIndex]] = Field( None, description="""Index for timeseries.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -140,17 +168,24 @@ class TimeIntervalsTimeseries(VectorData): name: Literal["timeseries"] = Field( "timeseries", - json_schema_extra={"linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"} + }, ) idx_start: Optional[np.int32] = Field( None, description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) count: Optional[np.int32] = Field( - None, description="""Number of data samples available in this time series, during this epoch.""" + None, + description="""Number of data samples available in this time series, during this epoch.""", + ) + timeseries: Optional[TimeSeries] = Field( + None, description="""the TimeSeries that this index applies to.""" + ) + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" ) - timeseries: Optional[TimeSeries] = Field(None, description="""the TimeSeries that this index applies to.""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") array: Optional[ Union[ NDArray[Shape["* dim0"], Any], diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_file.py index f85c3bd..86b8376 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_file.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_file.py @@ -44,7 +44,12 @@ from ...core.v2_2_5.core_nwb_base import ( ProcessingModule, Images, ) -from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_3.hdmf_common_table import ( Data, Index, @@ -119,7 +124,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -186,10 +193,14 @@ class ScratchData(NWBData): Any one-off datasets """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: str = Field(...) - notes: Optional[str] = Field(None, description="""Any notes the user has about the dataset being stored""") + notes: Optional[str] = Field( + None, description="""Any notes the user has about the dataset being stored""" + ) class NWBFile(NWBContainer): @@ -197,10 +208,13 @@ class NWBFile(NWBContainer): An NWB:N file storing cellular-based neurophysiology data from a single experimental session. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: Literal["root"] = Field( - "root", json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}} + "root", + json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}}, ) nwb_version: Optional[str] = Field( None, @@ -209,7 +223,9 @@ class NWBFile(NWBContainer): file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = Field( ..., description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}} + }, ) identifier: str = Field( ..., @@ -229,17 +245,23 @@ class NWBFile(NWBContainer): acquisition: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field( None, description="""Data streams recorded from the system, including ephys, ophys, tracking, etc. This group should be read-only after the experiment is completed and timestamps are corrected to a common timebase. The data stored here may be links to raw data stored in external NWB files. This will allow keeping bulky raw data out of the file while preserving the option of keeping some/all in the file. Acquired data includes tracking and experimental data streams (i.e., everything measured from the system). If bulky data is stored in the /acquisition group, the data can exist in a separate NWB file that is linked to by the file being used for processing and analysis.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]} + }, ) analysis: Optional[List[Union[DynamicTable, NWBContainer]]] = Field( None, description="""Lab-specific and custom scientific analysis of data. There is no defined format for the content of this group - the format is up to the individual user/lab. To facilitate sharing analysis data between labs, the contents here should be stored in standard types (e.g., neurodata_types) and appropriately documented. The file can store lab-specific and custom data analysis without restriction on its form or schema, reducing data formatting restrictions on end users. Such data should be placed in the analysis group. The analysis data should be documented so that it could be shared with other labs.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]} + }, ) scratch: Optional[List[Union[DynamicTable, NWBContainer]]] = Field( None, description="""A place to store one-off analysis results. Data placed here is not intended for sharing. By placing data here, users acknowledge that there is no guarantee that their data meets any standard.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]} + }, ) processing: Optional[List[ProcessingModule]] = Field( None, @@ -279,7 +301,10 @@ class NWBFileStimulus(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["stimulus"] = Field( - "stimulus", json_schema_extra={"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}} + "stimulus", + json_schema_extra={ + "linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"} + }, ) presentation: Optional[List[TimeSeries]] = Field( None, @@ -301,16 +326,27 @@ class NWBFileGeneral(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["general"] = Field( - "general", json_schema_extra={"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}} + "general", + json_schema_extra={ + "linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"} + }, + ) + data_collection: Optional[str] = Field( + None, description="""Notes about data collection and analysis.""" + ) + experiment_description: Optional[str] = Field( + None, description="""General description of the experiment.""" ) - data_collection: Optional[str] = Field(None, description="""Notes about data collection and analysis.""") - experiment_description: Optional[str] = Field(None, description="""General description of the experiment.""") experimenter: Optional[NDArray[Shape["* num_experimenters"], str]] = Field( None, description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}} + }, + ) + institution: Optional[str] = Field( + None, description="""Institution(s) where experiment was performed.""" ) - institution: Optional[str] = Field(None, description="""Institution(s) where experiment was performed.""") keywords: Optional[NDArray[Shape["* num_keywords"], str]] = Field( None, description="""Terms to search over.""", @@ -323,12 +359,15 @@ class NWBFileGeneral(ConfiguredBaseModel): description="""Description of drugs used, including how and when they were administered. Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc.""", ) protocol: Optional[str] = Field( - None, description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""" + None, + description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""", ) related_publications: Optional[NDArray[Shape["* num_publications"], str]] = Field( None, description="""Publication information. PMID, DOI, URL, etc.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}} + }, ) session_id: Optional[str] = Field(None, description="""Lab-specific ID for the session.""") slices: Optional[str] = Field( @@ -336,7 +375,8 @@ class NWBFileGeneral(ConfiguredBaseModel): description="""Description of slices, including information about preparation thickness, orientation, temperature, and bath solution.""", ) source_script: Optional[NWBFileGeneralSourceScript] = Field( - None, description="""Script file or link to public source code used to create this NWB file.""" + None, + description="""Script file or link to public source code used to create this NWB file.""", ) stimulus: Optional[str] = Field( None, description="""Notes about stimuli, such as how and where they were presented.""" @@ -359,7 +399,8 @@ class NWBFileGeneral(ConfiguredBaseModel): json_schema_extra={"linkml_meta": {"any_of": [{"range": "Device"}]}}, ) subject: Optional[Subject] = Field( - None, description="""Information about the animal or person from which the data was measured.""" + None, + description="""Information about the animal or person from which the data was measured.""", ) extracellular_ephys: Optional[NWBFileGeneralExtracellularEphys] = Field( None, description="""Metadata related to extracellular electrophysiology.""" @@ -388,7 +429,9 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel): name: Literal["source_script"] = Field( "source_script", - json_schema_extra={"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"} + }, ) file_name: Optional[str] = Field(None, description="""Name of script file.""") value: str = Field(...) @@ -404,10 +447,15 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel): name: Literal["extracellular_ephys"] = Field( "extracellular_ephys", json_schema_extra={ - "linkml_meta": {"equals_string": "extracellular_ephys", "ifabsent": "string(extracellular_ephys)"} + "linkml_meta": { + "equals_string": "extracellular_ephys", + "ifabsent": "string(extracellular_ephys)", + } }, ) - electrode_group: Optional[List[ElectrodeGroup]] = Field(None, description="""Physical group of electrodes.""") + electrode_group: Optional[List[ElectrodeGroup]] = Field( + None, description="""Physical group of electrodes.""" + ) electrodes: Optional[NWBFileGeneralExtracellularEphysElectrodes] = Field( None, description="""A table of all electrodes (i.e. channels) used for recording.""" ) @@ -422,48 +470,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): name: Literal["electrodes"] = Field( "electrodes", - json_schema_extra={"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"} + }, ) x: NDArray[Any, np.float32] = Field( ..., description="""x coordinate of the channel location in the brain (+x is posterior).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) y: NDArray[Any, np.float32] = Field( ..., description="""y coordinate of the channel location in the brain (+y is inferior).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) z: NDArray[Any, np.float32] = Field( ..., description="""z coordinate of the channel location in the brain (+z is right).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) imp: NDArray[Any, np.float32] = Field( ..., description="""Impedance of the channel.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) location: NDArray[Any, str] = Field( ..., description="""Location of the electrode (channel). 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.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) filtering: NDArray[Any, np.float32] = Field( ..., description="""Description of hardware filtering.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) group: List[ElectrodeGroup] = Field( @@ -473,48 +535,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): ..., description="""Name of the ElectrodeGroup this electrode is a part of.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_x: Optional[NDArray[Any, np.float32]] = Field( None, description="""x coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_y: Optional[NDArray[Any, np.float32]] = Field( None, description="""y coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_z: Optional[NDArray[Any, np.float32]] = Field( None, description="""z coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) reference: Optional[NDArray[Any, str]] = Field( None, description="""Description of the reference used for this electrode.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -530,7 +606,10 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel): name: Literal["intracellular_ephys"] = Field( "intracellular_ephys", json_schema_extra={ - "linkml_meta": {"equals_string": "intracellular_ephys", "ifabsent": "string(intracellular_ephys)"} + "linkml_meta": { + "equals_string": "intracellular_ephys", + "ifabsent": "string(intracellular_ephys)", + } }, ) filtering: Optional[str] = Field( @@ -550,7 +629,9 @@ class LabMetaData(NWBContainer): Lab-specific meta-data. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: str = Field(...) @@ -560,24 +641,33 @@ class Subject(NWBContainer): Information about the animal or person from which the data was measured. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: str = Field(...) - age: Optional[str] = Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""") + age: Optional[str] = Field( + None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""" + ) date_of_birth: Optional[np.datetime64] = Field( None, description="""Date of birth of subject. Can be supplied instead of 'age'.""" ) description: Optional[str] = Field( - None, description="""Description of subject and where subject came from (e.g., breeder, if animal).""" + None, + description="""Description of subject and where subject came from (e.g., breeder, if animal).""", + ) + genotype: Optional[str] = Field( + None, description="""Genetic strain. If absent, assume Wild Type (WT).""" ) - genotype: Optional[str] = Field(None, description="""Genetic strain. If absent, assume Wild Type (WT).""") sex: Optional[str] = Field(None, description="""Gender of subject.""") species: Optional[str] = Field(None, description="""Species of subject.""") subject_id: Optional[str] = Field( - None, description="""ID of animal/person used/participating in experiment (lab convention).""" + None, + description="""ID of animal/person used/participating in experiment (lab convention).""", ) weight: Optional[str] = Field( - None, description="""Weight at time of experiment, at time of surgery and at other important times.""" + None, + description="""Weight at time of experiment, at time of surgery and at other important times.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_icephys.py index f4ee5aa..8398175 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_icephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_icephys.py @@ -5,7 +5,12 @@ from enum import Enum import re import sys import numpy as np -from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_3.hdmf_common_table import ( Data, Index, @@ -30,7 +35,15 @@ from ...core.v2_2_5.core_nwb_base import ( Images, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape metamodel_version = "None" @@ -46,7 +59,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -91,7 +106,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.icephys/", "id": "core.nwb.icephys", - "imports": ["core.nwb.base", "core.nwb.device", "../../hdmf_common/v1_1_3/namespace", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "core.nwb.device", + "../../hdmf_common/v1_1_3/namespace", + "core.nwb.language", + ], "name": "core.nwb.icephys", } ) @@ -102,7 +122,9 @@ class PatchClampSeries(TimeSeries): An abstract base class for patch-clamp data - stimulus or response, current or voltage. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) stimulus_description: Optional[str] = Field( @@ -113,7 +135,8 @@ class PatchClampSeries(TimeSeries): ) data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""") gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -137,7 +160,9 @@ class PatchClampSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -153,7 +178,8 @@ class PatchClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -169,13 +195,17 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""") bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""") - capacitance_compensation: Optional[np.float32] = Field(None, description="""Capacitance compensation, in farads.""") + capacitance_compensation: Optional[np.float32] = Field( + None, description="""Capacitance compensation, in farads.""" + ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) @@ -183,7 +213,8 @@ class CurrentClampSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -207,7 +238,9 @@ class CurrentClampSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -223,7 +256,8 @@ class CurrentClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -237,11 +271,15 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""") - bridge_balance: np.float32 = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + bridge_balance: np.float32 = Field( + ..., description="""Bridge balance, in ohms, fixed to 0.0.""" + ) capacitance_compensation: np.float32 = Field( ..., description="""Capacitance compensation, in farads, fixed to 0.0.""" ) @@ -253,7 +291,8 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -277,7 +316,9 @@ class IZeroClampSeries(CurrentClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -290,7 +331,9 @@ class CurrentClampStimulusSeries(PatchClampSeries): Stimulus current applied during current clamp recording. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: CurrentClampStimulusSeriesData = Field(..., description="""Stimulus current applied.""") @@ -301,7 +344,8 @@ class CurrentClampStimulusSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -325,7 +369,9 @@ class CurrentClampStimulusSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -341,7 +387,8 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -355,7 +402,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: VoltageClampSeriesData = Field(..., description="""Recorded current.""") @@ -377,8 +426,8 @@ class VoltageClampSeries(PatchClampSeries): whole_cell_capacitance_comp: Optional[VoltageClampSeriesWholeCellCapacitanceComp] = Field( None, description="""Whole cell capacitance compensation, in farads.""" ) - whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = Field( - None, description="""Whole cell series resistance compensation, in ohms.""" + whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = ( + Field(None, description="""Whole cell series resistance compensation, in ohms.""") ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" @@ -387,7 +436,8 @@ class VoltageClampSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -411,7 +461,9 @@ class VoltageClampSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -427,7 +479,8 @@ class VoltageClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -446,11 +499,15 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): name: Literal["capacitance_fast"] = Field( "capacitance_fast", json_schema_extra={ - "linkml_meta": {"equals_string": "capacitance_fast", "ifabsent": "string(capacitance_fast)"} + "linkml_meta": { + "equals_string": "capacitance_fast", + "ifabsent": "string(capacitance_fast)", + } }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -465,11 +522,15 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): name: Literal["capacitance_slow"] = Field( "capacitance_slow", json_schema_extra={ - "linkml_meta": {"equals_string": "capacitance_slow", "ifabsent": "string(capacitance_slow)"} + "linkml_meta": { + "equals_string": "capacitance_slow", + "ifabsent": "string(capacitance_slow)", + } }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -491,7 +552,8 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""" + None, + description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""", ) value: np.float32 = Field(...) @@ -513,7 +575,8 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""" + None, + description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""", ) value: np.float32 = Field(...) @@ -535,7 +598,8 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""" + None, + description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""", ) value: np.float32 = Field(...) @@ -557,7 +621,8 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -579,7 +644,8 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""" + None, + description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""", ) value: np.float32 = Field(...) @@ -589,7 +655,9 @@ class VoltageClampStimulusSeries(PatchClampSeries): Stimulus voltage applied during a voltage clamp recording. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: VoltageClampStimulusSeriesData = Field(..., description="""Stimulus voltage applied.""") @@ -600,7 +668,8 @@ class VoltageClampStimulusSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -624,7 +693,9 @@ class VoltageClampStimulusSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -640,7 +711,8 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -654,19 +726,27 @@ class IntracellularElectrode(NWBContainer): An intracellular electrode and its metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) - description: str = Field(..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""") + description: str = Field( + ..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""" + ) filtering: Optional[str] = Field(None, description="""Electrode specific filtering.""") - initial_access_resistance: Optional[str] = Field(None, description="""Initial access resistance.""") + initial_access_resistance: Optional[str] = Field( + None, description="""Initial access resistance.""" + ) location: Optional[str] = Field( None, description="""Location of the electrode. 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.""", ) resistance: Optional[str] = Field(None, description="""Electrode resistance, in ohms.""") seal: Optional[str] = Field(None, description="""Information about seal used for recording.""") - slice: Optional[str] = Field(None, description="""Information about slice used for recording.""") + slice: Optional[str] = Field( + None, description="""Information about slice used for recording.""" + ) class SweepTable(DynamicTable): @@ -674,14 +754,18 @@ class SweepTable(DynamicTable): The table which groups different PatchClampSeries together. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) sweep_number: NDArray[Any, np.uint32] = Field( ..., description="""Sweep number of the PatchClampSeries in that row.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) series: List[PatchClampSeries] = Field( @@ -690,19 +774,25 @@ class SweepTable(DynamicTable): series_index: Named[VectorIndex] = Field( ..., description="""Index for series.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_image.py index 00bd789..a6c5500 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_image.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_image.py @@ -19,7 +19,12 @@ from ...core.v2_2_5.core_nwb_base import ( ProcessingModule, Images, ) -from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_3.hdmf_common_table import ( Data, Index, @@ -45,7 +50,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -101,7 +108,9 @@ class GrayscaleImage(Image): A grayscale image. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -122,7 +131,9 @@ class RGBImage(Image): A color image. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -143,7 +154,9 @@ class RGBAImage(Image): A color image with transparency. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -164,11 +177,16 @@ 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]. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: Optional[ - Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] + Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] ] = Field(None, description="""Binary data representing images across frames.""") dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -205,7 +223,9 @@ class ImageSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -222,7 +242,9 @@ class ImageSeriesExternalFile(ConfiguredBaseModel): name: Literal["external_file"] = Field( "external_file", - json_schema_extra={"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"} + }, ) starting_frame: Optional[np.int32] = Field( None, @@ -238,11 +260,16 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: Optional[ - Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] + Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] ] = Field(None, description="""Binary data representing images across frames.""") dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -279,7 +306,9 @@ class ImageMaskSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -292,15 +321,23 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) - distance: Optional[np.float32] = Field(None, description="""Distance from camera/monitor to target/eye.""") + distance: Optional[np.float32] = Field( + None, description="""Distance from camera/monitor to target/eye.""" + ) field_of_view: Optional[ - Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]] + Union[ + NDArray[Shape["2 width_height"], np.float32], + NDArray[Shape["3 width_height_depth"], np.float32], + ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number] + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number], ] = Field(..., description="""Images presented to subject, either grayscale or RGB""") orientation: Optional[str] = Field( None, @@ -341,7 +378,9 @@ class OpticalSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -354,7 +393,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.int32] = Field( @@ -384,7 +425,9 @@ class IndexSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_misc.py index baa355f..1c2481c 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_misc.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_misc.py @@ -7,10 +7,23 @@ import sys import numpy as np from ...core.v2_2_5.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from ...core.v2_2_5.core_nwb_ecephys import ElectrodeGroup from numpydantic import NDArray, Shape -from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTable, VectorData, VectorIndex, DynamicTableRegion +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + DynamicTable, + VectorData, + VectorIndex, + DynamicTableRegion, +) metamodel_version = "None" version = "2.2.5" @@ -25,7 +38,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -70,7 +85,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.misc/", "id": "core.nwb.misc", - "imports": ["core.nwb.base", "../../hdmf_common/v1_1_3/namespace", "core.nwb.ecephys", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "../../hdmf_common/v1_1_3/namespace", + "core.nwb.ecephys", + "core.nwb.language", + ], "name": "core.nwb.misc", } ) @@ -81,10 +101,14 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) - data: AbstractFeatureSeriesData = Field(..., description="""Values of each feature at each time.""") + data: AbstractFeatureSeriesData = Field( + ..., description="""Values of each feature at each time.""" + ) feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field( None, description="""Units of each feature.""", @@ -117,7 +141,9 @@ class AbstractFeatureSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -133,14 +159,18 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, description="""Since there can be different units for different features, store the units in 'feature_units'. The default value for this attribute is \"see 'feature_units'\".""", ) array: Optional[ - Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]] + Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_features"], np.number], + ] ] = Field(None) @@ -149,7 +179,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], str] = Field( @@ -179,7 +211,9 @@ class AnnotationSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -192,7 +226,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.int8] = Field( @@ -222,7 +258,9 @@ class IntervalSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -235,10 +273,14 @@ class DecompositionSeries(TimeSeries): Spectral analysis of a time series, e.g. of an LFP or a speech signal. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) - data: DecompositionSeriesData = Field(..., description="""Data decomposed into frequency bands.""") + data: DecompositionSeriesData = Field( + ..., description="""Data decomposed into frequency bands.""" + ) metric: str = Field(..., description="""The metric used, e.g. phase, amplitude, power.""") bands: DecompositionSeriesBands = Field( ..., @@ -266,7 +308,9 @@ class DecompositionSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -282,7 +326,8 @@ class DecompositionSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -292,7 +337,13 @@ class DecompositionSeriesData(ConfiguredBaseModel): None, json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_times"}, {"alias": "num_channels"}, {"alias": "num_bands"}]} + "array": { + "dimensions": [ + {"alias": "num_times"}, + {"alias": "num_channels"}, + {"alias": "num_bands"}, + ] + } } }, ) @@ -306,13 +357,16 @@ class DecompositionSeriesBands(DynamicTable): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["bands"] = Field( - "bands", json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}} + "bands", + json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}}, ) band_name: NDArray[Any, str] = Field( ..., description="""Name of the band, e.g. theta.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field( @@ -320,7 +374,12 @@ class DecompositionSeriesBands(DynamicTable): description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_bands"}, {"alias": "low_high", "exact_cardinality": 2}]} + "array": { + "dimensions": [ + {"alias": "num_bands"}, + {"alias": "low_high", "exact_cardinality": 2}, + ] + } } }, ) @@ -338,13 +397,17 @@ class DecompositionSeriesBands(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -355,38 +418,55 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field("Units", json_schema_extra={"linkml_meta": {"ifabsent": "string(Units)"}}) spike_times_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the spike_times dataset.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, + ) + spike_times: Optional[UnitsSpikeTimes] = Field( + None, description="""Spike times for each unit.""" ) - spike_times: Optional[UnitsSpikeTimes] = Field(None, description="""Spike times for each unit.""") obs_intervals_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the obs_intervals dataset.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field( None, description="""Observation intervals for each unit.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_intervals"}, {"alias": "start_end", "exact_cardinality": 2}]} + "array": { + "dimensions": [ + {"alias": "num_intervals"}, + {"alias": "start_end", "exact_cardinality": 2}, + ] + } } }, ) electrodes_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into electrodes.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) electrodes: Named[Optional[DynamicTableRegion]] = Field( None, description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) electrode_group: Optional[List[ElectrodeGroup]] = Field( None, description="""Electrode group that each spike unit came from.""" @@ -407,13 +487,17 @@ class Units(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -428,13 +512,17 @@ class UnitsSpikeTimes(VectorData): name: Literal["spike_times"] = Field( "spike_times", - json_schema_extra={"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"} + }, ) resolution: Optional[np.float64] = Field( None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""", ) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ogen.py index 50282a0..1723dba 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ogen.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ogen.py @@ -8,7 +8,12 @@ from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator import numpy as np from numpydantic import NDArray, Shape -from ...core.v2_2_5.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync, NWBContainer +from ...core.v2_2_5.core_nwb_base import ( + TimeSeries, + TimeSeriesStartingTime, + TimeSeriesSync, + NWBContainer, +) metamodel_version = "None" version = "2.2.5" @@ -23,7 +28,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,7 +86,9 @@ class OptogeneticSeries(TimeSeries): An optogenetic stimulus. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ogen", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.number] = Field( @@ -109,7 +118,9 @@ class OptogeneticSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -122,7 +133,9 @@ class OptogeneticStimulusSite(NWBContainer): A site of optogenetic stimulation. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ogen", "tree_root": True} + ) name: str = Field(...) description: str = Field(..., description="""Description of stimulation site.""") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ophys.py index c57799d..7dc895e 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ophys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ophys.py @@ -18,7 +18,12 @@ from ...core.v2_2_5.core_nwb_base import ( ProcessingModule, Images, ) -from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_3.hdmf_common_table import ( Data, Index, @@ -40,7 +45,15 @@ from ...core.v2_2_5.core_nwb_image import ( IndexSeries, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape metamodel_version = "None" @@ -56,7 +69,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -118,7 +133,9 @@ class TwoPhotonSeries(ImageSeries): Image stack recorded over time from 2-photon microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") @@ -127,10 +144,16 @@ class TwoPhotonSeries(ImageSeries): description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) field_of_view: Optional[ - Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]] + Union[ + NDArray[Shape["2 width_height"], np.float32], + NDArray[Shape["3 width_height_depth"], np.float32], + ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Optional[ - Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] + Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] ] = Field(None, description="""Binary data representing images across frames.""") dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -167,7 +190,9 @@ class TwoPhotonSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -180,16 +205,21 @@ class RoiResponseSeries(TimeSeries): ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) - data: Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_rois"], np.number]] = Field( - ..., description="""Signals from ROIs.""" - ) + data: Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_rois"], np.number], + ] = Field(..., description="""Signals from ROIs.""") rois: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -213,7 +243,9 @@ class RoiResponseSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -226,7 +258,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[RoiResponseSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}} @@ -239,7 +273,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[RoiResponseSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}} @@ -252,7 +288,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[PlaneSegmentation]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "PlaneSegmentation"}]}} @@ -265,7 +303,9 @@ class PlaneSegmentation(DynamicTable): Results from image segmentation of a specific imaging plane. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) image_mask: Optional[PlaneSegmentationImageMask] = Field( @@ -275,7 +315,9 @@ class PlaneSegmentation(DynamicTable): pixel_mask_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into pixel_mask.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) pixel_mask: Optional[PlaneSegmentationPixelMask] = Field( None, @@ -284,7 +326,9 @@ class PlaneSegmentation(DynamicTable): voxel_mask_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into voxel_mask.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) voxel_mask: Optional[PlaneSegmentationVoxelMask] = Field( None, @@ -299,13 +343,17 @@ class PlaneSegmentation(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) @@ -320,9 +368,13 @@ class PlaneSegmentationImageMask(VectorData): name: Literal["image_mask"] = Field( "image_mask", - json_schema_extra={"linkml_meta": {"equals_string": "image_mask", "ifabsent": "string(image_mask)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "image_mask", "ifabsent": "string(image_mask)"} + }, + ) + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" ) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -342,12 +394,16 @@ class PlaneSegmentationPixelMask(VectorData): name: Literal["pixel_mask"] = Field( "pixel_mask", - json_schema_extra={"linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"} + }, ) x: Optional[np.uint32] = Field(None, description="""Pixel x-coordinate.""") y: Optional[np.uint32] = Field(None, description="""Pixel y-coordinate.""") weight: Optional[np.float32] = Field(None, description="""Weight of the pixel.""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -367,13 +423,17 @@ class PlaneSegmentationVoxelMask(VectorData): name: Literal["voxel_mask"] = Field( "voxel_mask", - json_schema_extra={"linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"} + }, ) x: Optional[np.uint32] = Field(None, description="""Voxel x-coordinate.""") y: Optional[np.uint32] = Field(None, description="""Voxel y-coordinate.""") z: Optional[np.uint32] = Field(None, description="""Voxel z-coordinate.""") weight: Optional[np.float32] = Field(None, description="""Weight of the voxel.""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -389,7 +449,9 @@ class ImagingPlane(NWBContainer): An imaging plane and its metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[OpticalChannel]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "OpticalChannel"}]}} @@ -402,11 +464,15 @@ class OpticalChannel(NWBContainer): An optical channel used to record from an imaging plane. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) description: str = Field(..., description="""Description or other notes about the channel.""") - emission_lambda: np.float32 = Field(..., description="""Emission wavelength for channel, in nm.""") + emission_lambda: np.float32 = Field( + ..., description="""Emission wavelength for channel, in nm.""" + ) class MotionCorrection(NWBDataInterface): @@ -414,7 +480,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[CorrectedImageStack]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "CorrectedImageStack"}]}} @@ -427,10 +495,14 @@ class CorrectedImageStack(NWBDataInterface): Reuslts from motion correction of an image stack. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) - corrected: ImageSeries = Field(..., description="""Image stack with frames shifted to the common coordinates.""") + corrected: ImageSeries = Field( + ..., description="""Image stack with frames shifted to the common coordinates.""" + ) xy_translation: TimeSeries = Field( ..., 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.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_retinotopy.py index 7f46021..a80f14e 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_retinotopy.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_retinotopy.py @@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,9 +81,14 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.retinotopy", "tree_root": True} + ) - name: str = Field("ImagingRetinotopy", json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}}) + name: str = Field( + "ImagingRetinotopy", + json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}}, + ) axis_1_phase_map: ImagingRetinotopyAxis1PhaseMap = Field( ..., description="""Phase response to stimulus on the first measured axis.""" ) @@ -100,7 +107,9 @@ class ImagingRetinotopy(NWBDataInterface): ..., description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]} + } }, ) focal_depth_image: Optional[ImagingRetinotopyFocalDepthImage] = Field( @@ -108,10 +117,12 @@ class ImagingRetinotopy(NWBDataInterface): description="""Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].""", ) sign_map: Optional[ImagingRetinotopySignMap] = Field( - None, description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""" + None, + description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""", ) vasculature_image: ImagingRetinotopyVasculatureImage = Field( - ..., description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""" + ..., + description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""", ) @@ -125,18 +136,27 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): name: Literal["axis_1_phase_map"] = Field( "axis_1_phase_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_1_phase_map", "ifabsent": "string(axis_1_phase_map)"} + "linkml_meta": { + "equals_string": "axis_1_phase_map", + "ifabsent": "string(axis_1_phase_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -150,18 +170,27 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): name: Literal["axis_1_power_map"] = Field( "axis_1_power_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_1_power_map", "ifabsent": "string(axis_1_power_map)"} + "linkml_meta": { + "equals_string": "axis_1_power_map", + "ifabsent": "string(axis_1_power_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -175,18 +204,27 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): name: Literal["axis_2_phase_map"] = Field( "axis_2_phase_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_2_phase_map", "ifabsent": "string(axis_2_phase_map)"} + "linkml_meta": { + "equals_string": "axis_2_phase_map", + "ifabsent": "string(axis_2_phase_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -200,18 +238,27 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): name: Literal["axis_2_power_map"] = Field( "axis_2_power_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_2_power_map", "ifabsent": "string(axis_2_power_map)"} + "linkml_meta": { + "equals_string": "axis_2_power_map", + "ifabsent": "string(axis_2_power_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -225,7 +272,10 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): name: Literal["focal_depth_image"] = Field( "focal_depth_image", json_schema_extra={ - "linkml_meta": {"equals_string": "focal_depth_image", "ifabsent": "string(focal_depth_image)"} + "linkml_meta": { + "equals_string": "focal_depth_image", + "ifabsent": "string(focal_depth_image)", + } }, ) bits_per_pixel: Optional[np.int32] = Field( @@ -236,12 +286,20 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - focal_depth: Optional[np.float32] = Field(None, description="""Focal depth offset, in meters.""") - format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + focal_depth: Optional[np.float32] = Field( + None, description="""Focal depth offset, in meters.""" + ) + format: Optional[str] = Field( + None, description="""Format of image. Right now only 'raw' is supported.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -253,16 +311,23 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy"}) name: Literal["sign_map"] = Field( - "sign_map", json_schema_extra={"linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"}} + "sign_map", + json_schema_extra={ + "linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"} + }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -276,7 +341,10 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): name: Literal["vasculature_image"] = Field( "vasculature_image", json_schema_extra={ - "linkml_meta": {"equals_string": "vasculature_image", "ifabsent": "string(vasculature_image)"} + "linkml_meta": { + "equals_string": "vasculature_image", + "ifabsent": "string(vasculature_image)", + } }, ) bits_per_pixel: Optional[np.int32] = Field( @@ -287,11 +355,17 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + format: Optional[str] = Field( + None, description="""Format of image. Right now only 'raw' is supported.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/namespace.py index 96dc28b..fae01ff 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/namespace.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/namespace.py @@ -7,7 +7,12 @@ import sys from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator import numpy as np -from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_3.hdmf_common_table import ( Data, Index, @@ -151,7 +156,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/__init__.py index 8d1c8b6..8b13789 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/__init__.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/__init__.py @@ -1 +1 @@ - + diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_base.py index e48eb6b..53ddb67 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_base.py @@ -24,7 +24,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -69,7 +71,11 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.base/", "id": "core.nwb.base", - "imports": ["../../hdmf_common/v1_5_0/namespace", "../../hdmf_common/v1_5_0/namespace", "core.nwb.language"], + "imports": [ + "../../hdmf_common/v1_5_0/namespace", + "../../hdmf_common/v1_5_0/namespace", + "core.nwb.language", + ], "name": "core.nwb.base", } ) @@ -80,7 +86,9 @@ class NWBData(Data): An abstract data type for a dataset. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -90,7 +98,9 @@ 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)). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -111,7 +121,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -121,7 +133,9 @@ class NWBDataInterface(NWBContainer): An abstract data type for a generic container storing collections of data, as opposed to metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -131,7 +145,9 @@ class TimeSeries(NWBDataInterface): General purpose time series. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of the time series.""") @@ -160,7 +176,9 @@ class TimeSeries(NWBDataInterface): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -176,7 +194,8 @@ class TimeSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) conversion: Optional[np.float32] = Field( None, @@ -213,10 +232,14 @@ class TimeSeriesStartingTime(ConfiguredBaseModel): name: Literal["starting_time"] = Field( "starting_time", - json_schema_extra={"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"} + }, ) rate: Optional[np.float32] = Field(None, description="""Sampling rate, in Hz.""") - unit: Optional[str] = Field(None, description="""Unit of measurement for time, which is fixed to 'seconds'.""") + unit: Optional[str] = Field( + None, description="""Unit of measurement for time, which is fixed to 'seconds'.""" + ) value: np.float64 = Field(...) @@ -228,7 +251,8 @@ class TimeSeriesSync(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"}) name: Literal["sync"] = Field( - "sync", json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}} + "sync", + json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}}, ) @@ -237,10 +261,15 @@ class ProcessingModule(NWBContainer): A collection of processed data. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) children: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field( - None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}} + None, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]} + }, ) name: str = Field(...) @@ -250,10 +279,14 @@ class Images(NWBDataInterface): A collection of images. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field("Images", json_schema_extra={"linkml_meta": {"ifabsent": "string(Images)"}}) - description: Optional[str] = Field(None, description="""Description of this collection of images.""") + description: Optional[str] = Field( + None, description="""Description of this collection of images.""" + ) image: List[Image] = Field(..., description="""Images stored in this collection.""") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_behavior.py index dccc69d..71498cf 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_behavior.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_behavior.py @@ -69,7 +69,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -125,11 +127,14 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) name: str = Field(...) data: SpatialSeriesData = Field( - ..., description="""1-D or 2-D array storing position or direction relative to some reference frame.""" + ..., + description="""1-D or 2-D array storing position or direction relative to some reference frame.""", ) reference_frame: Optional[str] = Field( None, description="""Description defining what exactly 'straight-ahead' means.""" @@ -156,7 +161,9 @@ class SpatialSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -172,14 +179,18 @@ class SpatialSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, description="""Base unit of measurement for working with the data. The default value is 'meters'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) array: Optional[ - Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]] + Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_features"], np.number], + ] ] = Field(None) @@ -188,7 +199,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[IntervalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "IntervalSeries"}]}} @@ -201,7 +214,9 @@ class BehavioralEvents(NWBDataInterface): TimeSeries for storing behavioral events. See description of BehavioralEpochs for more details. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -214,7 +229,9 @@ class BehavioralTimeSeries(NWBDataInterface): TimeSeries for storing Behavoioral time series data. See description of BehavioralEpochs for more details. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -227,7 +244,9 @@ class PupilTracking(NWBDataInterface): Eye-tracking data, representing pupil size. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -240,7 +259,9 @@ class EyeTracking(NWBDataInterface): Eye-tracking data, representing direction of gaze. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} @@ -253,7 +274,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} @@ -266,7 +289,9 @@ class Position(NWBDataInterface): Position data, whether along the x, x/y or x/y/z axis. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_device.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_device.py index d3709e4..0640dac 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_device.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_device.py @@ -22,7 +22,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -62,14 +64,18 @@ class Device(NWBContainer): Metadata about a data acquisition device, e.g., recording system, electrode, microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.device", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.device", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field( None, description="""Description of the device (e.g., model, firmware version, processing software version, etc.) as free-form text.""", ) - manufacturer: Optional[str] = Field(None, description="""The name of the manufacturer of the device.""") + manufacturer: Optional[str] = Field( + None, description="""The name of the manufacturer of the device.""" + ) # Model rebuild diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ecephys.py index e9568fd..5dcbe3f 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ecephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ecephys.py @@ -7,7 +7,15 @@ import sys import numpy as np from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTableRegion from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from ...core.v2_3_0.core_nwb_base import ( TimeSeries, TimeSeriesStartingTime, @@ -30,7 +38,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -75,7 +85,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.ecephys/", "id": "core.nwb.ecephys", - "imports": ["core.nwb.base", "../../hdmf_common/v1_5_0/namespace", "core.nwb.device", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "../../hdmf_common/v1_5_0/namespace", + "core.nwb.device", + "core.nwb.language", + ], "name": "core.nwb.ecephys", } ) @@ -86,7 +101,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) filtering: Optional[str] = Field( @@ -101,7 +118,9 @@ class ElectricalSeries(TimeSeries): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( None, @@ -130,7 +149,9 @@ class ElectricalSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -143,7 +164,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) data: Union[ @@ -162,7 +185,9 @@ class SpikeEventSeries(ElectricalSeries): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( None, @@ -186,7 +211,9 @@ class SpikeEventSeries(ElectricalSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -199,9 +226,14 @@ class FeatureExtraction(NWBDataInterface): Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("FeatureExtraction", json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}}) + name: str = Field( + "FeatureExtraction", + json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}}, + ) description: NDArray[Shape["* num_features"], str] = Field( ..., description="""Description of features (eg, ''PC1'') for each of the extracted features.""", @@ -212,7 +244,13 @@ class FeatureExtraction(NWBDataInterface): description="""Multi-dimensional array of features extracted from each event.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_events"}, {"alias": "num_channels"}, {"alias": "num_features"}]} + "array": { + "dimensions": [ + {"alias": "num_events"}, + {"alias": "num_channels"}, + {"alias": "num_features"}, + ] + } } }, ) @@ -224,7 +262,9 @@ class FeatureExtraction(NWBDataInterface): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) @@ -233,9 +273,13 @@ class EventDetection(NWBDataInterface): Detected spike events from voltage trace(s). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}}) + name: str = Field( + "EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}} + ) detection_method: str = Field( ..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""", @@ -257,7 +301,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[SpikeEventSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpikeEventSeries"}]}} @@ -270,7 +316,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[ElectricalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}} @@ -283,7 +331,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[ElectricalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}} @@ -296,7 +346,9 @@ class ElectrodeGroup(NWBContainer): A physical grouping of electrodes, e.g. a shank of an array. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of this electrode group.""") @@ -317,7 +369,10 @@ class ElectrodeGroupPosition(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"}) name: Literal["position"] = Field( - "position", json_schema_extra={"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}} + "position", + json_schema_extra={ + "linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"} + }, ) x: Optional[np.float32] = Field(None, description="""x coordinate""") y: Optional[np.float32] = Field(None, description="""y coordinate""") @@ -329,22 +384,33 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("ClusterWaveforms", json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}}) - waveform_filtering: str = Field(..., description="""Filtering applied to data before generating mean/sd""") + name: str = Field( + "ClusterWaveforms", + json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}}, + ) + waveform_filtering: str = Field( + ..., description="""Filtering applied to data before generating mean/sd""" + ) waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( ..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]} + } }, ) waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( ..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]} + } }, ) @@ -354,9 +420,13 @@ class Clustering(NWBDataInterface): DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}}) + name: str = Field( + "Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}} + ) description: str = Field( ..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_epoch.py index 8c4dbc7..1b888c7 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_epoch.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_epoch.py @@ -6,7 +6,15 @@ import re import sys import numpy as np from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, VectorIndex, VectorData from ...core.v2_3_0.core_nwb_base import TimeSeries @@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -80,46 +90,62 @@ class TimeIntervals(DynamicTable): A container for aggregating epoch data and the TimeSeries that each epoch applies to. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.epoch", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.epoch", "tree_root": True} + ) name: str = Field(...) start_time: NDArray[Any, np.float32] = Field( ..., description="""Start time of epoch, in seconds.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) stop_time: NDArray[Any, np.float32] = Field( ..., description="""Stop time of epoch, in seconds.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) tags: Optional[NDArray[Any, str]] = Field( None, description="""User-defined tags that identify or categorize events.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) tags_index: Named[Optional[VectorIndex]] = Field( None, description="""Index for tags.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, + ) + timeseries: Optional[TimeIntervalsTimeseries] = Field( + None, description="""An index into a TimeSeries object.""" ) - timeseries: Optional[TimeIntervalsTimeseries] = Field(None, description="""An index into a TimeSeries object.""") timeseries_index: Named[Optional[VectorIndex]] = Field( None, description="""Index for timeseries.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -139,17 +165,24 @@ class TimeIntervalsTimeseries(VectorData): name: Literal["timeseries"] = Field( "timeseries", - json_schema_extra={"linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"} + }, ) idx_start: Optional[np.int32] = Field( None, description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) count: Optional[np.int32] = Field( - None, description="""Number of data samples available in this time series, during this epoch.""" + None, + description="""Number of data samples available in this time series, during this epoch.""", + ) + timeseries: Optional[TimeSeries] = Field( + None, description="""the TimeSeries that this index applies to.""" + ) + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" ) - timeseries: Optional[TimeSeries] = Field(None, description="""the TimeSeries that this index applies to.""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") array: Optional[ Union[ NDArray[Shape["* dim0"], Any], diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_file.py index 164f805..a916845 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_file.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_file.py @@ -118,7 +118,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -185,10 +187,14 @@ class ScratchData(NWBData): Any one-off datasets """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: str = Field(...) - notes: Optional[str] = Field(None, description="""Any notes the user has about the dataset being stored""") + notes: Optional[str] = Field( + None, description="""Any notes the user has about the dataset being stored""" + ) class NWBFile(NWBContainer): @@ -196,10 +202,13 @@ class NWBFile(NWBContainer): An NWB:N file storing cellular-based neurophysiology data from a single experimental session. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: Literal["root"] = Field( - "root", json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}} + "root", + json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}}, ) nwb_version: Optional[str] = Field( None, @@ -208,7 +217,9 @@ class NWBFile(NWBContainer): file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = Field( ..., description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}} + }, ) identifier: str = Field( ..., @@ -228,17 +239,23 @@ class NWBFile(NWBContainer): acquisition: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field( None, description="""Data streams recorded from the system, including ephys, ophys, tracking, etc. This group should be read-only after the experiment is completed and timestamps are corrected to a common timebase. The data stored here may be links to raw data stored in external NWB files. This will allow keeping bulky raw data out of the file while preserving the option of keeping some/all in the file. Acquired data includes tracking and experimental data streams (i.e., everything measured from the system). If bulky data is stored in the /acquisition group, the data can exist in a separate NWB file that is linked to by the file being used for processing and analysis.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]} + }, ) analysis: Optional[List[Union[DynamicTable, NWBContainer]]] = Field( None, description="""Lab-specific and custom scientific analysis of data. There is no defined format for the content of this group - the format is up to the individual user/lab. To facilitate sharing analysis data between labs, the contents here should be stored in standard types (e.g., neurodata_types) and appropriately documented. The file can store lab-specific and custom data analysis without restriction on its form or schema, reducing data formatting restrictions on end users. Such data should be placed in the analysis group. The analysis data should be documented so that it could be shared with other labs.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]} + }, ) scratch: Optional[List[Union[DynamicTable, NWBContainer]]] = Field( None, description="""A place to store one-off analysis results. Data placed here is not intended for sharing. By placing data here, users acknowledge that there is no guarantee that their data meets any standard.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]} + }, ) processing: Optional[List[ProcessingModule]] = Field( None, @@ -278,7 +295,10 @@ class NWBFileStimulus(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["stimulus"] = Field( - "stimulus", json_schema_extra={"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}} + "stimulus", + json_schema_extra={ + "linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"} + }, ) presentation: Optional[List[TimeSeries]] = Field( None, @@ -300,16 +320,27 @@ class NWBFileGeneral(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["general"] = Field( - "general", json_schema_extra={"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}} + "general", + json_schema_extra={ + "linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"} + }, + ) + data_collection: Optional[str] = Field( + None, description="""Notes about data collection and analysis.""" + ) + experiment_description: Optional[str] = Field( + None, description="""General description of the experiment.""" ) - data_collection: Optional[str] = Field(None, description="""Notes about data collection and analysis.""") - experiment_description: Optional[str] = Field(None, description="""General description of the experiment.""") experimenter: Optional[NDArray[Shape["* num_experimenters"], str]] = Field( None, description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}} + }, + ) + institution: Optional[str] = Field( + None, description="""Institution(s) where experiment was performed.""" ) - institution: Optional[str] = Field(None, description="""Institution(s) where experiment was performed.""") keywords: Optional[NDArray[Shape["* num_keywords"], str]] = Field( None, description="""Terms to search over.""", @@ -322,12 +353,15 @@ class NWBFileGeneral(ConfiguredBaseModel): description="""Description of drugs used, including how and when they were administered. Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc.""", ) protocol: Optional[str] = Field( - None, description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""" + None, + description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""", ) related_publications: Optional[NDArray[Shape["* num_publications"], str]] = Field( None, description="""Publication information. PMID, DOI, URL, etc.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}} + }, ) session_id: Optional[str] = Field(None, description="""Lab-specific ID for the session.""") slices: Optional[str] = Field( @@ -335,7 +369,8 @@ class NWBFileGeneral(ConfiguredBaseModel): description="""Description of slices, including information about preparation thickness, orientation, temperature, and bath solution.""", ) source_script: Optional[NWBFileGeneralSourceScript] = Field( - None, description="""Script file or link to public source code used to create this NWB file.""" + None, + description="""Script file or link to public source code used to create this NWB file.""", ) stimulus: Optional[str] = Field( None, description="""Notes about stimuli, such as how and where they were presented.""" @@ -358,7 +393,8 @@ class NWBFileGeneral(ConfiguredBaseModel): json_schema_extra={"linkml_meta": {"any_of": [{"range": "Device"}]}}, ) subject: Optional[Subject] = Field( - None, description="""Information about the animal or person from which the data was measured.""" + None, + description="""Information about the animal or person from which the data was measured.""", ) extracellular_ephys: Optional[NWBFileGeneralExtracellularEphys] = Field( None, description="""Metadata related to extracellular electrophysiology.""" @@ -387,7 +423,9 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel): name: Literal["source_script"] = Field( "source_script", - json_schema_extra={"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"} + }, ) file_name: Optional[str] = Field(None, description="""Name of script file.""") value: str = Field(...) @@ -403,10 +441,15 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel): name: Literal["extracellular_ephys"] = Field( "extracellular_ephys", json_schema_extra={ - "linkml_meta": {"equals_string": "extracellular_ephys", "ifabsent": "string(extracellular_ephys)"} + "linkml_meta": { + "equals_string": "extracellular_ephys", + "ifabsent": "string(extracellular_ephys)", + } }, ) - electrode_group: Optional[List[ElectrodeGroup]] = Field(None, description="""Physical group of electrodes.""") + electrode_group: Optional[List[ElectrodeGroup]] = Field( + None, description="""Physical group of electrodes.""" + ) electrodes: Optional[NWBFileGeneralExtracellularEphysElectrodes] = Field( None, description="""A table of all electrodes (i.e. channels) used for recording.""" ) @@ -421,48 +464,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): name: Literal["electrodes"] = Field( "electrodes", - json_schema_extra={"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"} + }, ) x: NDArray[Any, np.float32] = Field( ..., description="""x coordinate of the channel location in the brain (+x is posterior).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) y: NDArray[Any, np.float32] = Field( ..., description="""y coordinate of the channel location in the brain (+y is inferior).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) z: NDArray[Any, np.float32] = Field( ..., description="""z coordinate of the channel location in the brain (+z is right).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) imp: NDArray[Any, np.float32] = Field( ..., description="""Impedance of the channel, in ohms.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) location: NDArray[Any, str] = Field( ..., description="""Location of the electrode (channel). 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.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) filtering: NDArray[Any, np.float32] = Field( ..., description="""Description of hardware filtering, including the filter name and frequency cutoffs.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) group: List[ElectrodeGroup] = Field( @@ -472,42 +529,54 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): ..., description="""Name of the ElectrodeGroup this electrode is a part of.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_x: Optional[NDArray[Any, np.float32]] = Field( None, description="""x coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_y: Optional[NDArray[Any, np.float32]] = Field( None, description="""y coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_z: Optional[NDArray[Any, np.float32]] = Field( None, description="""z coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) reference: Optional[NDArray[Any, str]] = Field( None, description="""Description of the reference used for this electrode.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -528,7 +597,10 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel): name: Literal["intracellular_ephys"] = Field( "intracellular_ephys", json_schema_extra={ - "linkml_meta": {"equals_string": "intracellular_ephys", "ifabsent": "string(intracellular_ephys)"} + "linkml_meta": { + "equals_string": "intracellular_ephys", + "ifabsent": "string(intracellular_ephys)", + } }, ) filtering: Optional[str] = Field( @@ -548,7 +620,9 @@ class LabMetaData(NWBContainer): Lab-specific meta-data. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: str = Field(...) @@ -558,25 +632,34 @@ class Subject(NWBContainer): Information about the animal or person from which the data was measured. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: str = Field(...) - age: Optional[str] = Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""") + age: Optional[str] = Field( + None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""" + ) date_of_birth: Optional[np.datetime64] = Field( None, description="""Date of birth of subject. Can be supplied instead of 'age'.""" ) description: Optional[str] = Field( - None, description="""Description of subject and where subject came from (e.g., breeder, if animal).""" + None, + description="""Description of subject and where subject came from (e.g., breeder, if animal).""", + ) + genotype: Optional[str] = Field( + None, description="""Genetic strain. If absent, assume Wild Type (WT).""" ) - genotype: Optional[str] = Field(None, description="""Genetic strain. If absent, assume Wild Type (WT).""") sex: Optional[str] = Field(None, description="""Gender of subject.""") species: Optional[str] = Field(None, description="""Species of subject.""") strain: Optional[str] = Field(None, description="""Strain of subject.""") subject_id: Optional[str] = Field( - None, description="""ID of animal/person used/participating in experiment (lab convention).""" + None, + description="""ID of animal/person used/participating in experiment (lab convention).""", ) weight: Optional[str] = Field( - None, description="""Weight at time of experiment, at time of surgery and at other important times.""" + None, + description="""Weight at time of experiment, at time of surgery and at other important times.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_icephys.py index 18f59ac..48973c1 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_icephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_icephys.py @@ -29,7 +29,15 @@ from ...core.v2_3_0.core_nwb_base import ( Images, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape metamodel_version = "None" @@ -45,7 +53,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -90,7 +100,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.icephys/", "id": "core.nwb.icephys", - "imports": ["core.nwb.base", "core.nwb.device", "../../hdmf_common/v1_5_0/namespace", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "core.nwb.device", + "../../hdmf_common/v1_5_0/namespace", + "core.nwb.language", + ], "name": "core.nwb.icephys", } ) @@ -101,7 +116,9 @@ class PatchClampSeries(TimeSeries): An abstract base class for patch-clamp data - stimulus or response, current or voltage. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) stimulus_description: Optional[str] = Field( @@ -112,7 +129,8 @@ class PatchClampSeries(TimeSeries): ) data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""") gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -136,7 +154,9 @@ class PatchClampSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -152,7 +172,8 @@ class PatchClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -168,13 +189,17 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""") bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""") - capacitance_compensation: Optional[np.float32] = Field(None, description="""Capacitance compensation, in farads.""") + capacitance_compensation: Optional[np.float32] = Field( + None, description="""Capacitance compensation, in farads.""" + ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) @@ -182,7 +207,8 @@ class CurrentClampSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -206,7 +232,9 @@ class CurrentClampSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -222,7 +250,8 @@ class CurrentClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -236,14 +265,19 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) stimulus_description: Optional[str] = Field( - None, description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""" + None, + description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""", ) bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""") - bridge_balance: np.float32 = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + bridge_balance: np.float32 = Field( + ..., description="""Bridge balance, in ohms, fixed to 0.0.""" + ) capacitance_compensation: np.float32 = Field( ..., description="""Capacitance compensation, in farads, fixed to 0.0.""" ) @@ -252,7 +286,8 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -276,7 +311,9 @@ class IZeroClampSeries(CurrentClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -289,7 +326,9 @@ class CurrentClampStimulusSeries(PatchClampSeries): Stimulus current applied during current clamp recording. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: CurrentClampStimulusSeriesData = Field(..., description="""Stimulus current applied.""") @@ -300,7 +339,8 @@ class CurrentClampStimulusSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -324,7 +364,9 @@ class CurrentClampStimulusSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -340,7 +382,8 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -354,7 +397,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: VoltageClampSeriesData = Field(..., description="""Recorded current.""") @@ -376,8 +421,8 @@ class VoltageClampSeries(PatchClampSeries): whole_cell_capacitance_comp: Optional[VoltageClampSeriesWholeCellCapacitanceComp] = Field( None, description="""Whole cell capacitance compensation, in farads.""" ) - whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = Field( - None, description="""Whole cell series resistance compensation, in ohms.""" + whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = ( + Field(None, description="""Whole cell series resistance compensation, in ohms.""") ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" @@ -386,7 +431,8 @@ class VoltageClampSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -410,7 +456,9 @@ class VoltageClampSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -426,7 +474,8 @@ class VoltageClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -445,11 +494,15 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): name: Literal["capacitance_fast"] = Field( "capacitance_fast", json_schema_extra={ - "linkml_meta": {"equals_string": "capacitance_fast", "ifabsent": "string(capacitance_fast)"} + "linkml_meta": { + "equals_string": "capacitance_fast", + "ifabsent": "string(capacitance_fast)", + } }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -464,11 +517,15 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): name: Literal["capacitance_slow"] = Field( "capacitance_slow", json_schema_extra={ - "linkml_meta": {"equals_string": "capacitance_slow", "ifabsent": "string(capacitance_slow)"} + "linkml_meta": { + "equals_string": "capacitance_slow", + "ifabsent": "string(capacitance_slow)", + } }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -490,7 +547,8 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""" + None, + description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""", ) value: np.float32 = Field(...) @@ -512,7 +570,8 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""" + None, + description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""", ) value: np.float32 = Field(...) @@ -534,7 +593,8 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""" + None, + description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""", ) value: np.float32 = Field(...) @@ -556,7 +616,8 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -578,7 +639,8 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""" + None, + description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""", ) value: np.float32 = Field(...) @@ -588,7 +650,9 @@ class VoltageClampStimulusSeries(PatchClampSeries): Stimulus voltage applied during a voltage clamp recording. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: VoltageClampStimulusSeriesData = Field(..., description="""Stimulus voltage applied.""") @@ -599,7 +663,8 @@ class VoltageClampStimulusSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -623,7 +688,9 @@ class VoltageClampStimulusSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -639,7 +706,8 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -653,19 +721,27 @@ class IntracellularElectrode(NWBContainer): An intracellular electrode and its metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) - description: str = Field(..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""") + description: str = Field( + ..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""" + ) filtering: Optional[str] = Field(None, description="""Electrode specific filtering.""") - initial_access_resistance: Optional[str] = Field(None, description="""Initial access resistance.""") + initial_access_resistance: Optional[str] = Field( + None, description="""Initial access resistance.""" + ) location: Optional[str] = Field( None, description="""Location of the electrode. 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.""", ) resistance: Optional[str] = Field(None, description="""Electrode resistance, in ohms.""") seal: Optional[str] = Field(None, description="""Information about seal used for recording.""") - slice: Optional[str] = Field(None, description="""Information about slice used for recording.""") + slice: Optional[str] = Field( + None, description="""Information about slice used for recording.""" + ) class SweepTable(DynamicTable): @@ -673,14 +749,18 @@ class SweepTable(DynamicTable): The table which groups different PatchClampSeries together. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) sweep_number: NDArray[Any, np.uint32] = Field( ..., description="""Sweep number of the PatchClampSeries in that row.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) series: List[PatchClampSeries] = Field( @@ -689,13 +769,17 @@ class SweepTable(DynamicTable): series_index: Named[VectorIndex] = Field( ..., description="""Index for series.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_image.py index 8e1e106..8c7f6a7 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_image.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_image.py @@ -45,7 +45,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -101,7 +103,9 @@ class GrayscaleImage(Image): A grayscale image. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -122,7 +126,9 @@ class RGBImage(Image): A color image. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -143,7 +149,9 @@ class RGBAImage(Image): A color image with transparency. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -164,11 +172,16 @@ 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]. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: Optional[ - Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] + Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] ] = Field(None, description="""Binary data representing images across frames.""") dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -205,7 +218,9 @@ class ImageSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -222,7 +237,9 @@ class ImageSeriesExternalFile(ConfiguredBaseModel): name: Literal["external_file"] = Field( "external_file", - json_schema_extra={"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"} + }, ) starting_frame: Optional[np.int32] = Field( None, @@ -238,11 +255,16 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: Optional[ - Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] + Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] ] = Field(None, description="""Binary data representing images across frames.""") dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -279,7 +301,9 @@ class ImageMaskSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -292,15 +316,23 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) - distance: Optional[np.float32] = Field(None, description="""Distance from camera/monitor to target/eye.""") + distance: Optional[np.float32] = Field( + None, description="""Distance from camera/monitor to target/eye.""" + ) field_of_view: Optional[ - Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]] + Union[ + NDArray[Shape["2 width_height"], np.float32], + NDArray[Shape["3 width_height_depth"], np.float32], + ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number] + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number], ] = Field(..., description="""Images presented to subject, either grayscale or RGB""") orientation: Optional[str] = Field( None, @@ -341,7 +373,9 @@ class OpticalSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -354,7 +388,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.int32] = Field( @@ -384,7 +420,9 @@ class IndexSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_misc.py index 473aeaf..043a569 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_misc.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_misc.py @@ -8,9 +8,22 @@ import numpy as np from ...core.v2_3_0.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync from ...core.v2_3_0.core_nwb_ecephys import ElectrodeGroup from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape -from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTableRegion, DynamicTable, VectorData, VectorIndex +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, + DynamicTable, + VectorData, + VectorIndex, +) metamodel_version = "None" version = "2.3.0" @@ -25,7 +38,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -70,7 +85,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.misc/", "id": "core.nwb.misc", - "imports": ["core.nwb.base", "../../hdmf_common/v1_5_0/namespace", "core.nwb.ecephys", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "../../hdmf_common/v1_5_0/namespace", + "core.nwb.ecephys", + "core.nwb.language", + ], "name": "core.nwb.misc", } ) @@ -81,10 +101,14 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) - data: AbstractFeatureSeriesData = Field(..., description="""Values of each feature at each time.""") + data: AbstractFeatureSeriesData = Field( + ..., description="""Values of each feature at each time.""" + ) feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field( None, description="""Units of each feature.""", @@ -117,7 +141,9 @@ class AbstractFeatureSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -133,14 +159,18 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, description="""Since there can be different units for different features, store the units in 'feature_units'. The default value for this attribute is \"see 'feature_units'\".""", ) array: Optional[ - Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]] + Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_features"], np.number], + ] ] = Field(None) @@ -149,7 +179,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], str] = Field( @@ -179,7 +211,9 @@ class AnnotationSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -192,7 +226,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.int8] = Field( @@ -222,7 +258,9 @@ class IntervalSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -235,15 +273,21 @@ class DecompositionSeries(TimeSeries): Spectral analysis of a time series, e.g. of an LFP or a speech signal. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) - data: DecompositionSeriesData = Field(..., description="""Data decomposed into frequency bands.""") + data: DecompositionSeriesData = Field( + ..., description="""Data decomposed into frequency bands.""" + ) metric: str = Field(..., description="""The metric used, e.g. phase, amplitude, power.""") source_channels: Named[Optional[DynamicTableRegion]] = Field( None, description="""DynamicTableRegion pointer to the channels that this decomposition series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) bands: DecompositionSeriesBands = Field( ..., @@ -271,7 +315,9 @@ class DecompositionSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -287,7 +333,8 @@ class DecompositionSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -297,7 +344,13 @@ class DecompositionSeriesData(ConfiguredBaseModel): None, json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_times"}, {"alias": "num_channels"}, {"alias": "num_bands"}]} + "array": { + "dimensions": [ + {"alias": "num_times"}, + {"alias": "num_channels"}, + {"alias": "num_bands"}, + ] + } } }, ) @@ -311,13 +364,16 @@ class DecompositionSeriesBands(DynamicTable): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["bands"] = Field( - "bands", json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}} + "bands", + json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}}, ) band_name: NDArray[Any, str] = Field( ..., description="""Name of the band, e.g. theta.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field( @@ -325,7 +381,12 @@ class DecompositionSeriesBands(DynamicTable): description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_bands"}, {"alias": "low_high", "exact_cardinality": 2}]} + "array": { + "dimensions": [ + {"alias": "num_bands"}, + {"alias": "low_high", "exact_cardinality": 2}, + ] + } } }, ) @@ -343,7 +404,9 @@ class DecompositionSeriesBands(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -359,38 +422,55 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field("Units", json_schema_extra={"linkml_meta": {"ifabsent": "string(Units)"}}) spike_times_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the spike_times dataset.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, + ) + spike_times: Optional[UnitsSpikeTimes] = Field( + None, description="""Spike times for each unit.""" ) - spike_times: Optional[UnitsSpikeTimes] = Field(None, description="""Spike times for each unit.""") obs_intervals_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the obs_intervals dataset.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field( None, description="""Observation intervals for each unit.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_intervals"}, {"alias": "start_end", "exact_cardinality": 2}]} + "array": { + "dimensions": [ + {"alias": "num_intervals"}, + {"alias": "start_end", "exact_cardinality": 2}, + ] + } } }, ) electrodes_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into electrodes.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) electrodes: Named[Optional[DynamicTableRegion]] = Field( None, description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) electrode_group: Optional[List[ElectrodeGroup]] = Field( None, description="""Electrode group that each spike unit came from.""" @@ -411,24 +491,32 @@ class Units(DynamicTable): None, description="""Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same.""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_waveforms"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_waveforms"}, {"alias": "num_samples"}]} + } }, ) waveforms_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the waveforms dataset. One value for every spike event. See 'waveforms' for more detail.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) waveforms_index_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the waveforms_index dataset. One value for every unit (row in the table). See 'waveforms' for more detail.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -448,13 +536,17 @@ class UnitsSpikeTimes(VectorData): name: Literal["spike_times"] = Field( "spike_times", - json_schema_extra={"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"} + }, ) resolution: Optional[np.float64] = Field( None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""", ) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ogen.py index a062792..bdd0669 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ogen.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ogen.py @@ -8,7 +8,12 @@ from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator import numpy as np from numpydantic import NDArray, Shape -from ...core.v2_3_0.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync, NWBContainer +from ...core.v2_3_0.core_nwb_base import ( + TimeSeries, + TimeSeriesStartingTime, + TimeSeriesSync, + NWBContainer, +) metamodel_version = "None" version = "2.3.0" @@ -23,7 +28,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,7 +86,9 @@ class OptogeneticSeries(TimeSeries): An optogenetic stimulus. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ogen", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.number] = Field( @@ -109,7 +118,9 @@ class OptogeneticSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -122,7 +133,9 @@ class OptogeneticStimulusSite(NWBContainer): A site of optogenetic stimulation. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ogen", "tree_root": True} + ) name: str = Field(...) description: str = Field(..., description="""Description of stimulation site.""") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ophys.py index 7ca21a6..b10dd83 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ophys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ophys.py @@ -39,7 +39,15 @@ from ...core.v2_3_0.core_nwb_image import ( IndexSeries, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape metamodel_version = "None" @@ -55,7 +63,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -117,7 +127,9 @@ class TwoPhotonSeries(ImageSeries): Image stack recorded over time from 2-photon microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") @@ -126,10 +138,16 @@ class TwoPhotonSeries(ImageSeries): description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) field_of_view: Optional[ - Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]] + Union[ + NDArray[Shape["2 width_height"], np.float32], + NDArray[Shape["3 width_height_depth"], np.float32], + ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Optional[ - Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] + Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] ] = Field(None, description="""Binary data representing images across frames.""") dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -166,7 +184,9 @@ class TwoPhotonSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -179,16 +199,21 @@ class RoiResponseSeries(TimeSeries): ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) - data: Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_rois"], np.number]] = Field( - ..., description="""Signals from ROIs.""" - ) + data: Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_rois"], np.number], + ] = Field(..., description="""Signals from ROIs.""") rois: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -212,7 +237,9 @@ class RoiResponseSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -225,7 +252,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[RoiResponseSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}} @@ -238,7 +267,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[RoiResponseSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}} @@ -251,7 +282,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[PlaneSegmentation]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "PlaneSegmentation"}]}} @@ -264,7 +297,9 @@ class PlaneSegmentation(DynamicTable): Results from image segmentation of a specific imaging plane. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) image_mask: Optional[PlaneSegmentationImageMask] = Field( @@ -274,7 +309,9 @@ class PlaneSegmentation(DynamicTable): pixel_mask_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into pixel_mask.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) pixel_mask: Optional[PlaneSegmentationPixelMask] = Field( None, @@ -283,7 +320,9 @@ class PlaneSegmentation(DynamicTable): voxel_mask_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into voxel_mask.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) voxel_mask: Optional[PlaneSegmentationVoxelMask] = Field( None, @@ -298,7 +337,9 @@ class PlaneSegmentation(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -318,9 +359,13 @@ class PlaneSegmentationImageMask(VectorData): name: Literal["image_mask"] = Field( "image_mask", - json_schema_extra={"linkml_meta": {"equals_string": "image_mask", "ifabsent": "string(image_mask)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "image_mask", "ifabsent": "string(image_mask)"} + }, + ) + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" ) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -340,12 +385,16 @@ class PlaneSegmentationPixelMask(VectorData): name: Literal["pixel_mask"] = Field( "pixel_mask", - json_schema_extra={"linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"} + }, ) x: Optional[np.uint32] = Field(None, description="""Pixel x-coordinate.""") y: Optional[np.uint32] = Field(None, description="""Pixel y-coordinate.""") weight: Optional[np.float32] = Field(None, description="""Weight of the pixel.""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -365,13 +414,17 @@ class PlaneSegmentationVoxelMask(VectorData): name: Literal["voxel_mask"] = Field( "voxel_mask", - json_schema_extra={"linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"} + }, ) x: Optional[np.uint32] = Field(None, description="""Voxel x-coordinate.""") y: Optional[np.uint32] = Field(None, description="""Voxel y-coordinate.""") z: Optional[np.uint32] = Field(None, description="""Voxel z-coordinate.""") weight: Optional[np.float32] = Field(None, description="""Weight of the voxel.""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -387,7 +440,9 @@ class ImagingPlane(NWBContainer): An imaging plane and its metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[OpticalChannel]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "OpticalChannel"}]}} @@ -400,11 +455,15 @@ class OpticalChannel(NWBContainer): An optical channel used to record from an imaging plane. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) description: str = Field(..., description="""Description or other notes about the channel.""") - emission_lambda: np.float32 = Field(..., description="""Emission wavelength for channel, in nm.""") + emission_lambda: np.float32 = Field( + ..., description="""Emission wavelength for channel, in nm.""" + ) class MotionCorrection(NWBDataInterface): @@ -412,7 +471,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[CorrectedImageStack]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "CorrectedImageStack"}]}} @@ -425,10 +486,14 @@ class CorrectedImageStack(NWBDataInterface): Reuslts from motion correction of an image stack. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) - corrected: ImageSeries = Field(..., description="""Image stack with frames shifted to the common coordinates.""") + corrected: ImageSeries = Field( + ..., description="""Image stack with frames shifted to the common coordinates.""" + ) xy_translation: TimeSeries = Field( ..., 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.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_retinotopy.py index 5bb1fbf..8efb904 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_retinotopy.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_retinotopy.py @@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,9 +81,14 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.retinotopy", "tree_root": True} + ) - name: str = Field("ImagingRetinotopy", json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}}) + name: str = Field( + "ImagingRetinotopy", + json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}}, + ) axis_1_phase_map: ImagingRetinotopyAxis1PhaseMap = Field( ..., description="""Phase response to stimulus on the first measured axis.""" ) @@ -100,7 +107,9 @@ class ImagingRetinotopy(NWBDataInterface): ..., description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]} + } }, ) focal_depth_image: Optional[ImagingRetinotopyFocalDepthImage] = Field( @@ -108,10 +117,12 @@ class ImagingRetinotopy(NWBDataInterface): description="""Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].""", ) sign_map: Optional[ImagingRetinotopySignMap] = Field( - None, description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""" + None, + description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""", ) vasculature_image: ImagingRetinotopyVasculatureImage = Field( - ..., description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""" + ..., + description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""", ) @@ -125,18 +136,27 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): name: Literal["axis_1_phase_map"] = Field( "axis_1_phase_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_1_phase_map", "ifabsent": "string(axis_1_phase_map)"} + "linkml_meta": { + "equals_string": "axis_1_phase_map", + "ifabsent": "string(axis_1_phase_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -150,18 +170,27 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): name: Literal["axis_1_power_map"] = Field( "axis_1_power_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_1_power_map", "ifabsent": "string(axis_1_power_map)"} + "linkml_meta": { + "equals_string": "axis_1_power_map", + "ifabsent": "string(axis_1_power_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -175,18 +204,27 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): name: Literal["axis_2_phase_map"] = Field( "axis_2_phase_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_2_phase_map", "ifabsent": "string(axis_2_phase_map)"} + "linkml_meta": { + "equals_string": "axis_2_phase_map", + "ifabsent": "string(axis_2_phase_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -200,18 +238,27 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): name: Literal["axis_2_power_map"] = Field( "axis_2_power_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_2_power_map", "ifabsent": "string(axis_2_power_map)"} + "linkml_meta": { + "equals_string": "axis_2_power_map", + "ifabsent": "string(axis_2_power_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -225,7 +272,10 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): name: Literal["focal_depth_image"] = Field( "focal_depth_image", json_schema_extra={ - "linkml_meta": {"equals_string": "focal_depth_image", "ifabsent": "string(focal_depth_image)"} + "linkml_meta": { + "equals_string": "focal_depth_image", + "ifabsent": "string(focal_depth_image)", + } }, ) bits_per_pixel: Optional[np.int32] = Field( @@ -236,12 +286,20 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - focal_depth: Optional[np.float32] = Field(None, description="""Focal depth offset, in meters.""") - format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + focal_depth: Optional[np.float32] = Field( + None, description="""Focal depth offset, in meters.""" + ) + format: Optional[str] = Field( + None, description="""Format of image. Right now only 'raw' is supported.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -253,16 +311,23 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy"}) name: Literal["sign_map"] = Field( - "sign_map", json_schema_extra={"linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"}} + "sign_map", + json_schema_extra={ + "linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"} + }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -276,7 +341,10 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): name: Literal["vasculature_image"] = Field( "vasculature_image", json_schema_extra={ - "linkml_meta": {"equals_string": "vasculature_image", "ifabsent": "string(vasculature_image)"} + "linkml_meta": { + "equals_string": "vasculature_image", + "ifabsent": "string(vasculature_image)", + } }, ) bits_per_pixel: Optional[np.int32] = Field( @@ -287,11 +355,17 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + format: Optional[str] = Field( + None, description="""Format of image. Right now only 'raw' is supported.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/namespace.py index a74751d..807ed1c 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/namespace.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/namespace.py @@ -159,7 +159,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/__init__.py index 8d1c8b6..8b13789 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/__init__.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/__init__.py @@ -1 +1 @@ - + diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_base.py index 8d1c412..92a1f7e 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_base.py @@ -24,7 +24,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -69,7 +71,11 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.base/", "id": "core.nwb.base", - "imports": ["../../hdmf_common/v1_5_0/namespace", "../../hdmf_common/v1_5_0/namespace", "core.nwb.language"], + "imports": [ + "../../hdmf_common/v1_5_0/namespace", + "../../hdmf_common/v1_5_0/namespace", + "core.nwb.language", + ], "name": "core.nwb.base", } ) @@ -80,7 +86,9 @@ class NWBData(Data): An abstract data type for a dataset. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -90,18 +98,25 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) - name: str = Field("timeseries", json_schema_extra={"linkml_meta": {"ifabsent": "string(timeseries)"}}) + name: str = Field( + "timeseries", json_schema_extra={"linkml_meta": {"ifabsent": "string(timeseries)"}} + ) idx_start: np.int32 = Field( ..., description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) count: np.int32 = Field( - ..., description="""Number of data samples available in this time series, during this epoch""" + ..., + description="""Number of data samples available in this time series, during this epoch""", ) timeseries: TimeSeries = Field(..., description="""The TimeSeries that this index applies to""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -117,7 +132,9 @@ 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)). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -138,7 +155,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -148,7 +167,9 @@ class NWBDataInterface(NWBContainer): An abstract data type for a generic container storing collections of data, as opposed to metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -158,7 +179,9 @@ class TimeSeries(NWBDataInterface): General purpose time series. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of the time series.""") @@ -187,7 +210,9 @@ class TimeSeries(NWBDataInterface): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -203,7 +228,8 @@ class TimeSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) conversion: Optional[np.float32] = Field( None, @@ -240,10 +266,14 @@ class TimeSeriesStartingTime(ConfiguredBaseModel): name: Literal["starting_time"] = Field( "starting_time", - json_schema_extra={"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"} + }, ) rate: Optional[np.float32] = Field(None, description="""Sampling rate, in Hz.""") - unit: Optional[str] = Field(None, description="""Unit of measurement for time, which is fixed to 'seconds'.""") + unit: Optional[str] = Field( + None, description="""Unit of measurement for time, which is fixed to 'seconds'.""" + ) value: np.float64 = Field(...) @@ -255,7 +285,8 @@ class TimeSeriesSync(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"}) name: Literal["sync"] = Field( - "sync", json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}} + "sync", + json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}}, ) @@ -264,10 +295,15 @@ class ProcessingModule(NWBContainer): A collection of processed data. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) children: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field( - None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}} + None, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]} + }, ) name: str = Field(...) @@ -277,10 +313,14 @@ class Images(NWBDataInterface): A collection of images. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field("Images", json_schema_extra={"linkml_meta": {"ifabsent": "string(Images)"}}) - description: Optional[str] = Field(None, description="""Description of this collection of images.""") + description: Optional[str] = Field( + None, description="""Description of this collection of images.""" + ) image: List[Image] = Field(..., description="""Images stored in this collection.""") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_behavior.py index d78a72a..0931744 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_behavior.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_behavior.py @@ -70,7 +70,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -126,11 +128,14 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) name: str = Field(...) data: SpatialSeriesData = Field( - ..., description="""1-D or 2-D array storing position or direction relative to some reference frame.""" + ..., + description="""1-D or 2-D array storing position or direction relative to some reference frame.""", ) reference_frame: Optional[str] = Field( None, description="""Description defining what exactly 'straight-ahead' means.""" @@ -157,7 +162,9 @@ class SpatialSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -173,14 +180,18 @@ class SpatialSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, description="""Base unit of measurement for working with the data. The default value is 'meters'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) array: Optional[ - Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]] + Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_features"], np.number], + ] ] = Field(None) @@ -189,7 +200,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[IntervalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "IntervalSeries"}]}} @@ -202,7 +215,9 @@ class BehavioralEvents(NWBDataInterface): TimeSeries for storing behavioral events. See description of BehavioralEpochs for more details. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -215,7 +230,9 @@ class BehavioralTimeSeries(NWBDataInterface): TimeSeries for storing Behavoioral time series data. See description of BehavioralEpochs for more details. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -228,7 +245,9 @@ class PupilTracking(NWBDataInterface): Eye-tracking data, representing pupil size. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -241,7 +260,9 @@ class EyeTracking(NWBDataInterface): Eye-tracking data, representing direction of gaze. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} @@ -254,7 +275,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} @@ -267,7 +290,9 @@ class Position(NWBDataInterface): Position data, whether along the x, x/y or x/y/z axis. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_device.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_device.py index a4769f4..f59deb8 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_device.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_device.py @@ -22,7 +22,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -62,14 +64,18 @@ class Device(NWBContainer): Metadata about a data acquisition device, e.g., recording system, electrode, microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.device", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.device", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field( None, description="""Description of the device (e.g., model, firmware version, processing software version, etc.) as free-form text.""", ) - manufacturer: Optional[str] = Field(None, description="""The name of the manufacturer of the device.""") + manufacturer: Optional[str] = Field( + None, description="""The name of the manufacturer of the device.""" + ) # Model rebuild diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ecephys.py index 1e95799..1e4b58f 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ecephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ecephys.py @@ -7,7 +7,15 @@ import sys import numpy as np from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTableRegion from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from ...core.v2_4_0.core_nwb_base import ( TimeSeries, TimeSeriesStartingTime, @@ -30,7 +38,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -75,7 +85,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.ecephys/", "id": "core.nwb.ecephys", - "imports": ["core.nwb.base", "../../hdmf_common/v1_5_0/namespace", "core.nwb.device", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "../../hdmf_common/v1_5_0/namespace", + "core.nwb.device", + "core.nwb.language", + ], "name": "core.nwb.ecephys", } ) @@ -86,7 +101,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) filtering: Optional[str] = Field( @@ -101,7 +118,9 @@ class ElectricalSeries(TimeSeries): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( None, @@ -130,7 +149,9 @@ class ElectricalSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -143,7 +164,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) data: Union[ @@ -162,7 +185,9 @@ class SpikeEventSeries(ElectricalSeries): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( None, @@ -186,7 +211,9 @@ class SpikeEventSeries(ElectricalSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -199,9 +226,14 @@ class FeatureExtraction(NWBDataInterface): Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("FeatureExtraction", json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}}) + name: str = Field( + "FeatureExtraction", + json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}}, + ) description: NDArray[Shape["* num_features"], str] = Field( ..., description="""Description of features (eg, ''PC1'') for each of the extracted features.""", @@ -212,7 +244,13 @@ class FeatureExtraction(NWBDataInterface): description="""Multi-dimensional array of features extracted from each event.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_events"}, {"alias": "num_channels"}, {"alias": "num_features"}]} + "array": { + "dimensions": [ + {"alias": "num_events"}, + {"alias": "num_channels"}, + {"alias": "num_features"}, + ] + } } }, ) @@ -224,7 +262,9 @@ class FeatureExtraction(NWBDataInterface): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) @@ -233,9 +273,13 @@ class EventDetection(NWBDataInterface): Detected spike events from voltage trace(s). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}}) + name: str = Field( + "EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}} + ) detection_method: str = Field( ..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""", @@ -257,7 +301,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[SpikeEventSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpikeEventSeries"}]}} @@ -270,7 +316,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[ElectricalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}} @@ -283,7 +331,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[ElectricalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}} @@ -296,7 +346,9 @@ class ElectrodeGroup(NWBContainer): A physical grouping of electrodes, e.g. a shank of an array. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of this electrode group.""") @@ -317,7 +369,10 @@ class ElectrodeGroupPosition(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"}) name: Literal["position"] = Field( - "position", json_schema_extra={"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}} + "position", + json_schema_extra={ + "linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"} + }, ) x: Optional[np.float32] = Field(None, description="""x coordinate""") y: Optional[np.float32] = Field(None, description="""y coordinate""") @@ -329,22 +384,33 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("ClusterWaveforms", json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}}) - waveform_filtering: str = Field(..., description="""Filtering applied to data before generating mean/sd""") + name: str = Field( + "ClusterWaveforms", + json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}}, + ) + waveform_filtering: str = Field( + ..., description="""Filtering applied to data before generating mean/sd""" + ) waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( ..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]} + } }, ) waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( ..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]} + } }, ) @@ -354,9 +420,13 @@ class Clustering(NWBDataInterface): DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}}) + name: str = Field( + "Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}} + ) description: str = Field( ..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_epoch.py index 5587759..dbff30e 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_epoch.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_epoch.py @@ -6,7 +6,15 @@ import re import sys import numpy as np from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, VectorIndex, VectorData from ...core.v2_4_0.core_nwb_base import TimeSeries @@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -80,46 +90,62 @@ class TimeIntervals(DynamicTable): A container for aggregating epoch data and the TimeSeries that each epoch applies to. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.epoch", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.epoch", "tree_root": True} + ) name: str = Field(...) start_time: NDArray[Any, np.float32] = Field( ..., description="""Start time of epoch, in seconds.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) stop_time: NDArray[Any, np.float32] = Field( ..., description="""Stop time of epoch, in seconds.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) tags: Optional[NDArray[Any, str]] = Field( None, description="""User-defined tags that identify or categorize events.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) tags_index: Named[Optional[VectorIndex]] = Field( None, description="""Index for tags.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, + ) + timeseries: Optional[TimeIntervalsTimeseries] = Field( + None, description="""An index into a TimeSeries object.""" ) - timeseries: Optional[TimeIntervalsTimeseries] = Field(None, description="""An index into a TimeSeries object.""") timeseries_index: Named[Optional[VectorIndex]] = Field( None, description="""Index for timeseries.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -139,17 +165,24 @@ class TimeIntervalsTimeseries(VectorData): name: Literal["timeseries"] = Field( "timeseries", - json_schema_extra={"linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"} + }, ) idx_start: Optional[np.int32] = Field( None, description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) count: Optional[np.int32] = Field( - None, description="""Number of data samples available in this time series, during this epoch.""" + None, + description="""Number of data samples available in this time series, during this epoch.""", + ) + timeseries: Optional[TimeSeries] = Field( + None, description="""the TimeSeries that this index applies to.""" + ) + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" ) - timeseries: Optional[TimeSeries] = Field(None, description="""the TimeSeries that this index applies to.""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") array: Optional[ Union[ NDArray[Shape["* dim0"], Any], diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_file.py index 446a549..89862ef 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_file.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_file.py @@ -131,7 +131,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -198,10 +200,14 @@ class ScratchData(NWBData): Any one-off datasets """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: str = Field(...) - notes: Optional[str] = Field(None, description="""Any notes the user has about the dataset being stored""") + notes: Optional[str] = Field( + None, description="""Any notes the user has about the dataset being stored""" + ) class NWBFile(NWBContainer): @@ -209,10 +215,13 @@ class NWBFile(NWBContainer): An NWB:N file storing cellular-based neurophysiology data from a single experimental session. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: Literal["root"] = Field( - "root", json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}} + "root", + json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}}, ) nwb_version: Optional[str] = Field( None, @@ -221,7 +230,9 @@ class NWBFile(NWBContainer): file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = Field( ..., description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}} + }, ) identifier: str = Field( ..., @@ -241,17 +252,23 @@ class NWBFile(NWBContainer): acquisition: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field( None, description="""Data streams recorded from the system, including ephys, ophys, tracking, etc. This group should be read-only after the experiment is completed and timestamps are corrected to a common timebase. The data stored here may be links to raw data stored in external NWB files. This will allow keeping bulky raw data out of the file while preserving the option of keeping some/all in the file. Acquired data includes tracking and experimental data streams (i.e., everything measured from the system). If bulky data is stored in the /acquisition group, the data can exist in a separate NWB file that is linked to by the file being used for processing and analysis.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]} + }, ) analysis: Optional[List[Union[DynamicTable, NWBContainer]]] = Field( None, description="""Lab-specific and custom scientific analysis of data. There is no defined format for the content of this group - the format is up to the individual user/lab. To facilitate sharing analysis data between labs, the contents here should be stored in standard types (e.g., neurodata_types) and appropriately documented. The file can store lab-specific and custom data analysis without restriction on its form or schema, reducing data formatting restrictions on end users. Such data should be placed in the analysis group. The analysis data should be documented so that it could be shared with other labs.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]} + }, ) scratch: Optional[List[Union[DynamicTable, NWBContainer]]] = Field( None, description="""A place to store one-off analysis results. Data placed here is not intended for sharing. By placing data here, users acknowledge that there is no guarantee that their data meets any standard.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]} + }, ) processing: Optional[List[ProcessingModule]] = Field( None, @@ -291,7 +308,10 @@ class NWBFileStimulus(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["stimulus"] = Field( - "stimulus", json_schema_extra={"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}} + "stimulus", + json_schema_extra={ + "linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"} + }, ) presentation: Optional[List[TimeSeries]] = Field( None, @@ -313,16 +333,27 @@ class NWBFileGeneral(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["general"] = Field( - "general", json_schema_extra={"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}} + "general", + json_schema_extra={ + "linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"} + }, + ) + data_collection: Optional[str] = Field( + None, description="""Notes about data collection and analysis.""" + ) + experiment_description: Optional[str] = Field( + None, description="""General description of the experiment.""" ) - data_collection: Optional[str] = Field(None, description="""Notes about data collection and analysis.""") - experiment_description: Optional[str] = Field(None, description="""General description of the experiment.""") experimenter: Optional[NDArray[Shape["* num_experimenters"], str]] = Field( None, description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}} + }, + ) + institution: Optional[str] = Field( + None, description="""Institution(s) where experiment was performed.""" ) - institution: Optional[str] = Field(None, description="""Institution(s) where experiment was performed.""") keywords: Optional[NDArray[Shape["* num_keywords"], str]] = Field( None, description="""Terms to search over.""", @@ -335,12 +366,15 @@ class NWBFileGeneral(ConfiguredBaseModel): description="""Description of drugs used, including how and when they were administered. Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc.""", ) protocol: Optional[str] = Field( - None, description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""" + None, + description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""", ) related_publications: Optional[NDArray[Shape["* num_publications"], str]] = Field( None, description="""Publication information. PMID, DOI, URL, etc.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}} + }, ) session_id: Optional[str] = Field(None, description="""Lab-specific ID for the session.""") slices: Optional[str] = Field( @@ -348,7 +382,8 @@ class NWBFileGeneral(ConfiguredBaseModel): description="""Description of slices, including information about preparation thickness, orientation, temperature, and bath solution.""", ) source_script: Optional[NWBFileGeneralSourceScript] = Field( - None, description="""Script file or link to public source code used to create this NWB file.""" + None, + description="""Script file or link to public source code used to create this NWB file.""", ) stimulus: Optional[str] = Field( None, description="""Notes about stimuli, such as how and where they were presented.""" @@ -371,7 +406,8 @@ class NWBFileGeneral(ConfiguredBaseModel): json_schema_extra={"linkml_meta": {"any_of": [{"range": "Device"}]}}, ) subject: Optional[Subject] = Field( - None, description="""Information about the animal or person from which the data was measured.""" + None, + description="""Information about the animal or person from which the data was measured.""", ) extracellular_ephys: Optional[NWBFileGeneralExtracellularEphys] = Field( None, description="""Metadata related to extracellular electrophysiology.""" @@ -400,7 +436,9 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel): name: Literal["source_script"] = Field( "source_script", - json_schema_extra={"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"} + }, ) file_name: Optional[str] = Field(None, description="""Name of script file.""") value: str = Field(...) @@ -416,10 +454,15 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel): name: Literal["extracellular_ephys"] = Field( "extracellular_ephys", json_schema_extra={ - "linkml_meta": {"equals_string": "extracellular_ephys", "ifabsent": "string(extracellular_ephys)"} + "linkml_meta": { + "equals_string": "extracellular_ephys", + "ifabsent": "string(extracellular_ephys)", + } }, ) - electrode_group: Optional[List[ElectrodeGroup]] = Field(None, description="""Physical group of electrodes.""") + electrode_group: Optional[List[ElectrodeGroup]] = Field( + None, description="""Physical group of electrodes.""" + ) electrodes: Optional[NWBFileGeneralExtracellularEphysElectrodes] = Field( None, description="""A table of all electrodes (i.e. channels) used for recording.""" ) @@ -434,48 +477,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): name: Literal["electrodes"] = Field( "electrodes", - json_schema_extra={"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"} + }, ) x: NDArray[Any, np.float32] = Field( ..., description="""x coordinate of the channel location in the brain (+x is posterior).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) y: NDArray[Any, np.float32] = Field( ..., description="""y coordinate of the channel location in the brain (+y is inferior).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) z: NDArray[Any, np.float32] = Field( ..., description="""z coordinate of the channel location in the brain (+z is right).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) imp: NDArray[Any, np.float32] = Field( ..., description="""Impedance of the channel, in ohms.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) location: NDArray[Any, str] = Field( ..., description="""Location of the electrode (channel). 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.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) filtering: NDArray[Any, str] = Field( ..., description="""Description of hardware filtering, including the filter name and frequency cutoffs.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) group: List[ElectrodeGroup] = Field( @@ -485,42 +542,54 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): ..., description="""Name of the ElectrodeGroup this electrode is a part of.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_x: Optional[NDArray[Any, np.float32]] = Field( None, description="""x coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_y: Optional[NDArray[Any, np.float32]] = Field( None, description="""y coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_z: Optional[NDArray[Any, np.float32]] = Field( None, description="""z coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) reference: Optional[NDArray[Any, str]] = Field( None, description="""Description of the reference used for this electrode.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -541,7 +610,10 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel): name: Literal["intracellular_ephys"] = Field( "intracellular_ephys", json_schema_extra={ - "linkml_meta": {"equals_string": "intracellular_ephys", "ifabsent": "string(intracellular_ephys)"} + "linkml_meta": { + "equals_string": "intracellular_ephys", + "ifabsent": "string(intracellular_ephys)", + } }, ) filtering: Optional[str] = Field( @@ -582,7 +654,9 @@ class LabMetaData(NWBContainer): Lab-specific meta-data. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: str = Field(...) @@ -592,25 +666,34 @@ class Subject(NWBContainer): Information about the animal or person from which the data was measured. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: str = Field(...) - age: Optional[str] = Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""") + age: Optional[str] = Field( + None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""" + ) date_of_birth: Optional[np.datetime64] = Field( None, description="""Date of birth of subject. Can be supplied instead of 'age'.""" ) description: Optional[str] = Field( - None, description="""Description of subject and where subject came from (e.g., breeder, if animal).""" + None, + description="""Description of subject and where subject came from (e.g., breeder, if animal).""", + ) + genotype: Optional[str] = Field( + None, description="""Genetic strain. If absent, assume Wild Type (WT).""" ) - genotype: Optional[str] = Field(None, description="""Genetic strain. If absent, assume Wild Type (WT).""") sex: Optional[str] = Field(None, description="""Gender of subject.""") species: Optional[str] = Field(None, description="""Species of subject.""") strain: Optional[str] = Field(None, description="""Strain of subject.""") subject_id: Optional[str] = Field( - None, description="""ID of animal/person used/participating in experiment (lab convention).""" + None, + description="""ID of animal/person used/participating in experiment (lab convention).""", ) weight: Optional[str] = Field( - None, description="""Weight at time of experiment, at time of surgery and at other important times.""" + None, + description="""Weight at time of experiment, at time of surgery and at other important times.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_icephys.py index db45e8e..a21be46 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_icephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_icephys.py @@ -30,7 +30,15 @@ from ...core.v2_4_0.core_nwb_base import ( Images, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape metamodel_version = "None" @@ -46,7 +54,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -91,7 +101,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.icephys/", "id": "core.nwb.icephys", - "imports": ["core.nwb.base", "core.nwb.device", "../../hdmf_common/v1_5_0/namespace", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "core.nwb.device", + "../../hdmf_common/v1_5_0/namespace", + "core.nwb.language", + ], "name": "core.nwb.icephys", } ) @@ -102,7 +117,9 @@ class PatchClampSeries(TimeSeries): An abstract base class for patch-clamp data - stimulus or response, current or voltage. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) stimulus_description: Optional[str] = Field( @@ -113,7 +130,8 @@ class PatchClampSeries(TimeSeries): ) data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""") gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -137,7 +155,9 @@ class PatchClampSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -153,7 +173,8 @@ class PatchClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -169,13 +190,17 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""") bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""") - capacitance_compensation: Optional[np.float32] = Field(None, description="""Capacitance compensation, in farads.""") + capacitance_compensation: Optional[np.float32] = Field( + None, description="""Capacitance compensation, in farads.""" + ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) @@ -183,7 +208,8 @@ class CurrentClampSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -207,7 +233,9 @@ class CurrentClampSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -223,7 +251,8 @@ class CurrentClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -237,14 +266,19 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) stimulus_description: Optional[str] = Field( - None, description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""" + None, + description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""", ) bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""") - bridge_balance: np.float32 = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + bridge_balance: np.float32 = Field( + ..., description="""Bridge balance, in ohms, fixed to 0.0.""" + ) capacitance_compensation: np.float32 = Field( ..., description="""Capacitance compensation, in farads, fixed to 0.0.""" ) @@ -253,7 +287,8 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -277,7 +312,9 @@ class IZeroClampSeries(CurrentClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -290,7 +327,9 @@ class CurrentClampStimulusSeries(PatchClampSeries): Stimulus current applied during current clamp recording. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: CurrentClampStimulusSeriesData = Field(..., description="""Stimulus current applied.""") @@ -301,7 +340,8 @@ class CurrentClampStimulusSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -325,7 +365,9 @@ class CurrentClampStimulusSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -341,7 +383,8 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -355,7 +398,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: VoltageClampSeriesData = Field(..., description="""Recorded current.""") @@ -377,8 +422,8 @@ class VoltageClampSeries(PatchClampSeries): whole_cell_capacitance_comp: Optional[VoltageClampSeriesWholeCellCapacitanceComp] = Field( None, description="""Whole cell capacitance compensation, in farads.""" ) - whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = Field( - None, description="""Whole cell series resistance compensation, in ohms.""" + whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = ( + Field(None, description="""Whole cell series resistance compensation, in ohms.""") ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" @@ -387,7 +432,8 @@ class VoltageClampSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -411,7 +457,9 @@ class VoltageClampSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -427,7 +475,8 @@ class VoltageClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -446,11 +495,15 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): name: Literal["capacitance_fast"] = Field( "capacitance_fast", json_schema_extra={ - "linkml_meta": {"equals_string": "capacitance_fast", "ifabsent": "string(capacitance_fast)"} + "linkml_meta": { + "equals_string": "capacitance_fast", + "ifabsent": "string(capacitance_fast)", + } }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -465,11 +518,15 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): name: Literal["capacitance_slow"] = Field( "capacitance_slow", json_schema_extra={ - "linkml_meta": {"equals_string": "capacitance_slow", "ifabsent": "string(capacitance_slow)"} + "linkml_meta": { + "equals_string": "capacitance_slow", + "ifabsent": "string(capacitance_slow)", + } }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -491,7 +548,8 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""" + None, + description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""", ) value: np.float32 = Field(...) @@ -513,7 +571,8 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""" + None, + description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""", ) value: np.float32 = Field(...) @@ -535,7 +594,8 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""" + None, + description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""", ) value: np.float32 = Field(...) @@ -557,7 +617,8 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -579,7 +640,8 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""" + None, + description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""", ) value: np.float32 = Field(...) @@ -589,7 +651,9 @@ class VoltageClampStimulusSeries(PatchClampSeries): Stimulus voltage applied during a voltage clamp recording. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: VoltageClampStimulusSeriesData = Field(..., description="""Stimulus voltage applied.""") @@ -600,7 +664,8 @@ class VoltageClampStimulusSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -624,7 +689,9 @@ class VoltageClampStimulusSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -640,7 +707,8 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -654,19 +722,27 @@ class IntracellularElectrode(NWBContainer): An intracellular electrode and its metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) - description: str = Field(..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""") + description: str = Field( + ..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""" + ) filtering: Optional[str] = Field(None, description="""Electrode specific filtering.""") - initial_access_resistance: Optional[str] = Field(None, description="""Initial access resistance.""") + initial_access_resistance: Optional[str] = Field( + None, description="""Initial access resistance.""" + ) location: Optional[str] = Field( None, description="""Location of the electrode. 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.""", ) resistance: Optional[str] = Field(None, description="""Electrode resistance, in ohms.""") seal: Optional[str] = Field(None, description="""Information about seal used for recording.""") - slice: Optional[str] = Field(None, description="""Information about slice used for recording.""") + slice: Optional[str] = Field( + None, description="""Information about slice used for recording.""" + ) class SweepTable(DynamicTable): @@ -674,14 +750,18 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) sweep_number: NDArray[Any, np.uint32] = Field( ..., description="""Sweep number of the PatchClampSeries in that row.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) series: List[PatchClampSeries] = Field( @@ -690,13 +770,17 @@ class SweepTable(DynamicTable): series_index: Named[VectorIndex] = Field( ..., description="""Index for series.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -712,10 +796,14 @@ class IntracellularElectrodesTable(DynamicTable): Table for storing intracellular electrode related metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) electrode: List[IntracellularElectrode] = Field( ..., description="""Column for storing the reference to the intracellular electrode.""" ) @@ -738,14 +826,20 @@ class IntracellularStimuliTable(DynamicTable): Table for storing intracellular stimulus related metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) stimulus: Named[TimeSeriesReferenceVectorData] = Field( ..., description="""Column storing the reference to the recorded stimulus for the recording (rows).""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, @@ -766,14 +860,20 @@ class IntracellularResponsesTable(DynamicTable): Table for storing intracellular response related metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) response: Named[TimeSeriesReferenceVectorData] = Field( ..., description="""Column storing the reference to the recorded response for the recording (rows)""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, @@ -794,12 +894,17 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: Literal["intracellular_recordings"] = Field( "intracellular_recordings", json_schema_extra={ - "linkml_meta": {"equals_string": "intracellular_recordings", "ifabsent": "string(intracellular_recordings)"} + "linkml_meta": { + "equals_string": "intracellular_recordings", + "ifabsent": "string(intracellular_recordings)", + } }, ) description: Optional[str] = Field( @@ -837,27 +942,37 @@ class SimultaneousRecordingsTable(DynamicTable): A table for grouping different intracellular recordings from the IntracellularRecordingsTable table together that were recorded simultaneously from different electrodes. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: Literal["simultaneous_recordings"] = Field( "simultaneous_recordings", json_schema_extra={ - "linkml_meta": {"equals_string": "simultaneous_recordings", "ifabsent": "string(simultaneous_recordings)"} + "linkml_meta": { + "equals_string": "simultaneous_recordings", + "ifabsent": "string(simultaneous_recordings)", + } }, ) recordings: SimultaneousRecordingsTableRecordings = Field( - ..., description="""A reference to one or more rows in the IntracellularRecordingsTable table.""" + ..., + description="""A reference to one or more rows in the IntracellularRecordingsTable table.""", ) recordings_index: Named[VectorIndex] = Field( ..., description="""Index dataset for the recordings column.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -877,13 +992,17 @@ class SimultaneousRecordingsTableRecordings(DynamicTableRegion): name: Literal["recordings"] = Field( "recordings", - json_schema_extra={"linkml_meta": {"equals_string": "recordings", "ifabsent": "string(recordings)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "recordings", "ifabsent": "string(recordings)"} + }, ) table: Optional[IntracellularRecordingsTable] = Field( None, description="""Reference to the IntracellularRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""", ) - description: Optional[str] = Field(None, description="""Description of what this table region points to.""") + description: Optional[str] = Field( + None, description="""Description of what this table region points to.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -899,34 +1018,46 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: Literal["sequential_recordings"] = Field( "sequential_recordings", json_schema_extra={ - "linkml_meta": {"equals_string": "sequential_recordings", "ifabsent": "string(sequential_recordings)"} + "linkml_meta": { + "equals_string": "sequential_recordings", + "ifabsent": "string(sequential_recordings)", + } }, ) simultaneous_recordings: SequentialRecordingsTableSimultaneousRecordings = Field( - ..., description="""A reference to one or more rows in the SimultaneousRecordingsTable table.""" + ..., + description="""A reference to one or more rows in the SimultaneousRecordingsTable table.""", ) simultaneous_recordings_index: Named[VectorIndex] = Field( ..., description="""Index dataset for the simultaneous_recordings column.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) stimulus_type: NDArray[Any, str] = Field( ..., description="""The type of stimulus used for the sequential recording.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -947,14 +1078,19 @@ class SequentialRecordingsTableSimultaneousRecordings(DynamicTableRegion): name: Literal["simultaneous_recordings"] = Field( "simultaneous_recordings", json_schema_extra={ - "linkml_meta": {"equals_string": "simultaneous_recordings", "ifabsent": "string(simultaneous_recordings)"} + "linkml_meta": { + "equals_string": "simultaneous_recordings", + "ifabsent": "string(simultaneous_recordings)", + } }, ) table: Optional[SimultaneousRecordingsTable] = Field( None, description="""Reference to the SimultaneousRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""", ) - description: Optional[str] = Field(None, description="""Description of what this table region points to.""") + description: Optional[str] = Field( + None, description="""Description of what this table region points to.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -970,25 +1106,34 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: Literal["repetitions"] = Field( "repetitions", - json_schema_extra={"linkml_meta": {"equals_string": "repetitions", "ifabsent": "string(repetitions)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "repetitions", "ifabsent": "string(repetitions)"} + }, ) sequential_recordings: RepetitionsTableSequentialRecordings = Field( - ..., description="""A reference to one or more rows in the SequentialRecordingsTable table.""" + ..., + description="""A reference to one or more rows in the SequentialRecordingsTable table.""", ) sequential_recordings_index: Named[VectorIndex] = Field( ..., description="""Index dataset for the sequential_recordings column.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -1009,14 +1154,19 @@ class RepetitionsTableSequentialRecordings(DynamicTableRegion): name: Literal["sequential_recordings"] = Field( "sequential_recordings", json_schema_extra={ - "linkml_meta": {"equals_string": "sequential_recordings", "ifabsent": "string(sequential_recordings)"} + "linkml_meta": { + "equals_string": "sequential_recordings", + "ifabsent": "string(sequential_recordings)", + } }, ) table: Optional[SequentialRecordingsTable] = Field( None, description="""Reference to the SequentialRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""", ) - description: Optional[str] = Field(None, description="""Description of what this table region points to.""") + description: Optional[str] = Field( + None, description="""Description of what this table region points to.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -1032,12 +1182,17 @@ class ExperimentalConditionsTable(DynamicTable): A table for grouping different intracellular recording repetitions together that belong to the same experimental condition. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: Literal["experimental_conditions"] = Field( "experimental_conditions", json_schema_extra={ - "linkml_meta": {"equals_string": "experimental_conditions", "ifabsent": "string(experimental_conditions)"} + "linkml_meta": { + "equals_string": "experimental_conditions", + "ifabsent": "string(experimental_conditions)", + } }, ) repetitions: ExperimentalConditionsTableRepetitions = Field( @@ -1046,13 +1201,17 @@ class ExperimentalConditionsTable(DynamicTable): repetitions_index: Named[VectorIndex] = Field( ..., description="""Index dataset for the repetitions column.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -1072,13 +1231,17 @@ class ExperimentalConditionsTableRepetitions(DynamicTableRegion): name: Literal["repetitions"] = Field( "repetitions", - json_schema_extra={"linkml_meta": {"equals_string": "repetitions", "ifabsent": "string(repetitions)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "repetitions", "ifabsent": "string(repetitions)"} + }, ) table: Optional[RepetitionsTable] = Field( None, description="""Reference to the RepetitionsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""", ) - description: Optional[str] = Field(None, description="""Description of what this table region points to.""") + description: Optional[str] = Field( + None, description="""Description of what this table region points to.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_image.py index a467ba4..407d1ad 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_image.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_image.py @@ -46,7 +46,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -102,7 +104,9 @@ class GrayscaleImage(Image): A grayscale image. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -123,7 +127,9 @@ class RGBImage(Image): A color image. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -144,7 +150,9 @@ class RGBAImage(Image): A color image with transparency. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -165,14 +173,17 @@ 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]. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) - data: Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] = ( - Field( - ..., - description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", - ) + data: Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] = Field( + ..., + description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -209,7 +220,9 @@ class ImageSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -226,7 +239,9 @@ class ImageSeriesExternalFile(ConfiguredBaseModel): name: Literal["external_file"] = Field( "external_file", - json_schema_extra={"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"} + }, ) starting_frame: Optional[np.int32] = Field( None, @@ -242,14 +257,17 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) - data: Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] = ( - Field( - ..., - description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", - ) + data: Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] = Field( + ..., + description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -286,7 +304,9 @@ class ImageMaskSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -299,15 +319,23 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) - distance: Optional[np.float32] = Field(None, description="""Distance from camera/monitor to target/eye.""") + distance: Optional[np.float32] = Field( + None, description="""Distance from camera/monitor to target/eye.""" + ) field_of_view: Optional[ - Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]] + Union[ + NDArray[Shape["2 width_height"], np.float32], + NDArray[Shape["3 width_height_depth"], np.float32], + ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number] + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number], ] = Field(..., description="""Images presented to subject, either grayscale or RGB""") orientation: Optional[str] = Field( None, @@ -348,7 +376,9 @@ class OpticalSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -361,7 +391,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.int32] = Field( @@ -391,7 +423,9 @@ class IndexSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_misc.py index db4e668..56cc233 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_misc.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_misc.py @@ -8,9 +8,22 @@ import numpy as np from ...core.v2_4_0.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync from ...core.v2_4_0.core_nwb_ecephys import ElectrodeGroup from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape -from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTableRegion, DynamicTable, VectorData, VectorIndex +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, + DynamicTable, + VectorData, + VectorIndex, +) metamodel_version = "None" version = "2.4.0" @@ -25,7 +38,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -70,7 +85,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.misc/", "id": "core.nwb.misc", - "imports": ["core.nwb.base", "../../hdmf_common/v1_5_0/namespace", "core.nwb.ecephys", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "../../hdmf_common/v1_5_0/namespace", + "core.nwb.ecephys", + "core.nwb.language", + ], "name": "core.nwb.misc", } ) @@ -81,10 +101,14 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) - data: AbstractFeatureSeriesData = Field(..., description="""Values of each feature at each time.""") + data: AbstractFeatureSeriesData = Field( + ..., description="""Values of each feature at each time.""" + ) feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field( None, description="""Units of each feature.""", @@ -117,7 +141,9 @@ class AbstractFeatureSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -133,14 +159,18 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, description="""Since there can be different units for different features, store the units in 'feature_units'. The default value for this attribute is \"see 'feature_units'\".""", ) array: Optional[ - Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]] + Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_features"], np.number], + ] ] = Field(None) @@ -149,7 +179,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], str] = Field( @@ -179,7 +211,9 @@ class AnnotationSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -192,7 +226,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.int8] = Field( @@ -222,7 +258,9 @@ class IntervalSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -235,15 +273,21 @@ class DecompositionSeries(TimeSeries): Spectral analysis of a time series, e.g. of an LFP or a speech signal. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) - data: DecompositionSeriesData = Field(..., description="""Data decomposed into frequency bands.""") + data: DecompositionSeriesData = Field( + ..., description="""Data decomposed into frequency bands.""" + ) metric: str = Field(..., description="""The metric used, e.g. phase, amplitude, power.""") source_channels: Named[Optional[DynamicTableRegion]] = Field( None, description="""DynamicTableRegion pointer to the channels that this decomposition series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) bands: DecompositionSeriesBands = Field( ..., @@ -271,7 +315,9 @@ class DecompositionSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -287,7 +333,8 @@ class DecompositionSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -297,7 +344,13 @@ class DecompositionSeriesData(ConfiguredBaseModel): None, json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_times"}, {"alias": "num_channels"}, {"alias": "num_bands"}]} + "array": { + "dimensions": [ + {"alias": "num_times"}, + {"alias": "num_channels"}, + {"alias": "num_bands"}, + ] + } } }, ) @@ -311,13 +364,16 @@ class DecompositionSeriesBands(DynamicTable): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["bands"] = Field( - "bands", json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}} + "bands", + json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}}, ) band_name: NDArray[Any, str] = Field( ..., description="""Name of the band, e.g. theta.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field( @@ -325,7 +381,12 @@ class DecompositionSeriesBands(DynamicTable): description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_bands"}, {"alias": "low_high", "exact_cardinality": 2}]} + "array": { + "dimensions": [ + {"alias": "num_bands"}, + {"alias": "low_high", "exact_cardinality": 2}, + ] + } } }, ) @@ -343,7 +404,9 @@ class DecompositionSeriesBands(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -359,38 +422,55 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field("Units", json_schema_extra={"linkml_meta": {"ifabsent": "string(Units)"}}) spike_times_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the spike_times dataset.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, + ) + spike_times: Optional[UnitsSpikeTimes] = Field( + None, description="""Spike times for each unit.""" ) - spike_times: Optional[UnitsSpikeTimes] = Field(None, description="""Spike times for each unit.""") obs_intervals_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the obs_intervals dataset.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field( None, description="""Observation intervals for each unit.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_intervals"}, {"alias": "start_end", "exact_cardinality": 2}]} + "array": { + "dimensions": [ + {"alias": "num_intervals"}, + {"alias": "start_end", "exact_cardinality": 2}, + ] + } } }, ) electrodes_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into electrodes.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) electrodes: Named[Optional[DynamicTableRegion]] = Field( None, description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) electrode_group: Optional[List[ElectrodeGroup]] = Field( None, description="""Electrode group that each spike unit came from.""" @@ -411,24 +491,32 @@ class Units(DynamicTable): None, description="""Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same.""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_waveforms"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_waveforms"}, {"alias": "num_samples"}]} + } }, ) waveforms_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the waveforms dataset. One value for every spike event. See 'waveforms' for more detail.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) waveforms_index_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the waveforms_index dataset. One value for every unit (row in the table). See 'waveforms' for more detail.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -448,13 +536,17 @@ class UnitsSpikeTimes(VectorData): name: Literal["spike_times"] = Field( "spike_times", - json_schema_extra={"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"} + }, ) resolution: Optional[np.float64] = Field( None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""", ) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ogen.py index 5cb714a..78f7870 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ogen.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ogen.py @@ -8,7 +8,12 @@ from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator import numpy as np from numpydantic import NDArray, Shape -from ...core.v2_4_0.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync, NWBContainer +from ...core.v2_4_0.core_nwb_base import ( + TimeSeries, + TimeSeriesStartingTime, + TimeSeriesSync, + NWBContainer, +) metamodel_version = "None" version = "2.4.0" @@ -23,7 +28,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,7 +86,9 @@ class OptogeneticSeries(TimeSeries): An optogenetic stimulus. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ogen", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.number] = Field( @@ -109,7 +118,9 @@ class OptogeneticSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -122,7 +133,9 @@ class OptogeneticStimulusSite(NWBContainer): A site of optogenetic stimulation. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ogen", "tree_root": True} + ) name: str = Field(...) description: str = Field(..., description="""Description of stimulation site.""") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ophys.py index 41ac65e..62a3641 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ophys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ophys.py @@ -40,7 +40,15 @@ from ...core.v2_4_0.core_nwb_image import ( IndexSeries, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape metamodel_version = "None" @@ -56,7 +64,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -118,7 +128,9 @@ class TwoPhotonSeries(ImageSeries): Image stack recorded over time from 2-photon microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") @@ -127,13 +139,17 @@ class TwoPhotonSeries(ImageSeries): description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) field_of_view: Optional[ - Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]] + Union[ + NDArray[Shape["2 width_height"], np.float32], + NDArray[Shape["3 width_height_depth"], np.float32], + ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") - data: Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] = ( - Field( - ..., - description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", - ) + data: Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] = Field( + ..., + description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -170,7 +186,9 @@ class TwoPhotonSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -183,16 +201,21 @@ class RoiResponseSeries(TimeSeries): ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) - data: Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_rois"], np.number]] = Field( - ..., description="""Signals from ROIs.""" - ) + data: Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_rois"], np.number], + ] = Field(..., description="""Signals from ROIs.""") rois: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -216,7 +239,9 @@ class RoiResponseSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -229,7 +254,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[RoiResponseSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}} @@ -242,7 +269,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[RoiResponseSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}} @@ -255,7 +284,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[PlaneSegmentation]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "PlaneSegmentation"}]}} @@ -268,7 +299,9 @@ class PlaneSegmentation(DynamicTable): Results from image segmentation of a specific imaging plane. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) image_mask: Optional[PlaneSegmentationImageMask] = Field( @@ -278,7 +311,9 @@ class PlaneSegmentation(DynamicTable): pixel_mask_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into pixel_mask.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) pixel_mask: Optional[PlaneSegmentationPixelMask] = Field( None, @@ -287,7 +322,9 @@ class PlaneSegmentation(DynamicTable): voxel_mask_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into voxel_mask.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) voxel_mask: Optional[PlaneSegmentationVoxelMask] = Field( None, @@ -302,7 +339,9 @@ class PlaneSegmentation(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -322,9 +361,13 @@ class PlaneSegmentationImageMask(VectorData): name: Literal["image_mask"] = Field( "image_mask", - json_schema_extra={"linkml_meta": {"equals_string": "image_mask", "ifabsent": "string(image_mask)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "image_mask", "ifabsent": "string(image_mask)"} + }, + ) + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" ) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -344,12 +387,16 @@ class PlaneSegmentationPixelMask(VectorData): name: Literal["pixel_mask"] = Field( "pixel_mask", - json_schema_extra={"linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"} + }, ) x: Optional[np.uint32] = Field(None, description="""Pixel x-coordinate.""") y: Optional[np.uint32] = Field(None, description="""Pixel y-coordinate.""") weight: Optional[np.float32] = Field(None, description="""Weight of the pixel.""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -369,13 +416,17 @@ class PlaneSegmentationVoxelMask(VectorData): name: Literal["voxel_mask"] = Field( "voxel_mask", - json_schema_extra={"linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"} + }, ) x: Optional[np.uint32] = Field(None, description="""Voxel x-coordinate.""") y: Optional[np.uint32] = Field(None, description="""Voxel y-coordinate.""") z: Optional[np.uint32] = Field(None, description="""Voxel z-coordinate.""") weight: Optional[np.float32] = Field(None, description="""Weight of the voxel.""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -391,7 +442,9 @@ class ImagingPlane(NWBContainer): An imaging plane and its metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[OpticalChannel]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "OpticalChannel"}]}} @@ -404,11 +457,15 @@ class OpticalChannel(NWBContainer): An optical channel used to record from an imaging plane. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) description: str = Field(..., description="""Description or other notes about the channel.""") - emission_lambda: np.float32 = Field(..., description="""Emission wavelength for channel, in nm.""") + emission_lambda: np.float32 = Field( + ..., description="""Emission wavelength for channel, in nm.""" + ) class MotionCorrection(NWBDataInterface): @@ -416,7 +473,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[CorrectedImageStack]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "CorrectedImageStack"}]}} @@ -429,10 +488,14 @@ class CorrectedImageStack(NWBDataInterface): Reuslts from motion correction of an image stack. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) - corrected: ImageSeries = Field(..., description="""Image stack with frames shifted to the common coordinates.""") + corrected: ImageSeries = Field( + ..., description="""Image stack with frames shifted to the common coordinates.""" + ) xy_translation: TimeSeries = Field( ..., 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.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_retinotopy.py index 342aad8..4ca390b 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_retinotopy.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_retinotopy.py @@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,9 +81,14 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.retinotopy", "tree_root": True} + ) - name: str = Field("ImagingRetinotopy", json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}}) + name: str = Field( + "ImagingRetinotopy", + json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}}, + ) axis_1_phase_map: ImagingRetinotopyAxis1PhaseMap = Field( ..., description="""Phase response to stimulus on the first measured axis.""" ) @@ -100,7 +107,9 @@ class ImagingRetinotopy(NWBDataInterface): ..., description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]} + } }, ) focal_depth_image: Optional[ImagingRetinotopyFocalDepthImage] = Field( @@ -108,10 +117,12 @@ class ImagingRetinotopy(NWBDataInterface): description="""Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].""", ) sign_map: Optional[ImagingRetinotopySignMap] = Field( - None, description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""" + None, + description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""", ) vasculature_image: ImagingRetinotopyVasculatureImage = Field( - ..., description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""" + ..., + description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""", ) @@ -125,18 +136,27 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): name: Literal["axis_1_phase_map"] = Field( "axis_1_phase_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_1_phase_map", "ifabsent": "string(axis_1_phase_map)"} + "linkml_meta": { + "equals_string": "axis_1_phase_map", + "ifabsent": "string(axis_1_phase_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -150,18 +170,27 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): name: Literal["axis_1_power_map"] = Field( "axis_1_power_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_1_power_map", "ifabsent": "string(axis_1_power_map)"} + "linkml_meta": { + "equals_string": "axis_1_power_map", + "ifabsent": "string(axis_1_power_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -175,18 +204,27 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): name: Literal["axis_2_phase_map"] = Field( "axis_2_phase_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_2_phase_map", "ifabsent": "string(axis_2_phase_map)"} + "linkml_meta": { + "equals_string": "axis_2_phase_map", + "ifabsent": "string(axis_2_phase_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -200,18 +238,27 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): name: Literal["axis_2_power_map"] = Field( "axis_2_power_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_2_power_map", "ifabsent": "string(axis_2_power_map)"} + "linkml_meta": { + "equals_string": "axis_2_power_map", + "ifabsent": "string(axis_2_power_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -225,7 +272,10 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): name: Literal["focal_depth_image"] = Field( "focal_depth_image", json_schema_extra={ - "linkml_meta": {"equals_string": "focal_depth_image", "ifabsent": "string(focal_depth_image)"} + "linkml_meta": { + "equals_string": "focal_depth_image", + "ifabsent": "string(focal_depth_image)", + } }, ) bits_per_pixel: Optional[np.int32] = Field( @@ -236,12 +286,20 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - focal_depth: Optional[np.float32] = Field(None, description="""Focal depth offset, in meters.""") - format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + focal_depth: Optional[np.float32] = Field( + None, description="""Focal depth offset, in meters.""" + ) + format: Optional[str] = Field( + None, description="""Format of image. Right now only 'raw' is supported.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -253,16 +311,23 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy"}) name: Literal["sign_map"] = Field( - "sign_map", json_schema_extra={"linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"}} + "sign_map", + json_schema_extra={ + "linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"} + }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -276,7 +341,10 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): name: Literal["vasculature_image"] = Field( "vasculature_image", json_schema_extra={ - "linkml_meta": {"equals_string": "vasculature_image", "ifabsent": "string(vasculature_image)"} + "linkml_meta": { + "equals_string": "vasculature_image", + "ifabsent": "string(vasculature_image)", + } }, ) bits_per_pixel: Optional[np.int32] = Field( @@ -287,11 +355,17 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + format: Optional[str] = Field( + None, description="""Format of image. Right now only 'raw' is supported.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/namespace.py index e2e04dc..f4b518c 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/namespace.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/namespace.py @@ -172,7 +172,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/__init__.py index 8d1c8b6..8b13789 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/__init__.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/__init__.py @@ -1 +1 @@ - + diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_base.py index 5d71a17..9b976e9 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_base.py @@ -9,7 +9,15 @@ from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container from numpydantic import NDArray, Shape from ...hdmf_common.v1_5_0.hdmf_common_table import VectorData, DynamicTable from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) metamodel_version = "None" version = "2.5.0" @@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -69,7 +79,11 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.base/", "id": "core.nwb.base", - "imports": ["../../hdmf_common/v1_5_0/namespace", "../../hdmf_common/v1_5_0/namespace", "core.nwb.language"], + "imports": [ + "../../hdmf_common/v1_5_0/namespace", + "../../hdmf_common/v1_5_0/namespace", + "core.nwb.language", + ], "name": "core.nwb.base", } ) @@ -80,7 +94,9 @@ class NWBData(Data): An abstract data type for a dataset. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -90,18 +106,25 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) - name: str = Field("timeseries", json_schema_extra={"linkml_meta": {"ifabsent": "string(timeseries)"}}) + name: str = Field( + "timeseries", json_schema_extra={"linkml_meta": {"ifabsent": "string(timeseries)"}} + ) idx_start: np.int32 = Field( ..., description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) count: np.int32 = Field( - ..., description="""Number of data samples available in this time series, during this epoch""" + ..., + description="""Number of data samples available in this time series, during this epoch""", ) timeseries: TimeSeries = Field(..., description="""The TimeSeries that this index applies to""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -117,7 +140,9 @@ 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)). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -138,7 +163,9 @@ class ImageReferences(NWBData): Ordered dataset of references to Image objects. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -148,7 +175,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -158,7 +187,9 @@ class NWBDataInterface(NWBContainer): An abstract data type for a generic container storing collections of data, as opposed to metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -168,7 +199,9 @@ class TimeSeries(NWBDataInterface): General purpose time series. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of the time series.""") @@ -197,7 +230,9 @@ class TimeSeries(NWBDataInterface): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -213,7 +248,8 @@ class TimeSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) conversion: Optional[np.float32] = Field( None, @@ -254,10 +290,14 @@ class TimeSeriesStartingTime(ConfiguredBaseModel): name: Literal["starting_time"] = Field( "starting_time", - json_schema_extra={"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"} + }, ) rate: Optional[np.float32] = Field(None, description="""Sampling rate, in Hz.""") - unit: Optional[str] = Field(None, description="""Unit of measurement for time, which is fixed to 'seconds'.""") + unit: Optional[str] = Field( + None, description="""Unit of measurement for time, which is fixed to 'seconds'.""" + ) value: np.float64 = Field(...) @@ -269,7 +309,8 @@ class TimeSeriesSync(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"}) name: Literal["sync"] = Field( - "sync", json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}} + "sync", + json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}}, ) @@ -278,10 +319,15 @@ class ProcessingModule(NWBContainer): A collection of processed data. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) children: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field( - None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}} + None, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]} + }, ) name: str = Field(...) @@ -291,15 +337,21 @@ class Images(NWBDataInterface): A collection of images with an optional way to specify the order of the images using the \"order_of_images\" dataset. An order must be specified if the images are referenced by index, e.g., from an IndexSeries. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field("Images", json_schema_extra={"linkml_meta": {"ifabsent": "string(Images)"}}) - description: Optional[str] = Field(None, description="""Description of this collection of images.""") + description: Optional[str] = Field( + None, description="""Description of this collection of images.""" + ) image: List[Image] = Field(..., description="""Images stored in this collection.""") order_of_images: Named[Optional[ImageReferences]] = Field( None, description="""Ordered dataset of references to Image objects stored in the parent group. Each Image object in the Images group should be stored once and only once, so the dataset should have the same length as the number of images.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_behavior.py index b2c0075..c912e61 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_behavior.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_behavior.py @@ -71,7 +71,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -127,11 +129,14 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) name: str = Field(...) data: SpatialSeriesData = Field( - ..., description="""1-D or 2-D array storing position or direction relative to some reference frame.""" + ..., + description="""1-D or 2-D array storing position or direction relative to some reference frame.""", ) reference_frame: Optional[str] = Field( None, description="""Description defining what exactly 'straight-ahead' means.""" @@ -158,7 +163,9 @@ class SpatialSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -174,7 +181,8 @@ class SpatialSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -195,7 +203,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[IntervalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "IntervalSeries"}]}} @@ -208,7 +218,9 @@ class BehavioralEvents(NWBDataInterface): TimeSeries for storing behavioral events. See description of BehavioralEpochs for more details. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -221,7 +233,9 @@ class BehavioralTimeSeries(NWBDataInterface): TimeSeries for storing Behavoioral time series data. See description of BehavioralEpochs for more details. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -234,7 +248,9 @@ class PupilTracking(NWBDataInterface): Eye-tracking data, representing pupil size. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -247,7 +263,9 @@ class EyeTracking(NWBDataInterface): Eye-tracking data, representing direction of gaze. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} @@ -260,7 +278,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} @@ -273,7 +293,9 @@ class Position(NWBDataInterface): Position data, whether along the x, x/y or x/y/z axis. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_device.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_device.py index 9621c00..53128f3 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_device.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_device.py @@ -22,7 +22,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -62,14 +64,18 @@ class Device(NWBContainer): Metadata about a data acquisition device, e.g., recording system, electrode, microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.device", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.device", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field( None, description="""Description of the device (e.g., model, firmware version, processing software version, etc.) as free-form text.""", ) - manufacturer: Optional[str] = Field(None, description="""The name of the manufacturer of the device.""") + manufacturer: Optional[str] = Field( + None, description="""The name of the manufacturer of the device.""" + ) # Model rebuild diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ecephys.py index a87c289..71f47b3 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ecephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ecephys.py @@ -7,7 +7,15 @@ import sys import numpy as np from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTableRegion from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from ...core.v2_5_0.core_nwb_base import ( TimeSeries, TimeSeriesStartingTime, @@ -30,7 +38,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -75,7 +85,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.ecephys/", "id": "core.nwb.ecephys", - "imports": ["core.nwb.base", "../../hdmf_common/v1_5_0/namespace", "core.nwb.device", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "../../hdmf_common/v1_5_0/namespace", + "core.nwb.device", + "core.nwb.language", + ], "name": "core.nwb.ecephys", } ) @@ -86,7 +101,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) filtering: Optional[str] = Field( @@ -101,7 +118,9 @@ class ElectricalSeries(TimeSeries): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( None, @@ -130,7 +149,9 @@ class ElectricalSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -143,7 +164,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) data: Union[ @@ -162,7 +185,9 @@ class SpikeEventSeries(ElectricalSeries): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( None, @@ -186,7 +211,9 @@ class SpikeEventSeries(ElectricalSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -199,9 +226,14 @@ class FeatureExtraction(NWBDataInterface): Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("FeatureExtraction", json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}}) + name: str = Field( + "FeatureExtraction", + json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}}, + ) description: NDArray[Shape["* num_features"], str] = Field( ..., description="""Description of features (eg, ''PC1'') for each of the extracted features.""", @@ -212,7 +244,13 @@ class FeatureExtraction(NWBDataInterface): description="""Multi-dimensional array of features extracted from each event.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_events"}, {"alias": "num_channels"}, {"alias": "num_features"}]} + "array": { + "dimensions": [ + {"alias": "num_events"}, + {"alias": "num_channels"}, + {"alias": "num_features"}, + ] + } } }, ) @@ -224,7 +262,9 @@ class FeatureExtraction(NWBDataInterface): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) @@ -233,9 +273,13 @@ class EventDetection(NWBDataInterface): Detected spike events from voltage trace(s). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}}) + name: str = Field( + "EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}} + ) detection_method: str = Field( ..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""", @@ -257,7 +301,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[SpikeEventSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpikeEventSeries"}]}} @@ -270,7 +316,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[ElectricalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}} @@ -283,7 +331,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[ElectricalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}} @@ -296,7 +346,9 @@ class ElectrodeGroup(NWBContainer): A physical grouping of electrodes, e.g. a shank of an array. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of this electrode group.""") @@ -317,7 +369,10 @@ class ElectrodeGroupPosition(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"}) name: Literal["position"] = Field( - "position", json_schema_extra={"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}} + "position", + json_schema_extra={ + "linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"} + }, ) x: Optional[np.float32] = Field(None, description="""x coordinate""") y: Optional[np.float32] = Field(None, description="""y coordinate""") @@ -329,22 +384,33 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("ClusterWaveforms", json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}}) - waveform_filtering: str = Field(..., description="""Filtering applied to data before generating mean/sd""") + name: str = Field( + "ClusterWaveforms", + json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}}, + ) + waveform_filtering: str = Field( + ..., description="""Filtering applied to data before generating mean/sd""" + ) waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( ..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]} + } }, ) waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( ..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]} + } }, ) @@ -354,9 +420,13 @@ class Clustering(NWBDataInterface): DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}}) + name: str = Field( + "Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}} + ) description: str = Field( ..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_epoch.py index bfe2d03..b4d396a 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_epoch.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_epoch.py @@ -7,7 +7,15 @@ import sys import numpy as np from ...core.v2_5_0.core_nwb_base import TimeSeriesReferenceVectorData from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, VectorIndex, VectorData @@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -80,50 +90,66 @@ class TimeIntervals(DynamicTable): A container for aggregating epoch data and the TimeSeries that each epoch applies to. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.epoch", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.epoch", "tree_root": True} + ) name: str = Field(...) start_time: NDArray[Any, np.float32] = Field( ..., description="""Start time of epoch, in seconds.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) stop_time: NDArray[Any, np.float32] = Field( ..., description="""Stop time of epoch, in seconds.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) tags: Optional[NDArray[Any, str]] = Field( None, description="""User-defined tags that identify or categorize events.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) tags_index: Named[Optional[VectorIndex]] = Field( None, description="""Index for tags.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) timeseries: Named[Optional[TimeSeriesReferenceVectorData]] = Field( None, description="""An index into a TimeSeries object.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) timeseries_index: Named[Optional[VectorIndex]] = Field( None, description="""Index for timeseries.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_file.py index acf4209..33d05c4 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_file.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_file.py @@ -132,7 +132,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -199,10 +201,14 @@ class ScratchData(NWBData): Any one-off datasets """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: str = Field(...) - notes: Optional[str] = Field(None, description="""Any notes the user has about the dataset being stored""") + notes: Optional[str] = Field( + None, description="""Any notes the user has about the dataset being stored""" + ) class NWBFile(NWBContainer): @@ -210,10 +216,13 @@ class NWBFile(NWBContainer): An NWB:N file storing cellular-based neurophysiology data from a single experimental session. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: Literal["root"] = Field( - "root", json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}} + "root", + json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}}, ) nwb_version: Optional[str] = Field( None, @@ -222,7 +231,9 @@ class NWBFile(NWBContainer): file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = Field( ..., description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}} + }, ) identifier: str = Field( ..., @@ -242,17 +253,23 @@ class NWBFile(NWBContainer): acquisition: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field( None, description="""Data streams recorded from the system, including ephys, ophys, tracking, etc. This group should be read-only after the experiment is completed and timestamps are corrected to a common timebase. The data stored here may be links to raw data stored in external NWB files. This will allow keeping bulky raw data out of the file while preserving the option of keeping some/all in the file. Acquired data includes tracking and experimental data streams (i.e., everything measured from the system). If bulky data is stored in the /acquisition group, the data can exist in a separate NWB file that is linked to by the file being used for processing and analysis.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]} + }, ) analysis: Optional[List[Union[DynamicTable, NWBContainer]]] = Field( None, description="""Lab-specific and custom scientific analysis of data. There is no defined format for the content of this group - the format is up to the individual user/lab. To facilitate sharing analysis data between labs, the contents here should be stored in standard types (e.g., neurodata_types) and appropriately documented. The file can store lab-specific and custom data analysis without restriction on its form or schema, reducing data formatting restrictions on end users. Such data should be placed in the analysis group. The analysis data should be documented so that it could be shared with other labs.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]} + }, ) scratch: Optional[List[Union[DynamicTable, NWBContainer]]] = Field( None, description="""A place to store one-off analysis results. Data placed here is not intended for sharing. By placing data here, users acknowledge that there is no guarantee that their data meets any standard.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]} + }, ) processing: Optional[List[ProcessingModule]] = Field( None, @@ -292,7 +309,10 @@ class NWBFileStimulus(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["stimulus"] = Field( - "stimulus", json_schema_extra={"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}} + "stimulus", + json_schema_extra={ + "linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"} + }, ) presentation: Optional[List[TimeSeries]] = Field( None, @@ -302,7 +322,9 @@ class NWBFileStimulus(ConfiguredBaseModel): templates: Optional[List[Union[Images, TimeSeries]]] = Field( None, description="""Template stimuli. Timestamps in templates are based on stimulus design and are relative to the beginning of the stimulus. When templates are used, the stimulus instances must convert presentation times to the experiment`s time reference frame.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}, {"range": "Images"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "TimeSeries"}, {"range": "Images"}]} + }, ) @@ -314,16 +336,27 @@ class NWBFileGeneral(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["general"] = Field( - "general", json_schema_extra={"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}} + "general", + json_schema_extra={ + "linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"} + }, + ) + data_collection: Optional[str] = Field( + None, description="""Notes about data collection and analysis.""" + ) + experiment_description: Optional[str] = Field( + None, description="""General description of the experiment.""" ) - data_collection: Optional[str] = Field(None, description="""Notes about data collection and analysis.""") - experiment_description: Optional[str] = Field(None, description="""General description of the experiment.""") experimenter: Optional[NDArray[Shape["* num_experimenters"], str]] = Field( None, description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}} + }, + ) + institution: Optional[str] = Field( + None, description="""Institution(s) where experiment was performed.""" ) - institution: Optional[str] = Field(None, description="""Institution(s) where experiment was performed.""") keywords: Optional[NDArray[Shape["* num_keywords"], str]] = Field( None, description="""Terms to search over.""", @@ -336,12 +369,15 @@ class NWBFileGeneral(ConfiguredBaseModel): description="""Description of drugs used, including how and when they were administered. Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc.""", ) protocol: Optional[str] = Field( - None, description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""" + None, + description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""", ) related_publications: Optional[NDArray[Shape["* num_publications"], str]] = Field( None, description="""Publication information. PMID, DOI, URL, etc.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}} + }, ) session_id: Optional[str] = Field(None, description="""Lab-specific ID for the session.""") slices: Optional[str] = Field( @@ -349,7 +385,8 @@ class NWBFileGeneral(ConfiguredBaseModel): description="""Description of slices, including information about preparation thickness, orientation, temperature, and bath solution.""", ) source_script: Optional[NWBFileGeneralSourceScript] = Field( - None, description="""Script file or link to public source code used to create this NWB file.""" + None, + description="""Script file or link to public source code used to create this NWB file.""", ) stimulus: Optional[str] = Field( None, description="""Notes about stimuli, such as how and where they were presented.""" @@ -372,7 +409,8 @@ class NWBFileGeneral(ConfiguredBaseModel): json_schema_extra={"linkml_meta": {"any_of": [{"range": "Device"}]}}, ) subject: Optional[Subject] = Field( - None, description="""Information about the animal or person from which the data was measured.""" + None, + description="""Information about the animal or person from which the data was measured.""", ) extracellular_ephys: Optional[NWBFileGeneralExtracellularEphys] = Field( None, description="""Metadata related to extracellular electrophysiology.""" @@ -401,7 +439,9 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel): name: Literal["source_script"] = Field( "source_script", - json_schema_extra={"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"} + }, ) file_name: Optional[str] = Field(None, description="""Name of script file.""") value: str = Field(...) @@ -417,10 +457,15 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel): name: Literal["extracellular_ephys"] = Field( "extracellular_ephys", json_schema_extra={ - "linkml_meta": {"equals_string": "extracellular_ephys", "ifabsent": "string(extracellular_ephys)"} + "linkml_meta": { + "equals_string": "extracellular_ephys", + "ifabsent": "string(extracellular_ephys)", + } }, ) - electrode_group: Optional[List[ElectrodeGroup]] = Field(None, description="""Physical group of electrodes.""") + electrode_group: Optional[List[ElectrodeGroup]] = Field( + None, description="""Physical group of electrodes.""" + ) electrodes: Optional[NWBFileGeneralExtracellularEphysElectrodes] = Field( None, description="""A table of all electrodes (i.e. channels) used for recording.""" ) @@ -435,48 +480,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): name: Literal["electrodes"] = Field( "electrodes", - json_schema_extra={"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"} + }, ) x: Optional[NDArray[Any, np.float32]] = Field( None, description="""x coordinate of the channel location in the brain (+x is posterior).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) y: Optional[NDArray[Any, np.float32]] = Field( None, description="""y coordinate of the channel location in the brain (+y is inferior).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) z: Optional[NDArray[Any, np.float32]] = Field( None, description="""z coordinate of the channel location in the brain (+z is right).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) imp: Optional[NDArray[Any, np.float32]] = Field( None, description="""Impedance of the channel, in ohms.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) location: NDArray[Any, str] = Field( ..., description="""Location of the electrode (channel). 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.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) filtering: Optional[NDArray[Any, str]] = Field( None, description="""Description of hardware filtering, including the filter name and frequency cutoffs.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) group: List[ElectrodeGroup] = Field( @@ -486,42 +545,54 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): ..., description="""Name of the ElectrodeGroup this electrode is a part of.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_x: Optional[NDArray[Any, np.float32]] = Field( None, description="""x coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_y: Optional[NDArray[Any, np.float32]] = Field( None, description="""y coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_z: Optional[NDArray[Any, np.float32]] = Field( None, description="""z coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) reference: Optional[NDArray[Any, str]] = Field( None, description="""Description of the reference electrode and/or reference scheme used for this electrode, e.g., \"stainless steel skull screw\" or \"online common average referencing\".""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -542,7 +613,10 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel): name: Literal["intracellular_ephys"] = Field( "intracellular_ephys", json_schema_extra={ - "linkml_meta": {"equals_string": "intracellular_ephys", "ifabsent": "string(intracellular_ephys)"} + "linkml_meta": { + "equals_string": "intracellular_ephys", + "ifabsent": "string(intracellular_ephys)", + } }, ) filtering: Optional[str] = Field( @@ -583,7 +657,9 @@ class LabMetaData(NWBContainer): Lab-specific meta-data. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: str = Field(...) @@ -593,25 +669,34 @@ class Subject(NWBContainer): Information about the animal or person from which the data was measured. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: str = Field(...) - age: Optional[str] = Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""") + age: Optional[str] = Field( + None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""" + ) date_of_birth: Optional[np.datetime64] = Field( None, description="""Date of birth of subject. Can be supplied instead of 'age'.""" ) description: Optional[str] = Field( - None, description="""Description of subject and where subject came from (e.g., breeder, if animal).""" + None, + description="""Description of subject and where subject came from (e.g., breeder, if animal).""", + ) + genotype: Optional[str] = Field( + None, description="""Genetic strain. If absent, assume Wild Type (WT).""" ) - genotype: Optional[str] = Field(None, description="""Genetic strain. If absent, assume Wild Type (WT).""") sex: Optional[str] = Field(None, description="""Gender of subject.""") species: Optional[str] = Field(None, description="""Species of subject.""") strain: Optional[str] = Field(None, description="""Strain of subject.""") subject_id: Optional[str] = Field( - None, description="""ID of animal/person used/participating in experiment (lab convention).""" + None, + description="""ID of animal/person used/participating in experiment (lab convention).""", ) weight: Optional[str] = Field( - None, description="""Weight at time of experiment, at time of surgery and at other important times.""" + None, + description="""Weight at time of experiment, at time of surgery and at other important times.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_icephys.py index 6fe9dad..773fe2f 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_icephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_icephys.py @@ -31,7 +31,15 @@ from ...core.v2_5_0.core_nwb_base import ( Images, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape metamodel_version = "None" @@ -47,7 +55,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -92,7 +102,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.icephys/", "id": "core.nwb.icephys", - "imports": ["core.nwb.base", "core.nwb.device", "../../hdmf_common/v1_5_0/namespace", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "core.nwb.device", + "../../hdmf_common/v1_5_0/namespace", + "core.nwb.language", + ], "name": "core.nwb.icephys", } ) @@ -103,7 +118,9 @@ class PatchClampSeries(TimeSeries): An abstract base class for patch-clamp data - stimulus or response, current or voltage. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) stimulus_description: Optional[str] = Field( @@ -114,7 +131,8 @@ class PatchClampSeries(TimeSeries): ) data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""") gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -138,7 +156,9 @@ class PatchClampSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -154,7 +174,8 @@ class PatchClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -170,13 +191,17 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""") bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""") - capacitance_compensation: Optional[np.float32] = Field(None, description="""Capacitance compensation, in farads.""") + capacitance_compensation: Optional[np.float32] = Field( + None, description="""Capacitance compensation, in farads.""" + ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) @@ -184,7 +209,8 @@ class CurrentClampSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -208,7 +234,9 @@ class CurrentClampSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -224,7 +252,8 @@ class CurrentClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -238,14 +267,19 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) stimulus_description: Optional[str] = Field( - None, description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""" + None, + description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""", ) bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""") - bridge_balance: np.float32 = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + bridge_balance: np.float32 = Field( + ..., description="""Bridge balance, in ohms, fixed to 0.0.""" + ) capacitance_compensation: np.float32 = Field( ..., description="""Capacitance compensation, in farads, fixed to 0.0.""" ) @@ -254,7 +288,8 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -278,7 +313,9 @@ class IZeroClampSeries(CurrentClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -291,7 +328,9 @@ class CurrentClampStimulusSeries(PatchClampSeries): Stimulus current applied during current clamp recording. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: CurrentClampStimulusSeriesData = Field(..., description="""Stimulus current applied.""") @@ -302,7 +341,8 @@ class CurrentClampStimulusSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -326,7 +366,9 @@ class CurrentClampStimulusSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -342,7 +384,8 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -356,7 +399,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: VoltageClampSeriesData = Field(..., description="""Recorded current.""") @@ -378,8 +423,8 @@ class VoltageClampSeries(PatchClampSeries): whole_cell_capacitance_comp: Optional[VoltageClampSeriesWholeCellCapacitanceComp] = Field( None, description="""Whole cell capacitance compensation, in farads.""" ) - whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = Field( - None, description="""Whole cell series resistance compensation, in ohms.""" + whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = ( + Field(None, description="""Whole cell series resistance compensation, in ohms.""") ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" @@ -388,7 +433,8 @@ class VoltageClampSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -412,7 +458,9 @@ class VoltageClampSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -428,7 +476,8 @@ class VoltageClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -447,11 +496,15 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): name: Literal["capacitance_fast"] = Field( "capacitance_fast", json_schema_extra={ - "linkml_meta": {"equals_string": "capacitance_fast", "ifabsent": "string(capacitance_fast)"} + "linkml_meta": { + "equals_string": "capacitance_fast", + "ifabsent": "string(capacitance_fast)", + } }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -466,11 +519,15 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): name: Literal["capacitance_slow"] = Field( "capacitance_slow", json_schema_extra={ - "linkml_meta": {"equals_string": "capacitance_slow", "ifabsent": "string(capacitance_slow)"} + "linkml_meta": { + "equals_string": "capacitance_slow", + "ifabsent": "string(capacitance_slow)", + } }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -492,7 +549,8 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""" + None, + description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""", ) value: np.float32 = Field(...) @@ -514,7 +572,8 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""" + None, + description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""", ) value: np.float32 = Field(...) @@ -536,7 +595,8 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""" + None, + description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""", ) value: np.float32 = Field(...) @@ -558,7 +618,8 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -580,7 +641,8 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""" + None, + description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""", ) value: np.float32 = Field(...) @@ -590,7 +652,9 @@ class VoltageClampStimulusSeries(PatchClampSeries): Stimulus voltage applied during a voltage clamp recording. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: VoltageClampStimulusSeriesData = Field(..., description="""Stimulus voltage applied.""") @@ -601,7 +665,8 @@ class VoltageClampStimulusSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -625,7 +690,9 @@ class VoltageClampStimulusSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -641,7 +708,8 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -655,20 +723,28 @@ class IntracellularElectrode(NWBContainer): An intracellular electrode and its metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) cell_id: Optional[str] = Field(None, description="""unique ID of the cell""") - description: str = Field(..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""") + description: str = Field( + ..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""" + ) filtering: Optional[str] = Field(None, description="""Electrode specific filtering.""") - initial_access_resistance: Optional[str] = Field(None, description="""Initial access resistance.""") + initial_access_resistance: Optional[str] = Field( + None, description="""Initial access resistance.""" + ) location: Optional[str] = Field( None, description="""Location of the electrode. 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.""", ) resistance: Optional[str] = Field(None, description="""Electrode resistance, in ohms.""") seal: Optional[str] = Field(None, description="""Information about seal used for recording.""") - slice: Optional[str] = Field(None, description="""Information about slice used for recording.""") + slice: Optional[str] = Field( + None, description="""Information about slice used for recording.""" + ) class SweepTable(DynamicTable): @@ -676,14 +752,18 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) sweep_number: NDArray[Any, np.uint32] = Field( ..., description="""Sweep number of the PatchClampSeries in that row.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) series: List[PatchClampSeries] = Field( @@ -692,13 +772,17 @@ class SweepTable(DynamicTable): series_index: Named[VectorIndex] = Field( ..., description="""Index for series.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -714,10 +798,14 @@ class IntracellularElectrodesTable(DynamicTable): Table for storing intracellular electrode related metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) electrode: List[IntracellularElectrode] = Field( ..., description="""Column for storing the reference to the intracellular electrode.""" ) @@ -740,14 +828,20 @@ class IntracellularStimuliTable(DynamicTable): Table for storing intracellular stimulus related metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) stimulus: Named[TimeSeriesReferenceVectorData] = Field( ..., description="""Column storing the reference to the recorded stimulus for the recording (rows).""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, @@ -768,14 +862,20 @@ class IntracellularResponsesTable(DynamicTable): Table for storing intracellular response related metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) response: Named[TimeSeriesReferenceVectorData] = Field( ..., description="""Column storing the reference to the recorded response for the recording (rows)""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, @@ -796,12 +896,17 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: Literal["intracellular_recordings"] = Field( "intracellular_recordings", json_schema_extra={ - "linkml_meta": {"equals_string": "intracellular_recordings", "ifabsent": "string(intracellular_recordings)"} + "linkml_meta": { + "equals_string": "intracellular_recordings", + "ifabsent": "string(intracellular_recordings)", + } }, ) description: Optional[str] = Field( @@ -839,27 +944,37 @@ class SimultaneousRecordingsTable(DynamicTable): A table for grouping different intracellular recordings from the IntracellularRecordingsTable table together that were recorded simultaneously from different electrodes. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: Literal["simultaneous_recordings"] = Field( "simultaneous_recordings", json_schema_extra={ - "linkml_meta": {"equals_string": "simultaneous_recordings", "ifabsent": "string(simultaneous_recordings)"} + "linkml_meta": { + "equals_string": "simultaneous_recordings", + "ifabsent": "string(simultaneous_recordings)", + } }, ) recordings: SimultaneousRecordingsTableRecordings = Field( - ..., description="""A reference to one or more rows in the IntracellularRecordingsTable table.""" + ..., + description="""A reference to one or more rows in the IntracellularRecordingsTable table.""", ) recordings_index: Named[VectorIndex] = Field( ..., description="""Index dataset for the recordings column.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -879,13 +994,17 @@ class SimultaneousRecordingsTableRecordings(DynamicTableRegion): name: Literal["recordings"] = Field( "recordings", - json_schema_extra={"linkml_meta": {"equals_string": "recordings", "ifabsent": "string(recordings)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "recordings", "ifabsent": "string(recordings)"} + }, ) table: Optional[IntracellularRecordingsTable] = Field( None, description="""Reference to the IntracellularRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""", ) - description: Optional[str] = Field(None, description="""Description of what this table region points to.""") + description: Optional[str] = Field( + None, description="""Description of what this table region points to.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -901,34 +1020,46 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: Literal["sequential_recordings"] = Field( "sequential_recordings", json_schema_extra={ - "linkml_meta": {"equals_string": "sequential_recordings", "ifabsent": "string(sequential_recordings)"} + "linkml_meta": { + "equals_string": "sequential_recordings", + "ifabsent": "string(sequential_recordings)", + } }, ) simultaneous_recordings: SequentialRecordingsTableSimultaneousRecordings = Field( - ..., description="""A reference to one or more rows in the SimultaneousRecordingsTable table.""" + ..., + description="""A reference to one or more rows in the SimultaneousRecordingsTable table.""", ) simultaneous_recordings_index: Named[VectorIndex] = Field( ..., description="""Index dataset for the simultaneous_recordings column.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) stimulus_type: NDArray[Any, str] = Field( ..., description="""The type of stimulus used for the sequential recording.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -949,14 +1080,19 @@ class SequentialRecordingsTableSimultaneousRecordings(DynamicTableRegion): name: Literal["simultaneous_recordings"] = Field( "simultaneous_recordings", json_schema_extra={ - "linkml_meta": {"equals_string": "simultaneous_recordings", "ifabsent": "string(simultaneous_recordings)"} + "linkml_meta": { + "equals_string": "simultaneous_recordings", + "ifabsent": "string(simultaneous_recordings)", + } }, ) table: Optional[SimultaneousRecordingsTable] = Field( None, description="""Reference to the SimultaneousRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""", ) - description: Optional[str] = Field(None, description="""Description of what this table region points to.""") + description: Optional[str] = Field( + None, description="""Description of what this table region points to.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -972,25 +1108,34 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: Literal["repetitions"] = Field( "repetitions", - json_schema_extra={"linkml_meta": {"equals_string": "repetitions", "ifabsent": "string(repetitions)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "repetitions", "ifabsent": "string(repetitions)"} + }, ) sequential_recordings: RepetitionsTableSequentialRecordings = Field( - ..., description="""A reference to one or more rows in the SequentialRecordingsTable table.""" + ..., + description="""A reference to one or more rows in the SequentialRecordingsTable table.""", ) sequential_recordings_index: Named[VectorIndex] = Field( ..., description="""Index dataset for the sequential_recordings column.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -1011,14 +1156,19 @@ class RepetitionsTableSequentialRecordings(DynamicTableRegion): name: Literal["sequential_recordings"] = Field( "sequential_recordings", json_schema_extra={ - "linkml_meta": {"equals_string": "sequential_recordings", "ifabsent": "string(sequential_recordings)"} + "linkml_meta": { + "equals_string": "sequential_recordings", + "ifabsent": "string(sequential_recordings)", + } }, ) table: Optional[SequentialRecordingsTable] = Field( None, description="""Reference to the SequentialRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""", ) - description: Optional[str] = Field(None, description="""Description of what this table region points to.""") + description: Optional[str] = Field( + None, description="""Description of what this table region points to.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -1034,12 +1184,17 @@ class ExperimentalConditionsTable(DynamicTable): A table for grouping different intracellular recording repetitions together that belong to the same experimental condition. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: Literal["experimental_conditions"] = Field( "experimental_conditions", json_schema_extra={ - "linkml_meta": {"equals_string": "experimental_conditions", "ifabsent": "string(experimental_conditions)"} + "linkml_meta": { + "equals_string": "experimental_conditions", + "ifabsent": "string(experimental_conditions)", + } }, ) repetitions: ExperimentalConditionsTableRepetitions = Field( @@ -1048,13 +1203,17 @@ class ExperimentalConditionsTable(DynamicTable): repetitions_index: Named[VectorIndex] = Field( ..., description="""Index dataset for the repetitions column.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -1074,13 +1233,17 @@ class ExperimentalConditionsTableRepetitions(DynamicTableRegion): name: Literal["repetitions"] = Field( "repetitions", - json_schema_extra={"linkml_meta": {"equals_string": "repetitions", "ifabsent": "string(repetitions)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "repetitions", "ifabsent": "string(repetitions)"} + }, ) table: Optional[RepetitionsTable] = Field( None, description="""Reference to the RepetitionsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""", ) - description: Optional[str] = Field(None, description="""Description of what this table region points to.""") + description: Optional[str] = Field( + None, description="""Description of what this table region points to.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_image.py index 360c09e..171ed7c 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_image.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_image.py @@ -47,7 +47,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -103,7 +105,9 @@ class GrayscaleImage(Image): A grayscale image. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -124,7 +128,9 @@ class RGBImage(Image): A color image. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -145,7 +151,9 @@ class RGBAImage(Image): A color image with transparency. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -166,14 +174,17 @@ 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]. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) - data: Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] = ( - Field( - ..., - description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", - ) + data: Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] = Field( + ..., + description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -210,7 +221,9 @@ class ImageSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -227,7 +240,9 @@ class ImageSeriesExternalFile(ConfiguredBaseModel): name: Literal["external_file"] = Field( "external_file", - json_schema_extra={"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"} + }, ) starting_frame: Optional[np.int32] = Field( None, @@ -243,14 +258,17 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) - data: Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] = ( - Field( - ..., - description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", - ) + data: Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] = Field( + ..., + description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -287,7 +305,9 @@ class ImageMaskSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -300,15 +320,23 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) - distance: Optional[np.float32] = Field(None, description="""Distance from camera/monitor to target/eye.""") + distance: Optional[np.float32] = Field( + None, description="""Distance from camera/monitor to target/eye.""" + ) field_of_view: Optional[ - Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]] + Union[ + NDArray[Shape["2 width_height"], np.float32], + NDArray[Shape["3 width_height_depth"], np.float32], + ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number] + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number], ] = Field(..., description="""Images presented to subject, either grayscale or RGB""") orientation: Optional[str] = Field( None, @@ -349,7 +377,9 @@ class OpticalSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -362,7 +392,9 @@ class IndexSeries(TimeSeries): Stores indices to image frames stored in an ImageSeries. The purpose of the IndexSeries is to allow a static image stack to be stored in an Images object, 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 Images object, and the timestamps array indicates when that image was displayed. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.uint32] = Field( @@ -392,7 +424,9 @@ class IndexSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_misc.py index abbdbae..510c7cf 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_misc.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_misc.py @@ -8,9 +8,22 @@ import numpy as np from ...core.v2_5_0.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync from ...core.v2_5_0.core_nwb_ecephys import ElectrodeGroup from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape -from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTableRegion, DynamicTable, VectorData, VectorIndex +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, + DynamicTable, + VectorData, + VectorIndex, +) metamodel_version = "None" version = "2.5.0" @@ -25,7 +38,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -70,7 +85,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.misc/", "id": "core.nwb.misc", - "imports": ["core.nwb.base", "../../hdmf_common/v1_5_0/namespace", "core.nwb.ecephys", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "../../hdmf_common/v1_5_0/namespace", + "core.nwb.ecephys", + "core.nwb.language", + ], "name": "core.nwb.misc", } ) @@ -81,10 +101,14 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) - data: AbstractFeatureSeriesData = Field(..., description="""Values of each feature at each time.""") + data: AbstractFeatureSeriesData = Field( + ..., description="""Values of each feature at each time.""" + ) feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field( None, description="""Units of each feature.""", @@ -117,7 +141,9 @@ class AbstractFeatureSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -133,14 +159,18 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, description="""Since there can be different units for different features, store the units in 'feature_units'. The default value for this attribute is \"see 'feature_units'\".""", ) array: Optional[ - Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]] + Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_features"], np.number], + ] ] = Field(None) @@ -149,7 +179,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], str] = Field( @@ -179,7 +211,9 @@ class AnnotationSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -192,7 +226,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.int8] = Field( @@ -222,7 +258,9 @@ class IntervalSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -235,15 +273,21 @@ class DecompositionSeries(TimeSeries): Spectral analysis of a time series, e.g. of an LFP or a speech signal. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) - data: DecompositionSeriesData = Field(..., description="""Data decomposed into frequency bands.""") + data: DecompositionSeriesData = Field( + ..., description="""Data decomposed into frequency bands.""" + ) metric: str = Field(..., description="""The metric used, e.g. phase, amplitude, power.""") source_channels: Named[Optional[DynamicTableRegion]] = Field( None, description="""DynamicTableRegion pointer to the channels that this decomposition series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) bands: DecompositionSeriesBands = Field( ..., @@ -271,7 +315,9 @@ class DecompositionSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -287,7 +333,8 @@ class DecompositionSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -297,7 +344,13 @@ class DecompositionSeriesData(ConfiguredBaseModel): None, json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_times"}, {"alias": "num_channels"}, {"alias": "num_bands"}]} + "array": { + "dimensions": [ + {"alias": "num_times"}, + {"alias": "num_channels"}, + {"alias": "num_bands"}, + ] + } } }, ) @@ -311,13 +364,16 @@ class DecompositionSeriesBands(DynamicTable): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["bands"] = Field( - "bands", json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}} + "bands", + json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}}, ) band_name: NDArray[Any, str] = Field( ..., description="""Name of the band, e.g. theta.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field( @@ -325,7 +381,12 @@ class DecompositionSeriesBands(DynamicTable): description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_bands"}, {"alias": "low_high", "exact_cardinality": 2}]} + "array": { + "dimensions": [ + {"alias": "num_bands"}, + {"alias": "low_high", "exact_cardinality": 2}, + ] + } } }, ) @@ -343,7 +404,9 @@ class DecompositionSeriesBands(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -359,38 +422,55 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field("Units", json_schema_extra={"linkml_meta": {"ifabsent": "string(Units)"}}) spike_times_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the spike_times dataset.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, + ) + spike_times: Optional[UnitsSpikeTimes] = Field( + None, description="""Spike times for each unit.""" ) - spike_times: Optional[UnitsSpikeTimes] = Field(None, description="""Spike times for each unit.""") obs_intervals_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the obs_intervals dataset.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field( None, description="""Observation intervals for each unit.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_intervals"}, {"alias": "start_end", "exact_cardinality": 2}]} + "array": { + "dimensions": [ + {"alias": "num_intervals"}, + {"alias": "start_end", "exact_cardinality": 2}, + ] + } } }, ) electrodes_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into electrodes.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) electrodes: Named[Optional[DynamicTableRegion]] = Field( None, description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) electrode_group: Optional[List[ElectrodeGroup]] = Field( None, description="""Electrode group that each spike unit came from.""" @@ -411,24 +491,32 @@ class Units(DynamicTable): None, description="""Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same.""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_waveforms"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_waveforms"}, {"alias": "num_samples"}]} + } }, ) waveforms_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the waveforms dataset. One value for every spike event. See 'waveforms' for more detail.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) waveforms_index_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the waveforms_index dataset. One value for every unit (row in the table). See 'waveforms' for more detail.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -448,13 +536,17 @@ class UnitsSpikeTimes(VectorData): name: Literal["spike_times"] = Field( "spike_times", - json_schema_extra={"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"} + }, ) resolution: Optional[np.float64] = Field( None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""", ) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ogen.py index a8aa3c3..7978fd3 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ogen.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ogen.py @@ -8,7 +8,12 @@ from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator import numpy as np from numpydantic import NDArray, Shape -from ...core.v2_5_0.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync, NWBContainer +from ...core.v2_5_0.core_nwb_base import ( + TimeSeries, + TimeSeriesStartingTime, + TimeSeriesSync, + NWBContainer, +) metamodel_version = "None" version = "2.5.0" @@ -23,7 +28,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,7 +86,9 @@ class OptogeneticSeries(TimeSeries): An optogenetic stimulus. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ogen", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.number] = Field( @@ -109,7 +118,9 @@ class OptogeneticSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -122,7 +133,9 @@ class OptogeneticStimulusSite(NWBContainer): A site of optogenetic stimulation. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ogen", "tree_root": True} + ) name: str = Field(...) description: str = Field(..., description="""Description of stimulation site.""") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ophys.py index e736f5e..b82801e 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ophys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ophys.py @@ -41,7 +41,15 @@ from ...core.v2_5_0.core_nwb_image import ( IndexSeries, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape metamodel_version = "None" @@ -57,7 +65,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -119,7 +129,9 @@ class TwoPhotonSeries(ImageSeries): Image stack recorded over time from 2-photon microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") @@ -128,13 +140,17 @@ class TwoPhotonSeries(ImageSeries): description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) field_of_view: Optional[ - Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]] + Union[ + NDArray[Shape["2 width_height"], np.float32], + NDArray[Shape["3 width_height_depth"], np.float32], + ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") - data: Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] = ( - Field( - ..., - description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", - ) + data: Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] = Field( + ..., + description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -171,7 +187,9 @@ class TwoPhotonSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -184,16 +202,21 @@ class RoiResponseSeries(TimeSeries): ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) - data: Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_rois"], np.number]] = Field( - ..., description="""Signals from ROIs.""" - ) + data: Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_rois"], np.number], + ] = Field(..., description="""Signals from ROIs.""") rois: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -217,7 +240,9 @@ class RoiResponseSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -230,7 +255,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[RoiResponseSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}} @@ -243,7 +270,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[RoiResponseSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}} @@ -256,7 +285,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[PlaneSegmentation]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "PlaneSegmentation"}]}} @@ -269,7 +300,9 @@ class PlaneSegmentation(DynamicTable): Results from image segmentation of a specific imaging plane. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) image_mask: Optional[PlaneSegmentationImageMask] = Field( @@ -279,7 +312,9 @@ class PlaneSegmentation(DynamicTable): pixel_mask_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into pixel_mask.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) pixel_mask: Optional[PlaneSegmentationPixelMask] = Field( None, @@ -288,7 +323,9 @@ class PlaneSegmentation(DynamicTable): voxel_mask_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into voxel_mask.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) voxel_mask: Optional[PlaneSegmentationVoxelMask] = Field( None, @@ -303,7 +340,9 @@ class PlaneSegmentation(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -323,9 +362,13 @@ class PlaneSegmentationImageMask(VectorData): name: Literal["image_mask"] = Field( "image_mask", - json_schema_extra={"linkml_meta": {"equals_string": "image_mask", "ifabsent": "string(image_mask)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "image_mask", "ifabsent": "string(image_mask)"} + }, + ) + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" ) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -345,12 +388,16 @@ class PlaneSegmentationPixelMask(VectorData): name: Literal["pixel_mask"] = Field( "pixel_mask", - json_schema_extra={"linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"} + }, ) x: Optional[np.uint32] = Field(None, description="""Pixel x-coordinate.""") y: Optional[np.uint32] = Field(None, description="""Pixel y-coordinate.""") weight: Optional[np.float32] = Field(None, description="""Weight of the pixel.""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -370,13 +417,17 @@ class PlaneSegmentationVoxelMask(VectorData): name: Literal["voxel_mask"] = Field( "voxel_mask", - json_schema_extra={"linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"} + }, ) x: Optional[np.uint32] = Field(None, description="""Voxel x-coordinate.""") y: Optional[np.uint32] = Field(None, description="""Voxel y-coordinate.""") z: Optional[np.uint32] = Field(None, description="""Voxel z-coordinate.""") weight: Optional[np.float32] = Field(None, description="""Weight of the voxel.""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -392,7 +443,9 @@ class ImagingPlane(NWBContainer): An imaging plane and its metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[OpticalChannel]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "OpticalChannel"}]}} @@ -405,11 +458,15 @@ class OpticalChannel(NWBContainer): An optical channel used to record from an imaging plane. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) description: str = Field(..., description="""Description or other notes about the channel.""") - emission_lambda: np.float32 = Field(..., description="""Emission wavelength for channel, in nm.""") + emission_lambda: np.float32 = Field( + ..., description="""Emission wavelength for channel, in nm.""" + ) class MotionCorrection(NWBDataInterface): @@ -417,7 +474,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[CorrectedImageStack]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "CorrectedImageStack"}]}} @@ -430,10 +489,14 @@ class CorrectedImageStack(NWBDataInterface): Reuslts from motion correction of an image stack. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) - corrected: ImageSeries = Field(..., description="""Image stack with frames shifted to the common coordinates.""") + corrected: ImageSeries = Field( + ..., description="""Image stack with frames shifted to the common coordinates.""" + ) xy_translation: TimeSeries = Field( ..., 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.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_retinotopy.py index 73769de..629130a 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_retinotopy.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_retinotopy.py @@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,9 +81,14 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.retinotopy", "tree_root": True} + ) - name: str = Field("ImagingRetinotopy", json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}}) + name: str = Field( + "ImagingRetinotopy", + json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}}, + ) axis_1_phase_map: ImagingRetinotopyAxis1PhaseMap = Field( ..., description="""Phase response to stimulus on the first measured axis.""" ) @@ -100,7 +107,9 @@ class ImagingRetinotopy(NWBDataInterface): ..., description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]} + } }, ) focal_depth_image: Optional[ImagingRetinotopyFocalDepthImage] = Field( @@ -108,10 +117,12 @@ class ImagingRetinotopy(NWBDataInterface): description="""Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].""", ) sign_map: Optional[ImagingRetinotopySignMap] = Field( - None, description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""" + None, + description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""", ) vasculature_image: ImagingRetinotopyVasculatureImage = Field( - ..., description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""" + ..., + description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""", ) @@ -125,18 +136,27 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): name: Literal["axis_1_phase_map"] = Field( "axis_1_phase_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_1_phase_map", "ifabsent": "string(axis_1_phase_map)"} + "linkml_meta": { + "equals_string": "axis_1_phase_map", + "ifabsent": "string(axis_1_phase_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -150,18 +170,27 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): name: Literal["axis_1_power_map"] = Field( "axis_1_power_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_1_power_map", "ifabsent": "string(axis_1_power_map)"} + "linkml_meta": { + "equals_string": "axis_1_power_map", + "ifabsent": "string(axis_1_power_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -175,18 +204,27 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): name: Literal["axis_2_phase_map"] = Field( "axis_2_phase_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_2_phase_map", "ifabsent": "string(axis_2_phase_map)"} + "linkml_meta": { + "equals_string": "axis_2_phase_map", + "ifabsent": "string(axis_2_phase_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -200,18 +238,27 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): name: Literal["axis_2_power_map"] = Field( "axis_2_power_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_2_power_map", "ifabsent": "string(axis_2_power_map)"} + "linkml_meta": { + "equals_string": "axis_2_power_map", + "ifabsent": "string(axis_2_power_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -225,7 +272,10 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): name: Literal["focal_depth_image"] = Field( "focal_depth_image", json_schema_extra={ - "linkml_meta": {"equals_string": "focal_depth_image", "ifabsent": "string(focal_depth_image)"} + "linkml_meta": { + "equals_string": "focal_depth_image", + "ifabsent": "string(focal_depth_image)", + } }, ) bits_per_pixel: Optional[np.int32] = Field( @@ -236,12 +286,20 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - focal_depth: Optional[np.float32] = Field(None, description="""Focal depth offset, in meters.""") - format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + focal_depth: Optional[np.float32] = Field( + None, description="""Focal depth offset, in meters.""" + ) + format: Optional[str] = Field( + None, description="""Format of image. Right now only 'raw' is supported.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -253,16 +311,23 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy"}) name: Literal["sign_map"] = Field( - "sign_map", json_schema_extra={"linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"}} + "sign_map", + json_schema_extra={ + "linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"} + }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -276,7 +341,10 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): name: Literal["vasculature_image"] = Field( "vasculature_image", json_schema_extra={ - "linkml_meta": {"equals_string": "vasculature_image", "ifabsent": "string(vasculature_image)"} + "linkml_meta": { + "equals_string": "vasculature_image", + "ifabsent": "string(vasculature_image)", + } }, ) bits_per_pixel: Optional[np.int32] = Field( @@ -287,11 +355,17 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + format: Optional[str] = Field( + None, description="""Format of image. Right now only 'raw' is supported.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/namespace.py index 2054bd5..4851576 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/namespace.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/namespace.py @@ -173,7 +173,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/__init__.py index 8d1c8b6..8b13789 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/__init__.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/__init__.py @@ -1 +1 @@ - + diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_base.py index 081e4b6..f2e9356 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_base.py @@ -9,7 +9,15 @@ from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container from numpydantic import NDArray, Shape from ...hdmf_common.v1_5_0.hdmf_common_table import VectorData, DynamicTable from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) metamodel_version = "None" version = "2.6.0-alpha" @@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -69,7 +79,11 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.base/", "id": "core.nwb.base", - "imports": ["../../hdmf_common/v1_5_0/namespace", "../../hdmf_common/v1_5_0/namespace", "core.nwb.language"], + "imports": [ + "../../hdmf_common/v1_5_0/namespace", + "../../hdmf_common/v1_5_0/namespace", + "core.nwb.language", + ], "name": "core.nwb.base", } ) @@ -80,7 +94,9 @@ class NWBData(Data): An abstract data type for a dataset. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -90,18 +106,25 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) - name: str = Field("timeseries", json_schema_extra={"linkml_meta": {"ifabsent": "string(timeseries)"}}) + name: str = Field( + "timeseries", json_schema_extra={"linkml_meta": {"ifabsent": "string(timeseries)"}} + ) idx_start: np.int32 = Field( ..., description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) count: np.int32 = Field( - ..., description="""Number of data samples available in this time series, during this epoch""" + ..., + description="""Number of data samples available in this time series, during this epoch""", ) timeseries: TimeSeries = Field(..., description="""The TimeSeries that this index applies to""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -117,7 +140,9 @@ 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)). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -138,7 +163,9 @@ class ImageReferences(NWBData): Ordered dataset of references to Image objects. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -148,7 +175,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -158,7 +187,9 @@ class NWBDataInterface(NWBContainer): An abstract data type for a generic container storing collections of data, as opposed to metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -168,7 +199,9 @@ class TimeSeries(NWBDataInterface): General purpose time series. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of the time series.""") @@ -197,7 +230,9 @@ class TimeSeries(NWBDataInterface): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -213,7 +248,8 @@ class TimeSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) conversion: Optional[np.float32] = Field( None, @@ -254,10 +290,14 @@ class TimeSeriesStartingTime(ConfiguredBaseModel): name: Literal["starting_time"] = Field( "starting_time", - json_schema_extra={"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"} + }, ) rate: Optional[np.float32] = Field(None, description="""Sampling rate, in Hz.""") - unit: Optional[str] = Field(None, description="""Unit of measurement for time, which is fixed to 'seconds'.""") + unit: Optional[str] = Field( + None, description="""Unit of measurement for time, which is fixed to 'seconds'.""" + ) value: np.float64 = Field(...) @@ -269,7 +309,8 @@ class TimeSeriesSync(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"}) name: Literal["sync"] = Field( - "sync", json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}} + "sync", + json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}}, ) @@ -278,10 +319,15 @@ class ProcessingModule(NWBContainer): A collection of processed data. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) children: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field( - None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}} + None, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]} + }, ) name: str = Field(...) @@ -291,15 +337,21 @@ class Images(NWBDataInterface): A collection of images with an optional way to specify the order of the images using the \"order_of_images\" dataset. An order must be specified if the images are referenced by index, e.g., from an IndexSeries. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field("Images", json_schema_extra={"linkml_meta": {"ifabsent": "string(Images)"}}) - description: Optional[str] = Field(None, description="""Description of this collection of images.""") + description: Optional[str] = Field( + None, description="""Description of this collection of images.""" + ) image: List[Image] = Field(..., description="""Images stored in this collection.""") order_of_images: Named[Optional[ImageReferences]] = Field( None, description="""Ordered dataset of references to Image objects stored in the parent group. Each Image object in the Images group should be stored once and only once, so the dataset should have the same length as the number of images.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_behavior.py index 6c30727..abcef5a 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_behavior.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_behavior.py @@ -71,7 +71,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -127,11 +129,14 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) name: str = Field(...) data: SpatialSeriesData = Field( - ..., description="""1-D or 2-D array storing position or direction relative to some reference frame.""" + ..., + description="""1-D or 2-D array storing position or direction relative to some reference frame.""", ) reference_frame: Optional[str] = Field( None, description="""Description defining what exactly 'straight-ahead' means.""" @@ -158,7 +163,9 @@ class SpatialSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -174,7 +181,8 @@ class SpatialSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -195,7 +203,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[IntervalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "IntervalSeries"}]}} @@ -208,7 +218,9 @@ class BehavioralEvents(NWBDataInterface): TimeSeries for storing behavioral events. See description of BehavioralEpochs for more details. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -221,7 +233,9 @@ class BehavioralTimeSeries(NWBDataInterface): TimeSeries for storing Behavoioral time series data. See description of BehavioralEpochs for more details. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -234,7 +248,9 @@ class PupilTracking(NWBDataInterface): Eye-tracking data, representing pupil size. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -247,7 +263,9 @@ class EyeTracking(NWBDataInterface): Eye-tracking data, representing direction of gaze. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} @@ -260,7 +278,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} @@ -273,7 +293,9 @@ class Position(NWBDataInterface): Position data, whether along the x, x/y or x/y/z axis. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_device.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_device.py index 786934e..deeda97 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_device.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_device.py @@ -22,7 +22,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -62,14 +64,18 @@ class Device(NWBContainer): Metadata about a data acquisition device, e.g., recording system, electrode, microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.device", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.device", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field( None, description="""Description of the device (e.g., model, firmware version, processing software version, etc.) as free-form text.""", ) - manufacturer: Optional[str] = Field(None, description="""The name of the manufacturer of the device.""") + manufacturer: Optional[str] = Field( + None, description="""The name of the manufacturer of the device.""" + ) # Model rebuild diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ecephys.py index 8a63663..6be4d32 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ecephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ecephys.py @@ -7,7 +7,15 @@ import sys import numpy as np from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTableRegion from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from ...core.v2_6_0_alpha.core_nwb_base import ( TimeSeries, TimeSeriesStartingTime, @@ -30,7 +38,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -75,7 +85,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.ecephys/", "id": "core.nwb.ecephys", - "imports": ["core.nwb.base", "../../hdmf_common/v1_5_0/namespace", "core.nwb.device", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "../../hdmf_common/v1_5_0/namespace", + "core.nwb.device", + "core.nwb.language", + ], "name": "core.nwb.ecephys", } ) @@ -86,7 +101,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) filtering: Optional[str] = Field( @@ -101,7 +118,9 @@ class ElectricalSeries(TimeSeries): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( None, @@ -130,7 +149,9 @@ class ElectricalSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -143,7 +164,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) data: Union[ @@ -162,7 +185,9 @@ class SpikeEventSeries(ElectricalSeries): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( None, @@ -186,7 +211,9 @@ class SpikeEventSeries(ElectricalSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -199,9 +226,14 @@ class FeatureExtraction(NWBDataInterface): Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("FeatureExtraction", json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}}) + name: str = Field( + "FeatureExtraction", + json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}}, + ) description: NDArray[Shape["* num_features"], str] = Field( ..., description="""Description of features (eg, ''PC1'') for each of the extracted features.""", @@ -212,7 +244,13 @@ class FeatureExtraction(NWBDataInterface): description="""Multi-dimensional array of features extracted from each event.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_events"}, {"alias": "num_channels"}, {"alias": "num_features"}]} + "array": { + "dimensions": [ + {"alias": "num_events"}, + {"alias": "num_channels"}, + {"alias": "num_features"}, + ] + } } }, ) @@ -224,7 +262,9 @@ class FeatureExtraction(NWBDataInterface): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) @@ -233,9 +273,13 @@ class EventDetection(NWBDataInterface): Detected spike events from voltage trace(s). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}}) + name: str = Field( + "EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}} + ) detection_method: str = Field( ..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""", @@ -257,7 +301,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[SpikeEventSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpikeEventSeries"}]}} @@ -270,7 +316,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[ElectricalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}} @@ -283,7 +331,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[ElectricalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}} @@ -296,7 +346,9 @@ class ElectrodeGroup(NWBContainer): A physical grouping of electrodes, e.g. a shank of an array. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of this electrode group.""") @@ -317,7 +369,10 @@ class ElectrodeGroupPosition(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"}) name: Literal["position"] = Field( - "position", json_schema_extra={"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}} + "position", + json_schema_extra={ + "linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"} + }, ) x: Optional[np.float32] = Field(None, description="""x coordinate""") y: Optional[np.float32] = Field(None, description="""y coordinate""") @@ -329,22 +384,33 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("ClusterWaveforms", json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}}) - waveform_filtering: str = Field(..., description="""Filtering applied to data before generating mean/sd""") + name: str = Field( + "ClusterWaveforms", + json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}}, + ) + waveform_filtering: str = Field( + ..., description="""Filtering applied to data before generating mean/sd""" + ) waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( ..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]} + } }, ) waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( ..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]} + } }, ) @@ -354,9 +420,13 @@ class Clustering(NWBDataInterface): DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}}) + name: str = Field( + "Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}} + ) description: str = Field( ..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_epoch.py index 585b918..25a397b 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_epoch.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_epoch.py @@ -7,7 +7,15 @@ import sys import numpy as np from ...core.v2_6_0_alpha.core_nwb_base import TimeSeriesReferenceVectorData from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, VectorIndex, VectorData @@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -80,50 +90,66 @@ class TimeIntervals(DynamicTable): A container for aggregating epoch data and the TimeSeries that each epoch applies to. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.epoch", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.epoch", "tree_root": True} + ) name: str = Field(...) start_time: NDArray[Any, np.float32] = Field( ..., description="""Start time of epoch, in seconds.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) stop_time: NDArray[Any, np.float32] = Field( ..., description="""Stop time of epoch, in seconds.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) tags: Optional[NDArray[Any, str]] = Field( None, description="""User-defined tags that identify or categorize events.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) tags_index: Named[Optional[VectorIndex]] = Field( None, description="""Index for tags.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) timeseries: Named[Optional[TimeSeriesReferenceVectorData]] = Field( None, description="""An index into a TimeSeries object.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) timeseries_index: Named[Optional[VectorIndex]] = Field( None, description="""Index for timeseries.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_file.py index d7ad8a7..ec7360e 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_file.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_file.py @@ -133,7 +133,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -200,10 +202,14 @@ class ScratchData(NWBData): Any one-off datasets """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: str = Field(...) - notes: Optional[str] = Field(None, description="""Any notes the user has about the dataset being stored""") + notes: Optional[str] = Field( + None, description="""Any notes the user has about the dataset being stored""" + ) class NWBFile(NWBContainer): @@ -211,10 +217,13 @@ class NWBFile(NWBContainer): An NWB file storing cellular-based neurophysiology data from a single experimental session. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: Literal["root"] = Field( - "root", json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}} + "root", + json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}}, ) nwb_version: Optional[str] = Field( None, @@ -223,7 +232,9 @@ class NWBFile(NWBContainer): file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = Field( ..., description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}} + }, ) identifier: str = Field( ..., @@ -243,17 +254,23 @@ class NWBFile(NWBContainer): acquisition: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field( None, description="""Data streams recorded from the system, including ephys, ophys, tracking, etc. This group should be read-only after the experiment is completed and timestamps are corrected to a common timebase. The data stored here may be links to raw data stored in external NWB files. This will allow keeping bulky raw data out of the file while preserving the option of keeping some/all in the file. Acquired data includes tracking and experimental data streams (i.e., everything measured from the system). If bulky data is stored in the /acquisition group, the data can exist in a separate NWB file that is linked to by the file being used for processing and analysis.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]} + }, ) analysis: Optional[List[Union[DynamicTable, NWBContainer]]] = Field( None, description="""Lab-specific and custom scientific analysis of data. There is no defined format for the content of this group - the format is up to the individual user/lab. To facilitate sharing analysis data between labs, the contents here should be stored in standard types (e.g., neurodata_types) and appropriately documented. The file can store lab-specific and custom data analysis without restriction on its form or schema, reducing data formatting restrictions on end users. Such data should be placed in the analysis group. The analysis data should be documented so that it could be shared with other labs.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]} + }, ) scratch: Optional[List[Union[DynamicTable, NWBContainer]]] = Field( None, description="""A place to store one-off analysis results. Data placed here is not intended for sharing. By placing data here, users acknowledge that there is no guarantee that their data meets any standard.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]} + }, ) processing: Optional[List[ProcessingModule]] = Field( None, @@ -293,7 +310,10 @@ class NWBFileStimulus(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["stimulus"] = Field( - "stimulus", json_schema_extra={"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}} + "stimulus", + json_schema_extra={ + "linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"} + }, ) presentation: Optional[List[TimeSeries]] = Field( None, @@ -303,7 +323,9 @@ class NWBFileStimulus(ConfiguredBaseModel): templates: Optional[List[Union[Images, TimeSeries]]] = Field( None, description="""Template stimuli. Timestamps in templates are based on stimulus design and are relative to the beginning of the stimulus. When templates are used, the stimulus instances must convert presentation times to the experiment`s time reference frame.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}, {"range": "Images"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "TimeSeries"}, {"range": "Images"}]} + }, ) @@ -315,16 +337,27 @@ class NWBFileGeneral(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["general"] = Field( - "general", json_schema_extra={"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}} + "general", + json_schema_extra={ + "linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"} + }, + ) + data_collection: Optional[str] = Field( + None, description="""Notes about data collection and analysis.""" + ) + experiment_description: Optional[str] = Field( + None, description="""General description of the experiment.""" ) - data_collection: Optional[str] = Field(None, description="""Notes about data collection and analysis.""") - experiment_description: Optional[str] = Field(None, description="""General description of the experiment.""") experimenter: Optional[NDArray[Shape["* num_experimenters"], str]] = Field( None, description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}} + }, + ) + institution: Optional[str] = Field( + None, description="""Institution(s) where experiment was performed.""" ) - institution: Optional[str] = Field(None, description="""Institution(s) where experiment was performed.""") keywords: Optional[NDArray[Shape["* num_keywords"], str]] = Field( None, description="""Terms to search over.""", @@ -337,12 +370,15 @@ class NWBFileGeneral(ConfiguredBaseModel): description="""Description of drugs used, including how and when they were administered. Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc.""", ) protocol: Optional[str] = Field( - None, description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""" + None, + description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""", ) related_publications: Optional[NDArray[Shape["* num_publications"], str]] = Field( None, description="""Publication information. PMID, DOI, URL, etc.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}} + }, ) session_id: Optional[str] = Field(None, description="""Lab-specific ID for the session.""") slices: Optional[str] = Field( @@ -350,7 +386,8 @@ class NWBFileGeneral(ConfiguredBaseModel): description="""Description of slices, including information about preparation thickness, orientation, temperature, and bath solution.""", ) source_script: Optional[NWBFileGeneralSourceScript] = Field( - None, description="""Script file or link to public source code used to create this NWB file.""" + None, + description="""Script file or link to public source code used to create this NWB file.""", ) stimulus: Optional[str] = Field( None, description="""Notes about stimuli, such as how and where they were presented.""" @@ -373,7 +410,8 @@ class NWBFileGeneral(ConfiguredBaseModel): json_schema_extra={"linkml_meta": {"any_of": [{"range": "Device"}]}}, ) subject: Optional[Subject] = Field( - None, description="""Information about the animal or person from which the data was measured.""" + None, + description="""Information about the animal or person from which the data was measured.""", ) extracellular_ephys: Optional[NWBFileGeneralExtracellularEphys] = Field( None, description="""Metadata related to extracellular electrophysiology.""" @@ -402,7 +440,9 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel): name: Literal["source_script"] = Field( "source_script", - json_schema_extra={"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"} + }, ) file_name: Optional[str] = Field(None, description="""Name of script file.""") value: str = Field(...) @@ -418,10 +458,15 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel): name: Literal["extracellular_ephys"] = Field( "extracellular_ephys", json_schema_extra={ - "linkml_meta": {"equals_string": "extracellular_ephys", "ifabsent": "string(extracellular_ephys)"} + "linkml_meta": { + "equals_string": "extracellular_ephys", + "ifabsent": "string(extracellular_ephys)", + } }, ) - electrode_group: Optional[List[ElectrodeGroup]] = Field(None, description="""Physical group of electrodes.""") + electrode_group: Optional[List[ElectrodeGroup]] = Field( + None, description="""Physical group of electrodes.""" + ) electrodes: Optional[NWBFileGeneralExtracellularEphysElectrodes] = Field( None, description="""A table of all electrodes (i.e. channels) used for recording.""" ) @@ -436,48 +481,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): name: Literal["electrodes"] = Field( "electrodes", - json_schema_extra={"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"} + }, ) x: Optional[NDArray[Any, np.float32]] = Field( None, description="""x coordinate of the channel location in the brain (+x is posterior).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) y: Optional[NDArray[Any, np.float32]] = Field( None, description="""y coordinate of the channel location in the brain (+y is inferior).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) z: Optional[NDArray[Any, np.float32]] = Field( None, description="""z coordinate of the channel location in the brain (+z is right).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) imp: Optional[NDArray[Any, np.float32]] = Field( None, description="""Impedance of the channel, in ohms.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) location: NDArray[Any, str] = Field( ..., description="""Location of the electrode (channel). 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.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) filtering: Optional[NDArray[Any, str]] = Field( None, description="""Description of hardware filtering, including the filter name and frequency cutoffs.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) group: List[ElectrodeGroup] = Field( @@ -487,42 +546,54 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): ..., description="""Name of the ElectrodeGroup this electrode is a part of.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_x: Optional[NDArray[Any, np.float32]] = Field( None, description="""x coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_y: Optional[NDArray[Any, np.float32]] = Field( None, description="""y coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_z: Optional[NDArray[Any, np.float32]] = Field( None, description="""z coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) reference: Optional[NDArray[Any, str]] = Field( None, description="""Description of the reference electrode and/or reference scheme used for this electrode, e.g., \"stainless steel skull screw\" or \"online common average referencing\".""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -543,7 +614,10 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel): name: Literal["intracellular_ephys"] = Field( "intracellular_ephys", json_schema_extra={ - "linkml_meta": {"equals_string": "intracellular_ephys", "ifabsent": "string(intracellular_ephys)"} + "linkml_meta": { + "equals_string": "intracellular_ephys", + "ifabsent": "string(intracellular_ephys)", + } }, ) filtering: Optional[str] = Field( @@ -584,7 +658,9 @@ class LabMetaData(NWBContainer): Lab-specific meta-data. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: str = Field(...) @@ -594,7 +670,9 @@ class Subject(NWBContainer): Information about the animal or person from which the data was measured. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: str = Field(...) age: Optional[SubjectAge] = Field( @@ -604,17 +682,22 @@ class Subject(NWBContainer): None, description="""Date of birth of subject. Can be supplied instead of 'age'.""" ) description: Optional[str] = Field( - None, description="""Description of subject and where subject came from (e.g., breeder, if animal).""" + None, + description="""Description of subject and where subject came from (e.g., breeder, if animal).""", + ) + genotype: Optional[str] = Field( + None, description="""Genetic strain. If absent, assume Wild Type (WT).""" ) - genotype: Optional[str] = Field(None, description="""Genetic strain. If absent, assume Wild Type (WT).""") sex: Optional[str] = Field(None, description="""Gender of subject.""") species: Optional[str] = Field(None, description="""Species of subject.""") strain: Optional[str] = Field(None, description="""Strain of subject.""") subject_id: Optional[str] = Field( - None, description="""ID of animal/person used/participating in experiment (lab convention).""" + None, + description="""ID of animal/person used/participating in experiment (lab convention).""", ) weight: Optional[str] = Field( - None, description="""Weight at time of experiment, at time of surgery and at other important times.""" + None, + description="""Weight at time of experiment, at time of surgery and at other important times.""", ) @@ -626,7 +709,8 @@ class SubjectAge(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["age"] = Field( - "age", json_schema_extra={"linkml_meta": {"equals_string": "age", "ifabsent": "string(age)"}} + "age", + json_schema_extra={"linkml_meta": {"equals_string": "age", "ifabsent": "string(age)"}}, ) reference: Optional[str] = Field( None, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_icephys.py index 383e4ca..e12fbf7 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_icephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_icephys.py @@ -31,7 +31,15 @@ from ...core.v2_6_0_alpha.core_nwb_base import ( Images, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape metamodel_version = "None" @@ -47,7 +55,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -92,7 +102,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.icephys/", "id": "core.nwb.icephys", - "imports": ["core.nwb.base", "core.nwb.device", "../../hdmf_common/v1_5_0/namespace", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "core.nwb.device", + "../../hdmf_common/v1_5_0/namespace", + "core.nwb.language", + ], "name": "core.nwb.icephys", } ) @@ -103,7 +118,9 @@ class PatchClampSeries(TimeSeries): An abstract base class for patch-clamp data - stimulus or response, current or voltage. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) stimulus_description: Optional[str] = Field( @@ -114,7 +131,8 @@ class PatchClampSeries(TimeSeries): ) data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""") gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -138,7 +156,9 @@ class PatchClampSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -154,7 +174,8 @@ class PatchClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -170,13 +191,17 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""") bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""") - capacitance_compensation: Optional[np.float32] = Field(None, description="""Capacitance compensation, in farads.""") + capacitance_compensation: Optional[np.float32] = Field( + None, description="""Capacitance compensation, in farads.""" + ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) @@ -184,7 +209,8 @@ class CurrentClampSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -208,7 +234,9 @@ class CurrentClampSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -224,7 +252,8 @@ class CurrentClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -238,14 +267,19 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) stimulus_description: Optional[str] = Field( - None, description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""" + None, + description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""", ) bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""") - bridge_balance: np.float32 = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + bridge_balance: np.float32 = Field( + ..., description="""Bridge balance, in ohms, fixed to 0.0.""" + ) capacitance_compensation: np.float32 = Field( ..., description="""Capacitance compensation, in farads, fixed to 0.0.""" ) @@ -254,7 +288,8 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -278,7 +313,9 @@ class IZeroClampSeries(CurrentClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -291,7 +328,9 @@ class CurrentClampStimulusSeries(PatchClampSeries): Stimulus current applied during current clamp recording. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: CurrentClampStimulusSeriesData = Field(..., description="""Stimulus current applied.""") @@ -302,7 +341,8 @@ class CurrentClampStimulusSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -326,7 +366,9 @@ class CurrentClampStimulusSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -342,7 +384,8 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -356,7 +399,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: VoltageClampSeriesData = Field(..., description="""Recorded current.""") @@ -378,8 +423,8 @@ class VoltageClampSeries(PatchClampSeries): whole_cell_capacitance_comp: Optional[VoltageClampSeriesWholeCellCapacitanceComp] = Field( None, description="""Whole cell capacitance compensation, in farads.""" ) - whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = Field( - None, description="""Whole cell series resistance compensation, in ohms.""" + whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = ( + Field(None, description="""Whole cell series resistance compensation, in ohms.""") ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" @@ -388,7 +433,8 @@ class VoltageClampSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -412,7 +458,9 @@ class VoltageClampSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -428,7 +476,8 @@ class VoltageClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -447,11 +496,15 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): name: Literal["capacitance_fast"] = Field( "capacitance_fast", json_schema_extra={ - "linkml_meta": {"equals_string": "capacitance_fast", "ifabsent": "string(capacitance_fast)"} + "linkml_meta": { + "equals_string": "capacitance_fast", + "ifabsent": "string(capacitance_fast)", + } }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -466,11 +519,15 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): name: Literal["capacitance_slow"] = Field( "capacitance_slow", json_schema_extra={ - "linkml_meta": {"equals_string": "capacitance_slow", "ifabsent": "string(capacitance_slow)"} + "linkml_meta": { + "equals_string": "capacitance_slow", + "ifabsent": "string(capacitance_slow)", + } }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -492,7 +549,8 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""" + None, + description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""", ) value: np.float32 = Field(...) @@ -514,7 +572,8 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""" + None, + description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""", ) value: np.float32 = Field(...) @@ -536,7 +595,8 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""" + None, + description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""", ) value: np.float32 = Field(...) @@ -558,7 +618,8 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -580,7 +641,8 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""" + None, + description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""", ) value: np.float32 = Field(...) @@ -590,7 +652,9 @@ class VoltageClampStimulusSeries(PatchClampSeries): Stimulus voltage applied during a voltage clamp recording. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: VoltageClampStimulusSeriesData = Field(..., description="""Stimulus voltage applied.""") @@ -601,7 +665,8 @@ class VoltageClampStimulusSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -625,7 +690,9 @@ class VoltageClampStimulusSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -641,7 +708,8 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -655,20 +723,28 @@ class IntracellularElectrode(NWBContainer): An intracellular electrode and its metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) cell_id: Optional[str] = Field(None, description="""unique ID of the cell""") - description: str = Field(..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""") + description: str = Field( + ..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""" + ) filtering: Optional[str] = Field(None, description="""Electrode specific filtering.""") - initial_access_resistance: Optional[str] = Field(None, description="""Initial access resistance.""") + initial_access_resistance: Optional[str] = Field( + None, description="""Initial access resistance.""" + ) location: Optional[str] = Field( None, description="""Location of the electrode. 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.""", ) resistance: Optional[str] = Field(None, description="""Electrode resistance, in ohms.""") seal: Optional[str] = Field(None, description="""Information about seal used for recording.""") - slice: Optional[str] = Field(None, description="""Information about slice used for recording.""") + slice: Optional[str] = Field( + None, description="""Information about slice used for recording.""" + ) class SweepTable(DynamicTable): @@ -676,14 +752,18 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) sweep_number: NDArray[Any, np.uint32] = Field( ..., description="""Sweep number of the PatchClampSeries in that row.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) series: List[PatchClampSeries] = Field( @@ -692,13 +772,17 @@ class SweepTable(DynamicTable): series_index: Named[VectorIndex] = Field( ..., description="""Index for series.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -714,10 +798,14 @@ class IntracellularElectrodesTable(DynamicTable): Table for storing intracellular electrode related metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) electrode: List[IntracellularElectrode] = Field( ..., description="""Column for storing the reference to the intracellular electrode.""" ) @@ -740,14 +828,20 @@ class IntracellularStimuliTable(DynamicTable): Table for storing intracellular stimulus related metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) stimulus: Named[TimeSeriesReferenceVectorData] = Field( ..., description="""Column storing the reference to the recorded stimulus for the recording (rows).""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, @@ -768,14 +862,20 @@ class IntracellularResponsesTable(DynamicTable): Table for storing intracellular response related metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) response: Named[TimeSeriesReferenceVectorData] = Field( ..., description="""Column storing the reference to the recorded response for the recording (rows)""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, @@ -796,12 +896,17 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: Literal["intracellular_recordings"] = Field( "intracellular_recordings", json_schema_extra={ - "linkml_meta": {"equals_string": "intracellular_recordings", "ifabsent": "string(intracellular_recordings)"} + "linkml_meta": { + "equals_string": "intracellular_recordings", + "ifabsent": "string(intracellular_recordings)", + } }, ) description: Optional[str] = Field( @@ -839,27 +944,37 @@ class SimultaneousRecordingsTable(DynamicTable): A table for grouping different intracellular recordings from the IntracellularRecordingsTable table together that were recorded simultaneously from different electrodes. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: Literal["simultaneous_recordings"] = Field( "simultaneous_recordings", json_schema_extra={ - "linkml_meta": {"equals_string": "simultaneous_recordings", "ifabsent": "string(simultaneous_recordings)"} + "linkml_meta": { + "equals_string": "simultaneous_recordings", + "ifabsent": "string(simultaneous_recordings)", + } }, ) recordings: SimultaneousRecordingsTableRecordings = Field( - ..., description="""A reference to one or more rows in the IntracellularRecordingsTable table.""" + ..., + description="""A reference to one or more rows in the IntracellularRecordingsTable table.""", ) recordings_index: Named[VectorIndex] = Field( ..., description="""Index dataset for the recordings column.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -879,13 +994,17 @@ class SimultaneousRecordingsTableRecordings(DynamicTableRegion): name: Literal["recordings"] = Field( "recordings", - json_schema_extra={"linkml_meta": {"equals_string": "recordings", "ifabsent": "string(recordings)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "recordings", "ifabsent": "string(recordings)"} + }, ) table: Optional[IntracellularRecordingsTable] = Field( None, description="""Reference to the IntracellularRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""", ) - description: Optional[str] = Field(None, description="""Description of what this table region points to.""") + description: Optional[str] = Field( + None, description="""Description of what this table region points to.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -901,34 +1020,46 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: Literal["sequential_recordings"] = Field( "sequential_recordings", json_schema_extra={ - "linkml_meta": {"equals_string": "sequential_recordings", "ifabsent": "string(sequential_recordings)"} + "linkml_meta": { + "equals_string": "sequential_recordings", + "ifabsent": "string(sequential_recordings)", + } }, ) simultaneous_recordings: SequentialRecordingsTableSimultaneousRecordings = Field( - ..., description="""A reference to one or more rows in the SimultaneousRecordingsTable table.""" + ..., + description="""A reference to one or more rows in the SimultaneousRecordingsTable table.""", ) simultaneous_recordings_index: Named[VectorIndex] = Field( ..., description="""Index dataset for the simultaneous_recordings column.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) stimulus_type: NDArray[Any, str] = Field( ..., description="""The type of stimulus used for the sequential recording.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -949,14 +1080,19 @@ class SequentialRecordingsTableSimultaneousRecordings(DynamicTableRegion): name: Literal["simultaneous_recordings"] = Field( "simultaneous_recordings", json_schema_extra={ - "linkml_meta": {"equals_string": "simultaneous_recordings", "ifabsent": "string(simultaneous_recordings)"} + "linkml_meta": { + "equals_string": "simultaneous_recordings", + "ifabsent": "string(simultaneous_recordings)", + } }, ) table: Optional[SimultaneousRecordingsTable] = Field( None, description="""Reference to the SimultaneousRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""", ) - description: Optional[str] = Field(None, description="""Description of what this table region points to.""") + description: Optional[str] = Field( + None, description="""Description of what this table region points to.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -972,25 +1108,34 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: Literal["repetitions"] = Field( "repetitions", - json_schema_extra={"linkml_meta": {"equals_string": "repetitions", "ifabsent": "string(repetitions)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "repetitions", "ifabsent": "string(repetitions)"} + }, ) sequential_recordings: RepetitionsTableSequentialRecordings = Field( - ..., description="""A reference to one or more rows in the SequentialRecordingsTable table.""" + ..., + description="""A reference to one or more rows in the SequentialRecordingsTable table.""", ) sequential_recordings_index: Named[VectorIndex] = Field( ..., description="""Index dataset for the sequential_recordings column.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -1011,14 +1156,19 @@ class RepetitionsTableSequentialRecordings(DynamicTableRegion): name: Literal["sequential_recordings"] = Field( "sequential_recordings", json_schema_extra={ - "linkml_meta": {"equals_string": "sequential_recordings", "ifabsent": "string(sequential_recordings)"} + "linkml_meta": { + "equals_string": "sequential_recordings", + "ifabsent": "string(sequential_recordings)", + } }, ) table: Optional[SequentialRecordingsTable] = Field( None, description="""Reference to the SequentialRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""", ) - description: Optional[str] = Field(None, description="""Description of what this table region points to.""") + description: Optional[str] = Field( + None, description="""Description of what this table region points to.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -1034,12 +1184,17 @@ class ExperimentalConditionsTable(DynamicTable): A table for grouping different intracellular recording repetitions together that belong to the same experimental condition. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: Literal["experimental_conditions"] = Field( "experimental_conditions", json_schema_extra={ - "linkml_meta": {"equals_string": "experimental_conditions", "ifabsent": "string(experimental_conditions)"} + "linkml_meta": { + "equals_string": "experimental_conditions", + "ifabsent": "string(experimental_conditions)", + } }, ) repetitions: ExperimentalConditionsTableRepetitions = Field( @@ -1048,13 +1203,17 @@ class ExperimentalConditionsTable(DynamicTable): repetitions_index: Named[VectorIndex] = Field( ..., description="""Index dataset for the repetitions column.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -1074,13 +1233,17 @@ class ExperimentalConditionsTableRepetitions(DynamicTableRegion): name: Literal["repetitions"] = Field( "repetitions", - json_schema_extra={"linkml_meta": {"equals_string": "repetitions", "ifabsent": "string(repetitions)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "repetitions", "ifabsent": "string(repetitions)"} + }, ) table: Optional[RepetitionsTable] = Field( None, description="""Reference to the RepetitionsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""", ) - description: Optional[str] = Field(None, description="""Description of what this table region points to.""") + description: Optional[str] = Field( + None, description="""Description of what this table region points to.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_image.py index 42dc750..ab0de92 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_image.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_image.py @@ -47,7 +47,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -103,7 +105,9 @@ class GrayscaleImage(Image): A grayscale image. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -124,7 +128,9 @@ class RGBImage(Image): A color image. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -145,7 +151,9 @@ class RGBAImage(Image): A color image with transparency. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -166,14 +174,17 @@ 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]. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) - data: Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] = ( - Field( - ..., - description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", - ) + data: Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] = Field( + ..., + description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -210,7 +221,9 @@ class ImageSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -227,7 +240,9 @@ class ImageSeriesExternalFile(ConfiguredBaseModel): name: Literal["external_file"] = Field( "external_file", - json_schema_extra={"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"} + }, ) starting_frame: Optional[np.int32] = Field( None, @@ -243,14 +258,17 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) - data: Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] = ( - Field( - ..., - description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", - ) + data: Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] = Field( + ..., + description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -287,7 +305,9 @@ class ImageMaskSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -300,15 +320,23 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) - distance: Optional[np.float32] = Field(None, description="""Distance from camera/monitor to target/eye.""") + distance: Optional[np.float32] = Field( + None, description="""Distance from camera/monitor to target/eye.""" + ) field_of_view: Optional[ - Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]] + Union[ + NDArray[Shape["2 width_height"], np.float32], + NDArray[Shape["3 width_height_depth"], np.float32], + ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number] + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number], ] = Field(..., description="""Images presented to subject, either grayscale or RGB""") orientation: Optional[str] = Field( None, @@ -349,7 +377,9 @@ class OpticalSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -362,7 +392,9 @@ class IndexSeries(TimeSeries): Stores indices to image frames stored in an ImageSeries. The purpose of the IndexSeries is to allow a static image stack to be stored in an Images object, 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 Images object, and the timestamps array indicates when that image was displayed. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.uint32] = Field( @@ -392,7 +424,9 @@ class IndexSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_misc.py index 2dc0d34..5355215 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_misc.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_misc.py @@ -8,9 +8,22 @@ import numpy as np from ...core.v2_6_0_alpha.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync from ...core.v2_6_0_alpha.core_nwb_ecephys import ElectrodeGroup from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape -from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTableRegion, DynamicTable, VectorData, VectorIndex +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, + DynamicTable, + VectorData, + VectorIndex, +) metamodel_version = "None" version = "2.6.0-alpha" @@ -25,7 +38,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -70,7 +85,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.misc/", "id": "core.nwb.misc", - "imports": ["core.nwb.base", "../../hdmf_common/v1_5_0/namespace", "core.nwb.ecephys", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "../../hdmf_common/v1_5_0/namespace", + "core.nwb.ecephys", + "core.nwb.language", + ], "name": "core.nwb.misc", } ) @@ -81,10 +101,14 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) - data: AbstractFeatureSeriesData = Field(..., description="""Values of each feature at each time.""") + data: AbstractFeatureSeriesData = Field( + ..., description="""Values of each feature at each time.""" + ) feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field( None, description="""Units of each feature.""", @@ -117,7 +141,9 @@ class AbstractFeatureSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -133,14 +159,18 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, description="""Since there can be different units for different features, store the units in 'feature_units'. The default value for this attribute is \"see 'feature_units'\".""", ) array: Optional[ - Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]] + Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_features"], np.number], + ] ] = Field(None) @@ -149,7 +179,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], str] = Field( @@ -179,7 +211,9 @@ class AnnotationSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -192,7 +226,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.int8] = Field( @@ -222,7 +258,9 @@ class IntervalSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -235,15 +273,21 @@ class DecompositionSeries(TimeSeries): Spectral analysis of a time series, e.g. of an LFP or a speech signal. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) - data: DecompositionSeriesData = Field(..., description="""Data decomposed into frequency bands.""") + data: DecompositionSeriesData = Field( + ..., description="""Data decomposed into frequency bands.""" + ) metric: str = Field(..., description="""The metric used, e.g. phase, amplitude, power.""") source_channels: Named[Optional[DynamicTableRegion]] = Field( None, description="""DynamicTableRegion pointer to the channels that this decomposition series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) bands: DecompositionSeriesBands = Field( ..., @@ -271,7 +315,9 @@ class DecompositionSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -287,7 +333,8 @@ class DecompositionSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -297,7 +344,13 @@ class DecompositionSeriesData(ConfiguredBaseModel): None, json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_times"}, {"alias": "num_channels"}, {"alias": "num_bands"}]} + "array": { + "dimensions": [ + {"alias": "num_times"}, + {"alias": "num_channels"}, + {"alias": "num_bands"}, + ] + } } }, ) @@ -311,13 +364,16 @@ class DecompositionSeriesBands(DynamicTable): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["bands"] = Field( - "bands", json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}} + "bands", + json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}}, ) band_name: NDArray[Any, str] = Field( ..., description="""Name of the band, e.g. theta.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field( @@ -325,7 +381,12 @@ class DecompositionSeriesBands(DynamicTable): description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_bands"}, {"alias": "low_high", "exact_cardinality": 2}]} + "array": { + "dimensions": [ + {"alias": "num_bands"}, + {"alias": "low_high", "exact_cardinality": 2}, + ] + } } }, ) @@ -343,7 +404,9 @@ class DecompositionSeriesBands(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -359,38 +422,55 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field("Units", json_schema_extra={"linkml_meta": {"ifabsent": "string(Units)"}}) spike_times_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the spike_times dataset.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, + ) + spike_times: Optional[UnitsSpikeTimes] = Field( + None, description="""Spike times for each unit in seconds.""" ) - spike_times: Optional[UnitsSpikeTimes] = Field(None, description="""Spike times for each unit in seconds.""") obs_intervals_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the obs_intervals dataset.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field( None, description="""Observation intervals for each unit.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_intervals"}, {"alias": "start_end", "exact_cardinality": 2}]} + "array": { + "dimensions": [ + {"alias": "num_intervals"}, + {"alias": "start_end", "exact_cardinality": 2}, + ] + } } }, ) electrodes_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into electrodes.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) electrodes: Named[Optional[DynamicTableRegion]] = Field( None, description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) electrode_group: Optional[List[ElectrodeGroup]] = Field( None, description="""Electrode group that each spike unit came from.""" @@ -411,24 +491,32 @@ class Units(DynamicTable): None, description="""Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same.""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_waveforms"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_waveforms"}, {"alias": "num_samples"}]} + } }, ) waveforms_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the waveforms dataset. One value for every spike event. See 'waveforms' for more detail.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) waveforms_index_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the waveforms_index dataset. One value for every unit (row in the table). See 'waveforms' for more detail.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -448,13 +536,17 @@ class UnitsSpikeTimes(VectorData): name: Literal["spike_times"] = Field( "spike_times", - json_schema_extra={"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"} + }, ) resolution: Optional[np.float64] = Field( None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""", ) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ogen.py index a8995a9..34bce13 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ogen.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ogen.py @@ -8,7 +8,12 @@ from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator import numpy as np from numpydantic import NDArray, Shape -from ...core.v2_6_0_alpha.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync, NWBContainer +from ...core.v2_6_0_alpha.core_nwb_base import ( + TimeSeries, + TimeSeriesStartingTime, + TimeSeriesSync, + NWBContainer, +) metamodel_version = "None" version = "2.6.0-alpha" @@ -23,7 +28,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,7 +86,9 @@ class OptogeneticSeries(TimeSeries): An optogenetic stimulus. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ogen", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.number] = Field( @@ -109,7 +118,9 @@ class OptogeneticSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -122,7 +133,9 @@ class OptogeneticStimulusSite(NWBContainer): A site of optogenetic stimulation. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ogen", "tree_root": True} + ) name: str = Field(...) description: str = Field(..., description="""Description of stimulation site.""") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ophys.py index 8607d17..ccd787e 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ophys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ophys.py @@ -41,7 +41,15 @@ from ...core.v2_6_0_alpha.core_nwb_image import ( IndexSeries, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape metamodel_version = "None" @@ -57,7 +65,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -119,7 +129,9 @@ class OnePhotonSeries(ImageSeries): Image stack recorded over time from 1-photon microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") @@ -133,13 +145,18 @@ class OnePhotonSeries(ImageSeries): binning: Optional[np.uint8] = Field( None, description="""Amount of pixels combined into 'bins'; could be 1, 2, 4, 8, etc.""" ) - power: Optional[np.float32] = Field(None, description="""Power of the excitation in mW, if known.""") - intensity: Optional[np.float32] = Field(None, description="""Intensity of the excitation in mW/mm^2, if known.""") - data: Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] = ( - Field( - ..., - description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", - ) + power: Optional[np.float32] = Field( + None, description="""Power of the excitation in mW, if known.""" + ) + intensity: Optional[np.float32] = Field( + None, description="""Intensity of the excitation in mW/mm^2, if known.""" + ) + data: Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] = Field( + ..., + description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -176,7 +193,9 @@ class OnePhotonSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -189,7 +208,9 @@ class TwoPhotonSeries(ImageSeries): Image stack recorded over time from 2-photon microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") @@ -198,13 +219,17 @@ class TwoPhotonSeries(ImageSeries): description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) field_of_view: Optional[ - Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]] + Union[ + NDArray[Shape["2 width_height"], np.float32], + NDArray[Shape["3 width_height_depth"], np.float32], + ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") - data: Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] = ( - Field( - ..., - description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", - ) + data: Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] = Field( + ..., + description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -241,7 +266,9 @@ class TwoPhotonSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -254,16 +281,21 @@ class RoiResponseSeries(TimeSeries): ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) - data: Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_rois"], np.number]] = Field( - ..., description="""Signals from ROIs.""" - ) + data: Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_rois"], np.number], + ] = Field(..., description="""Signals from ROIs.""") rois: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -287,7 +319,9 @@ class RoiResponseSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -300,7 +334,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[RoiResponseSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}} @@ -313,7 +349,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[RoiResponseSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}} @@ -326,7 +364,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[PlaneSegmentation]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "PlaneSegmentation"}]}} @@ -339,7 +379,9 @@ class PlaneSegmentation(DynamicTable): Results from image segmentation of a specific imaging plane. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) image_mask: Optional[PlaneSegmentationImageMask] = Field( @@ -349,7 +391,9 @@ class PlaneSegmentation(DynamicTable): pixel_mask_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into pixel_mask.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) pixel_mask: Optional[PlaneSegmentationPixelMask] = Field( None, @@ -358,7 +402,9 @@ class PlaneSegmentation(DynamicTable): voxel_mask_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into voxel_mask.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) voxel_mask: Optional[PlaneSegmentationVoxelMask] = Field( None, @@ -373,7 +419,9 @@ class PlaneSegmentation(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -393,9 +441,13 @@ class PlaneSegmentationImageMask(VectorData): name: Literal["image_mask"] = Field( "image_mask", - json_schema_extra={"linkml_meta": {"equals_string": "image_mask", "ifabsent": "string(image_mask)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "image_mask", "ifabsent": "string(image_mask)"} + }, + ) + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" ) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -415,12 +467,16 @@ class PlaneSegmentationPixelMask(VectorData): name: Literal["pixel_mask"] = Field( "pixel_mask", - json_schema_extra={"linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"} + }, ) x: Optional[np.uint32] = Field(None, description="""Pixel x-coordinate.""") y: Optional[np.uint32] = Field(None, description="""Pixel y-coordinate.""") weight: Optional[np.float32] = Field(None, description="""Weight of the pixel.""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -440,13 +496,17 @@ class PlaneSegmentationVoxelMask(VectorData): name: Literal["voxel_mask"] = Field( "voxel_mask", - json_schema_extra={"linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"} + }, ) x: Optional[np.uint32] = Field(None, description="""Voxel x-coordinate.""") y: Optional[np.uint32] = Field(None, description="""Voxel y-coordinate.""") z: Optional[np.uint32] = Field(None, description="""Voxel z-coordinate.""") weight: Optional[np.float32] = Field(None, description="""Weight of the voxel.""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -462,7 +522,9 @@ class ImagingPlane(NWBContainer): An imaging plane and its metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[OpticalChannel]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "OpticalChannel"}]}} @@ -475,11 +537,15 @@ class OpticalChannel(NWBContainer): An optical channel used to record from an imaging plane. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) description: str = Field(..., description="""Description or other notes about the channel.""") - emission_lambda: np.float32 = Field(..., description="""Emission wavelength for channel, in nm.""") + emission_lambda: np.float32 = Field( + ..., description="""Emission wavelength for channel, in nm.""" + ) class MotionCorrection(NWBDataInterface): @@ -487,7 +553,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[CorrectedImageStack]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "CorrectedImageStack"}]}} @@ -500,10 +568,14 @@ class CorrectedImageStack(NWBDataInterface): Reuslts from motion correction of an image stack. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) - corrected: ImageSeries = Field(..., description="""Image stack with frames shifted to the common coordinates.""") + corrected: ImageSeries = Field( + ..., description="""Image stack with frames shifted to the common coordinates.""" + ) xy_translation: TimeSeries = Field( ..., 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.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_retinotopy.py index d3a1a20..dfc09b4 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_retinotopy.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_retinotopy.py @@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,9 +81,14 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.retinotopy", "tree_root": True} + ) - name: str = Field("ImagingRetinotopy", json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}}) + name: str = Field( + "ImagingRetinotopy", + json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}}, + ) axis_1_phase_map: ImagingRetinotopyAxis1PhaseMap = Field( ..., description="""Phase response to stimulus on the first measured axis.""" ) @@ -100,7 +107,9 @@ class ImagingRetinotopy(NWBDataInterface): ..., description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]} + } }, ) focal_depth_image: Optional[ImagingRetinotopyFocalDepthImage] = Field( @@ -108,10 +117,12 @@ class ImagingRetinotopy(NWBDataInterface): description="""Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].""", ) sign_map: Optional[ImagingRetinotopySignMap] = Field( - None, description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""" + None, + description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""", ) vasculature_image: ImagingRetinotopyVasculatureImage = Field( - ..., description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""" + ..., + description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""", ) @@ -125,18 +136,27 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): name: Literal["axis_1_phase_map"] = Field( "axis_1_phase_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_1_phase_map", "ifabsent": "string(axis_1_phase_map)"} + "linkml_meta": { + "equals_string": "axis_1_phase_map", + "ifabsent": "string(axis_1_phase_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -150,18 +170,27 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): name: Literal["axis_1_power_map"] = Field( "axis_1_power_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_1_power_map", "ifabsent": "string(axis_1_power_map)"} + "linkml_meta": { + "equals_string": "axis_1_power_map", + "ifabsent": "string(axis_1_power_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -175,18 +204,27 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): name: Literal["axis_2_phase_map"] = Field( "axis_2_phase_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_2_phase_map", "ifabsent": "string(axis_2_phase_map)"} + "linkml_meta": { + "equals_string": "axis_2_phase_map", + "ifabsent": "string(axis_2_phase_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -200,18 +238,27 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): name: Literal["axis_2_power_map"] = Field( "axis_2_power_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_2_power_map", "ifabsent": "string(axis_2_power_map)"} + "linkml_meta": { + "equals_string": "axis_2_power_map", + "ifabsent": "string(axis_2_power_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -225,7 +272,10 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): name: Literal["focal_depth_image"] = Field( "focal_depth_image", json_schema_extra={ - "linkml_meta": {"equals_string": "focal_depth_image", "ifabsent": "string(focal_depth_image)"} + "linkml_meta": { + "equals_string": "focal_depth_image", + "ifabsent": "string(focal_depth_image)", + } }, ) bits_per_pixel: Optional[np.int32] = Field( @@ -236,12 +286,20 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - focal_depth: Optional[np.float32] = Field(None, description="""Focal depth offset, in meters.""") - format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + focal_depth: Optional[np.float32] = Field( + None, description="""Focal depth offset, in meters.""" + ) + format: Optional[str] = Field( + None, description="""Format of image. Right now only 'raw' is supported.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -253,16 +311,23 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy"}) name: Literal["sign_map"] = Field( - "sign_map", json_schema_extra={"linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"}} + "sign_map", + json_schema_extra={ + "linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"} + }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -276,7 +341,10 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): name: Literal["vasculature_image"] = Field( "vasculature_image", json_schema_extra={ - "linkml_meta": {"equals_string": "vasculature_image", "ifabsent": "string(vasculature_image)"} + "linkml_meta": { + "equals_string": "vasculature_image", + "ifabsent": "string(vasculature_image)", + } }, ) bits_per_pixel: Optional[np.int32] = Field( @@ -287,11 +355,17 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + format: Optional[str] = Field( + None, description="""Format of image. Right now only 'raw' is supported.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/namespace.py index 603266d..c6adbf3 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/namespace.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/namespace.py @@ -175,7 +175,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/__init__.py index 8d1c8b6..8b13789 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/__init__.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/__init__.py @@ -1 +1 @@ - + diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_base.py index bfceb7e..404c5fa 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_base.py @@ -9,7 +9,15 @@ from ...hdmf_common.v1_8_0.hdmf_common_base import Data, Container from numpydantic import NDArray, Shape from ...hdmf_common.v1_8_0.hdmf_common_table import VectorData, DynamicTable from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) metamodel_version = "None" version = "2.7.0" @@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -69,7 +79,11 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.base/", "id": "core.nwb.base", - "imports": ["../../hdmf_common/v1_8_0/namespace", "../../hdmf_common/v1_8_0/namespace", "core.nwb.language"], + "imports": [ + "../../hdmf_common/v1_8_0/namespace", + "../../hdmf_common/v1_8_0/namespace", + "core.nwb.language", + ], "name": "core.nwb.base", } ) @@ -80,7 +94,9 @@ class NWBData(Data): An abstract data type for a dataset. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -90,18 +106,25 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) - name: str = Field("timeseries", json_schema_extra={"linkml_meta": {"ifabsent": "string(timeseries)"}}) + name: str = Field( + "timeseries", json_schema_extra={"linkml_meta": {"ifabsent": "string(timeseries)"}} + ) idx_start: np.int32 = Field( ..., description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) count: np.int32 = Field( - ..., description="""Number of data samples available in this time series, during this epoch""" + ..., + description="""Number of data samples available in this time series, during this epoch""", ) timeseries: TimeSeries = Field(..., description="""The TimeSeries that this index applies to""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -117,7 +140,9 @@ 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)). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -138,7 +163,9 @@ class ImageReferences(NWBData): Ordered dataset of references to Image objects. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -148,7 +175,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -158,7 +187,9 @@ class NWBDataInterface(NWBContainer): An abstract data type for a generic container storing collections of data, as opposed to metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) @@ -168,7 +199,9 @@ class TimeSeries(NWBDataInterface): General purpose time series. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of the time series.""") @@ -197,7 +230,9 @@ class TimeSeries(NWBDataInterface): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -213,7 +248,8 @@ class TimeSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) conversion: Optional[np.float32] = Field( None, @@ -254,10 +290,14 @@ class TimeSeriesStartingTime(ConfiguredBaseModel): name: Literal["starting_time"] = Field( "starting_time", - json_schema_extra={"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"} + }, ) rate: Optional[np.float32] = Field(None, description="""Sampling rate, in Hz.""") - unit: Optional[str] = Field(None, description="""Unit of measurement for time, which is fixed to 'seconds'.""") + unit: Optional[str] = Field( + None, description="""Unit of measurement for time, which is fixed to 'seconds'.""" + ) value: np.float64 = Field(...) @@ -269,7 +309,8 @@ class TimeSeriesSync(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"}) name: Literal["sync"] = Field( - "sync", json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}} + "sync", + json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}}, ) @@ -278,10 +319,15 @@ class ProcessingModule(NWBContainer): A collection of processed data. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) children: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field( - None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}} + None, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]} + }, ) name: str = Field(...) @@ -291,15 +337,21 @@ class Images(NWBDataInterface): A collection of images with an optional way to specify the order of the images using the \"order_of_images\" dataset. An order must be specified if the images are referenced by index, e.g., from an IndexSeries. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.base", "tree_root": True} + ) name: str = Field("Images", json_schema_extra={"linkml_meta": {"ifabsent": "string(Images)"}}) - description: Optional[str] = Field(None, description="""Description of this collection of images.""") + description: Optional[str] = Field( + None, description="""Description of this collection of images.""" + ) image: List[Image] = Field(..., description="""Images stored in this collection.""") order_of_images: Named[Optional[ImageReferences]] = Field( None, description="""Ordered dataset of references to Image objects stored in the parent group. Each Image object in the Images group should be stored once and only once, so the dataset should have the same length as the number of images.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_behavior.py index 0834e15..54c77a5 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_behavior.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_behavior.py @@ -71,7 +71,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -127,11 +129,14 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) name: str = Field(...) data: SpatialSeriesData = Field( - ..., description="""1-D or 2-D array storing position or direction relative to some reference frame.""" + ..., + description="""1-D or 2-D array storing position or direction relative to some reference frame.""", ) reference_frame: Optional[str] = Field( None, description="""Description defining what exactly 'straight-ahead' means.""" @@ -158,7 +163,9 @@ class SpatialSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -174,7 +181,8 @@ class SpatialSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -195,7 +203,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[IntervalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "IntervalSeries"}]}} @@ -208,7 +218,9 @@ class BehavioralEvents(NWBDataInterface): TimeSeries for storing behavioral events. See description of BehavioralEpochs for more details. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -221,7 +233,9 @@ class BehavioralTimeSeries(NWBDataInterface): TimeSeries for storing Behavoioral time series data. See description of BehavioralEpochs for more details. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -234,7 +248,9 @@ class PupilTracking(NWBDataInterface): Eye-tracking data, representing pupil size. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[TimeSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}} @@ -247,7 +263,9 @@ class EyeTracking(NWBDataInterface): Eye-tracking data, representing direction of gaze. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} @@ -260,7 +278,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} @@ -273,7 +293,9 @@ class Position(NWBDataInterface): Position data, whether along the x, x/y or x/y/z axis. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.behavior", "tree_root": True} + ) children: Optional[List[SpatialSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_device.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_device.py index f8c3839..0abc50a 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_device.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_device.py @@ -22,7 +22,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -62,14 +64,18 @@ class Device(NWBContainer): Metadata about a data acquisition device, e.g., recording system, electrode, microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.device", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.device", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field( None, description="""Description of the device (e.g., model, firmware version, processing software version, etc.) as free-form text.""", ) - manufacturer: Optional[str] = Field(None, description="""The name of the manufacturer of the device.""") + manufacturer: Optional[str] = Field( + None, description="""The name of the manufacturer of the device.""" + ) # Model rebuild diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ecephys.py index b5e90dc..c8bb299 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ecephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ecephys.py @@ -7,7 +7,15 @@ import sys import numpy as np from ...hdmf_common.v1_8_0.hdmf_common_table import DynamicTableRegion from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from ...core.v2_7_0.core_nwb_base import ( TimeSeries, TimeSeriesStartingTime, @@ -30,7 +38,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -75,7 +85,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.ecephys/", "id": "core.nwb.ecephys", - "imports": ["core.nwb.base", "../../hdmf_common/v1_8_0/namespace", "core.nwb.device", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "../../hdmf_common/v1_8_0/namespace", + "core.nwb.device", + "core.nwb.language", + ], "name": "core.nwb.ecephys", } ) @@ -86,7 +101,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) filtering: Optional[str] = Field( @@ -101,7 +118,9 @@ class ElectricalSeries(TimeSeries): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( None, @@ -130,7 +149,9 @@ class ElectricalSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -143,7 +164,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) data: Union[ @@ -162,7 +185,9 @@ class SpikeEventSeries(ElectricalSeries): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( None, @@ -186,7 +211,9 @@ class SpikeEventSeries(ElectricalSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -199,9 +226,14 @@ class FeatureExtraction(NWBDataInterface): Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("FeatureExtraction", json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}}) + name: str = Field( + "FeatureExtraction", + json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}}, + ) description: NDArray[Shape["* num_features"], str] = Field( ..., description="""Description of features (eg, ''PC1'') for each of the extracted features.""", @@ -212,7 +244,13 @@ class FeatureExtraction(NWBDataInterface): description="""Multi-dimensional array of features extracted from each event.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_events"}, {"alias": "num_channels"}, {"alias": "num_features"}]} + "array": { + "dimensions": [ + {"alias": "num_events"}, + {"alias": "num_channels"}, + {"alias": "num_features"}, + ] + } } }, ) @@ -224,7 +262,9 @@ class FeatureExtraction(NWBDataInterface): electrodes: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) @@ -233,9 +273,13 @@ class EventDetection(NWBDataInterface): Detected spike events from voltage trace(s). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}}) + name: str = Field( + "EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}} + ) detection_method: str = Field( ..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""", @@ -257,7 +301,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[SpikeEventSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpikeEventSeries"}]}} @@ -270,7 +316,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[ElectricalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}} @@ -283,7 +331,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) children: Optional[List[ElectricalSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}} @@ -296,7 +346,9 @@ class ElectrodeGroup(NWBContainer): A physical grouping of electrodes, e.g. a shank of an array. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) name: str = Field(...) description: Optional[str] = Field(None, description="""Description of this electrode group.""") @@ -317,7 +369,10 @@ class ElectrodeGroupPosition(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"}) name: Literal["position"] = Field( - "position", json_schema_extra={"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}} + "position", + json_schema_extra={ + "linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"} + }, ) x: Optional[np.float32] = Field(None, description="""x coordinate""") y: Optional[np.float32] = Field(None, description="""y coordinate""") @@ -329,22 +384,33 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("ClusterWaveforms", json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}}) - waveform_filtering: str = Field(..., description="""Filtering applied to data before generating mean/sd""") + name: str = Field( + "ClusterWaveforms", + json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}}, + ) + waveform_filtering: str = Field( + ..., description="""Filtering applied to data before generating mean/sd""" + ) waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( ..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]} + } }, ) waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( ..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]} + } }, ) @@ -354,9 +420,13 @@ class Clustering(NWBDataInterface): DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ecephys", "tree_root": True} + ) - name: str = Field("Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}}) + name: str = Field( + "Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}} + ) description: str = Field( ..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_epoch.py index e796ca2..27670dc 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_epoch.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_epoch.py @@ -7,7 +7,15 @@ import sys import numpy as np from ...core.v2_7_0.core_nwb_base import TimeSeriesReferenceVectorData from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape from ...hdmf_common.v1_8_0.hdmf_common_table import DynamicTable, VectorIndex, VectorData @@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -80,50 +90,66 @@ class TimeIntervals(DynamicTable): A container for aggregating epoch data and the TimeSeries that each epoch applies to. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.epoch", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.epoch", "tree_root": True} + ) name: str = Field(...) start_time: NDArray[Any, np.float32] = Field( ..., description="""Start time of epoch, in seconds.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) stop_time: NDArray[Any, np.float32] = Field( ..., description="""Stop time of epoch, in seconds.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) tags: Optional[NDArray[Any, str]] = Field( None, description="""User-defined tags that identify or categorize events.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) tags_index: Named[Optional[VectorIndex]] = Field( None, description="""Index for tags.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) timeseries: Named[Optional[TimeSeriesReferenceVectorData]] = Field( None, description="""An index into a TimeSeries object.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) timeseries_index: Named[Optional[VectorIndex]] = Field( None, description="""Index for timeseries.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_file.py index ae2971a..97bdbf3 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_file.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_file.py @@ -133,7 +133,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -200,10 +202,14 @@ class ScratchData(NWBData): Any one-off datasets """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: str = Field(...) - notes: Optional[str] = Field(None, description="""Any notes the user has about the dataset being stored""") + notes: Optional[str] = Field( + None, description="""Any notes the user has about the dataset being stored""" + ) class NWBFile(NWBContainer): @@ -211,10 +217,13 @@ class NWBFile(NWBContainer): An NWB file storing cellular-based neurophysiology data from a single experimental session. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: Literal["root"] = Field( - "root", json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}} + "root", + json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}}, ) nwb_version: Optional[str] = Field( None, @@ -223,7 +232,9 @@ class NWBFile(NWBContainer): file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = Field( ..., description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}} + }, ) identifier: str = Field( ..., @@ -243,17 +254,23 @@ class NWBFile(NWBContainer): acquisition: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field( None, description="""Data streams recorded from the system, including ephys, ophys, tracking, etc. This group should be read-only after the experiment is completed and timestamps are corrected to a common timebase. The data stored here may be links to raw data stored in external NWB files. This will allow keeping bulky raw data out of the file while preserving the option of keeping some/all in the file. Acquired data includes tracking and experimental data streams (i.e., everything measured from the system). If bulky data is stored in the /acquisition group, the data can exist in a separate NWB file that is linked to by the file being used for processing and analysis.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]} + }, ) analysis: Optional[List[Union[DynamicTable, NWBContainer]]] = Field( None, description="""Lab-specific and custom scientific analysis of data. There is no defined format for the content of this group - the format is up to the individual user/lab. To facilitate sharing analysis data between labs, the contents here should be stored in standard types (e.g., neurodata_types) and appropriately documented. The file can store lab-specific and custom data analysis without restriction on its form or schema, reducing data formatting restrictions on end users. Such data should be placed in the analysis group. The analysis data should be documented so that it could be shared with other labs.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]} + }, ) scratch: Optional[List[Union[DynamicTable, NWBContainer]]] = Field( None, description="""A place to store one-off analysis results. Data placed here is not intended for sharing. By placing data here, users acknowledge that there is no guarantee that their data meets any standard.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]} + }, ) processing: Optional[List[ProcessingModule]] = Field( None, @@ -293,21 +310,30 @@ class NWBFileStimulus(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["stimulus"] = Field( - "stimulus", json_schema_extra={"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}} + "stimulus", + json_schema_extra={ + "linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"} + }, ) presentation: Optional[List[Union[DynamicTable, NWBDataInterface, TimeSeries]]] = Field( None, description="""Stimuli presented during the experiment.""", json_schema_extra={ "linkml_meta": { - "any_of": [{"range": "TimeSeries"}, {"range": "NWBDataInterface"}, {"range": "DynamicTable"}] + "any_of": [ + {"range": "TimeSeries"}, + {"range": "NWBDataInterface"}, + {"range": "DynamicTable"}, + ] } }, ) templates: Optional[List[Union[Images, TimeSeries]]] = Field( None, description="""Template stimuli. Timestamps in templates are based on stimulus design and are relative to the beginning of the stimulus. When templates are used, the stimulus instances must convert presentation times to the experiment`s time reference frame.""", - json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}, {"range": "Images"}]}}, + json_schema_extra={ + "linkml_meta": {"any_of": [{"range": "TimeSeries"}, {"range": "Images"}]} + }, ) @@ -319,16 +345,27 @@ class NWBFileGeneral(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["general"] = Field( - "general", json_schema_extra={"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}} + "general", + json_schema_extra={ + "linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"} + }, + ) + data_collection: Optional[str] = Field( + None, description="""Notes about data collection and analysis.""" + ) + experiment_description: Optional[str] = Field( + None, description="""General description of the experiment.""" ) - data_collection: Optional[str] = Field(None, description="""Notes about data collection and analysis.""") - experiment_description: Optional[str] = Field(None, description="""General description of the experiment.""") experimenter: Optional[NDArray[Shape["* num_experimenters"], str]] = Field( None, description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}} + }, + ) + institution: Optional[str] = Field( + None, description="""Institution(s) where experiment was performed.""" ) - institution: Optional[str] = Field(None, description="""Institution(s) where experiment was performed.""") keywords: Optional[NDArray[Shape["* num_keywords"], str]] = Field( None, description="""Terms to search over.""", @@ -341,12 +378,15 @@ class NWBFileGeneral(ConfiguredBaseModel): description="""Description of drugs used, including how and when they were administered. Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc.""", ) protocol: Optional[str] = Field( - None, description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""" + None, + description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""", ) related_publications: Optional[NDArray[Shape["* num_publications"], str]] = Field( None, description="""Publication information. PMID, DOI, URL, etc.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}} + }, ) session_id: Optional[str] = Field(None, description="""Lab-specific ID for the session.""") slices: Optional[str] = Field( @@ -354,7 +394,8 @@ class NWBFileGeneral(ConfiguredBaseModel): description="""Description of slices, including information about preparation thickness, orientation, temperature, and bath solution.""", ) source_script: Optional[NWBFileGeneralSourceScript] = Field( - None, description="""Script file or link to public source code used to create this NWB file.""" + None, + description="""Script file or link to public source code used to create this NWB file.""", ) stimulus: Optional[str] = Field( None, description="""Notes about stimuli, such as how and where they were presented.""" @@ -377,7 +418,8 @@ class NWBFileGeneral(ConfiguredBaseModel): json_schema_extra={"linkml_meta": {"any_of": [{"range": "Device"}]}}, ) subject: Optional[Subject] = Field( - None, description="""Information about the animal or person from which the data was measured.""" + None, + description="""Information about the animal or person from which the data was measured.""", ) extracellular_ephys: Optional[NWBFileGeneralExtracellularEphys] = Field( None, description="""Metadata related to extracellular electrophysiology.""" @@ -406,7 +448,9 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel): name: Literal["source_script"] = Field( "source_script", - json_schema_extra={"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"} + }, ) file_name: Optional[str] = Field(None, description="""Name of script file.""") value: str = Field(...) @@ -422,10 +466,15 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel): name: Literal["extracellular_ephys"] = Field( "extracellular_ephys", json_schema_extra={ - "linkml_meta": {"equals_string": "extracellular_ephys", "ifabsent": "string(extracellular_ephys)"} + "linkml_meta": { + "equals_string": "extracellular_ephys", + "ifabsent": "string(extracellular_ephys)", + } }, ) - electrode_group: Optional[List[ElectrodeGroup]] = Field(None, description="""Physical group of electrodes.""") + electrode_group: Optional[List[ElectrodeGroup]] = Field( + None, description="""Physical group of electrodes.""" + ) electrodes: Optional[NWBFileGeneralExtracellularEphysElectrodes] = Field( None, description="""A table of all electrodes (i.e. channels) used for recording.""" ) @@ -440,48 +489,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): name: Literal["electrodes"] = Field( "electrodes", - json_schema_extra={"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"} + }, ) x: Optional[NDArray[Any, np.float32]] = Field( None, description="""x coordinate of the channel location in the brain (+x is posterior).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) y: Optional[NDArray[Any, np.float32]] = Field( None, description="""y coordinate of the channel location in the brain (+y is inferior).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) z: Optional[NDArray[Any, np.float32]] = Field( None, description="""z coordinate of the channel location in the brain (+z is right).""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) imp: Optional[NDArray[Any, np.float32]] = Field( None, description="""Impedance of the channel, in ohms.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) location: NDArray[Any, str] = Field( ..., description="""Location of the electrode (channel). 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.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) filtering: Optional[NDArray[Any, str]] = Field( None, description="""Description of hardware filtering, including the filter name and frequency cutoffs.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) group: List[ElectrodeGroup] = Field( @@ -491,42 +554,54 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): ..., description="""Name of the ElectrodeGroup this electrode is a part of.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_x: Optional[NDArray[Any, np.float32]] = Field( None, description="""x coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_y: Optional[NDArray[Any, np.float32]] = Field( None, description="""y coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) rel_z: Optional[NDArray[Any, np.float32]] = Field( None, description="""z coordinate in electrode group""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) reference: Optional[NDArray[Any, str]] = Field( None, description="""Description of the reference electrode and/or reference scheme used for this electrode, e.g., \"stainless steel skull screw\" or \"online common average referencing\".""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -547,7 +622,10 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel): name: Literal["intracellular_ephys"] = Field( "intracellular_ephys", json_schema_extra={ - "linkml_meta": {"equals_string": "intracellular_ephys", "ifabsent": "string(intracellular_ephys)"} + "linkml_meta": { + "equals_string": "intracellular_ephys", + "ifabsent": "string(intracellular_ephys)", + } }, ) filtering: Optional[str] = Field( @@ -588,7 +666,9 @@ class LabMetaData(NWBContainer): Lab-specific meta-data. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: str = Field(...) @@ -598,7 +678,9 @@ class Subject(NWBContainer): Information about the animal or person from which the data was measured. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.file", "tree_root": True} + ) name: str = Field(...) age: Optional[SubjectAge] = Field( @@ -608,17 +690,22 @@ class Subject(NWBContainer): None, description="""Date of birth of subject. Can be supplied instead of 'age'.""" ) description: Optional[str] = Field( - None, description="""Description of subject and where subject came from (e.g., breeder, if animal).""" + None, + description="""Description of subject and where subject came from (e.g., breeder, if animal).""", + ) + genotype: Optional[str] = Field( + None, description="""Genetic strain. If absent, assume Wild Type (WT).""" ) - genotype: Optional[str] = Field(None, description="""Genetic strain. If absent, assume Wild Type (WT).""") sex: Optional[str] = Field(None, description="""Gender of subject.""") species: Optional[str] = Field(None, description="""Species of subject.""") strain: Optional[str] = Field(None, description="""Strain of subject.""") subject_id: Optional[str] = Field( - None, description="""ID of animal/person used/participating in experiment (lab convention).""" + None, + description="""ID of animal/person used/participating in experiment (lab convention).""", ) weight: Optional[str] = Field( - None, description="""Weight at time of experiment, at time of surgery and at other important times.""" + None, + description="""Weight at time of experiment, at time of surgery and at other important times.""", ) @@ -630,7 +717,8 @@ class SubjectAge(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"}) name: Literal["age"] = Field( - "age", json_schema_extra={"linkml_meta": {"equals_string": "age", "ifabsent": "string(age)"}} + "age", + json_schema_extra={"linkml_meta": {"equals_string": "age", "ifabsent": "string(age)"}}, ) reference: Optional[str] = Field( None, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_icephys.py index 2c4d890..ab6d663 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_icephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_icephys.py @@ -31,7 +31,15 @@ from ...core.v2_7_0.core_nwb_base import ( Images, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape metamodel_version = "None" @@ -47,7 +55,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -92,7 +102,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.icephys/", "id": "core.nwb.icephys", - "imports": ["core.nwb.base", "core.nwb.device", "../../hdmf_common/v1_8_0/namespace", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "core.nwb.device", + "../../hdmf_common/v1_8_0/namespace", + "core.nwb.language", + ], "name": "core.nwb.icephys", } ) @@ -103,7 +118,9 @@ class PatchClampSeries(TimeSeries): An abstract base class for patch-clamp data - stimulus or response, current or voltage. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) stimulus_description: Optional[str] = Field( @@ -114,7 +131,8 @@ class PatchClampSeries(TimeSeries): ) data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""") gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -138,7 +156,9 @@ class PatchClampSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -154,7 +174,8 @@ class PatchClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -170,13 +191,17 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""") bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""") - capacitance_compensation: Optional[np.float32] = Field(None, description="""Capacitance compensation, in farads.""") + capacitance_compensation: Optional[np.float32] = Field( + None, description="""Capacitance compensation, in farads.""" + ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) @@ -184,7 +209,8 @@ class CurrentClampSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -208,7 +234,9 @@ class CurrentClampSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -224,7 +252,8 @@ class CurrentClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -238,14 +267,19 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) stimulus_description: Optional[str] = Field( - None, description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""" + None, + description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""", ) bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""") - bridge_balance: np.float32 = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + bridge_balance: np.float32 = Field( + ..., description="""Bridge balance, in ohms, fixed to 0.0.""" + ) capacitance_compensation: np.float32 = Field( ..., description="""Capacitance compensation, in farads, fixed to 0.0.""" ) @@ -254,7 +288,8 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -278,7 +313,9 @@ class IZeroClampSeries(CurrentClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -291,7 +328,9 @@ class CurrentClampStimulusSeries(PatchClampSeries): Stimulus current applied during current clamp recording. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: CurrentClampStimulusSeriesData = Field(..., description="""Stimulus current applied.""") @@ -302,7 +341,8 @@ class CurrentClampStimulusSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -326,7 +366,9 @@ class CurrentClampStimulusSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -342,7 +384,8 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -356,7 +399,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: VoltageClampSeriesData = Field(..., description="""Recorded current.""") @@ -378,8 +423,8 @@ class VoltageClampSeries(PatchClampSeries): whole_cell_capacitance_comp: Optional[VoltageClampSeriesWholeCellCapacitanceComp] = Field( None, description="""Whole cell capacitance compensation, in farads.""" ) - whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = Field( - None, description="""Whole cell series resistance compensation, in ohms.""" + whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = ( + Field(None, description="""Whole cell series resistance compensation, in ohms.""") ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" @@ -388,7 +433,8 @@ class VoltageClampSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -412,7 +458,9 @@ class VoltageClampSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -428,7 +476,8 @@ class VoltageClampSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -447,11 +496,15 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): name: Literal["capacitance_fast"] = Field( "capacitance_fast", json_schema_extra={ - "linkml_meta": {"equals_string": "capacitance_fast", "ifabsent": "string(capacitance_fast)"} + "linkml_meta": { + "equals_string": "capacitance_fast", + "ifabsent": "string(capacitance_fast)", + } }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -466,11 +519,15 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): name: Literal["capacitance_slow"] = Field( "capacitance_slow", json_schema_extra={ - "linkml_meta": {"equals_string": "capacitance_slow", "ifabsent": "string(capacitance_slow)"} + "linkml_meta": { + "equals_string": "capacitance_slow", + "ifabsent": "string(capacitance_slow)", + } }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -492,7 +549,8 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""" + None, + description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""", ) value: np.float32 = Field(...) @@ -514,7 +572,8 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""" + None, + description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""", ) value: np.float32 = Field(...) @@ -536,7 +595,8 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""" + None, + description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""", ) value: np.float32 = Field(...) @@ -558,7 +618,8 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""" + None, + description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""", ) value: np.float32 = Field(...) @@ -580,7 +641,8 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): }, ) unit: Optional[str] = Field( - None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""" + None, + description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""", ) value: np.float32 = Field(...) @@ -590,7 +652,9 @@ class VoltageClampStimulusSeries(PatchClampSeries): Stimulus voltage applied during a voltage clamp recording. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) data: VoltageClampStimulusSeriesData = Field(..., description="""Stimulus voltage applied.""") @@ -601,7 +665,8 @@ class VoltageClampStimulusSeries(PatchClampSeries): None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) gain: Optional[np.float32] = Field( - None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""" + None, + description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -625,7 +690,9 @@ class VoltageClampStimulusSeries(PatchClampSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -641,7 +708,8 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -655,20 +723,28 @@ class IntracellularElectrode(NWBContainer): An intracellular electrode and its metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) cell_id: Optional[str] = Field(None, description="""unique ID of the cell""") - description: str = Field(..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""") + description: str = Field( + ..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""" + ) filtering: Optional[str] = Field(None, description="""Electrode specific filtering.""") - initial_access_resistance: Optional[str] = Field(None, description="""Initial access resistance.""") + initial_access_resistance: Optional[str] = Field( + None, description="""Initial access resistance.""" + ) location: Optional[str] = Field( None, description="""Location of the electrode. 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.""", ) resistance: Optional[str] = Field(None, description="""Electrode resistance, in ohms.""") seal: Optional[str] = Field(None, description="""Information about seal used for recording.""") - slice: Optional[str] = Field(None, description="""Information about slice used for recording.""") + slice: Optional[str] = Field( + None, description="""Information about slice used for recording.""" + ) class SweepTable(DynamicTable): @@ -676,14 +752,18 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) sweep_number: NDArray[Any, np.uint32] = Field( ..., description="""Sweep number of the PatchClampSeries in that row.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) series: List[PatchClampSeries] = Field( @@ -692,13 +772,17 @@ class SweepTable(DynamicTable): series_index: Named[VectorIndex] = Field( ..., description="""Index for series.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -714,10 +798,14 @@ class IntracellularElectrodesTable(DynamicTable): Table for storing intracellular electrode related metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) electrode: List[IntracellularElectrode] = Field( ..., description="""Column for storing the reference to the intracellular electrode.""" ) @@ -740,19 +828,27 @@ class IntracellularStimuliTable(DynamicTable): Table for storing intracellular stimulus related metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) stimulus: Named[TimeSeriesReferenceVectorData] = Field( ..., description="""Column storing the reference to the recorded stimulus for the recording (rows).""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) stimulus_template: Named[Optional[TimeSeriesReferenceVectorData]] = Field( None, description="""Column storing the reference to the stimulus template for the recording (rows).""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, @@ -773,14 +869,20 @@ class IntracellularResponsesTable(DynamicTable): Table for storing intracellular response related metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: str = Field(...) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) response: Named[TimeSeriesReferenceVectorData] = Field( ..., description="""Column storing the reference to the recorded response for the recording (rows)""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, @@ -801,12 +903,17 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: Literal["intracellular_recordings"] = Field( "intracellular_recordings", json_schema_extra={ - "linkml_meta": {"equals_string": "intracellular_recordings", "ifabsent": "string(intracellular_recordings)"} + "linkml_meta": { + "equals_string": "intracellular_recordings", + "ifabsent": "string(intracellular_recordings)", + } }, ) description: Optional[str] = Field( @@ -844,27 +951,37 @@ class SimultaneousRecordingsTable(DynamicTable): A table for grouping different intracellular recordings from the IntracellularRecordingsTable table together that were recorded simultaneously from different electrodes. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: Literal["simultaneous_recordings"] = Field( "simultaneous_recordings", json_schema_extra={ - "linkml_meta": {"equals_string": "simultaneous_recordings", "ifabsent": "string(simultaneous_recordings)"} + "linkml_meta": { + "equals_string": "simultaneous_recordings", + "ifabsent": "string(simultaneous_recordings)", + } }, ) recordings: SimultaneousRecordingsTableRecordings = Field( - ..., description="""A reference to one or more rows in the IntracellularRecordingsTable table.""" + ..., + description="""A reference to one or more rows in the IntracellularRecordingsTable table.""", ) recordings_index: Named[VectorIndex] = Field( ..., description="""Index dataset for the recordings column.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -884,13 +1001,17 @@ class SimultaneousRecordingsTableRecordings(DynamicTableRegion): name: Literal["recordings"] = Field( "recordings", - json_schema_extra={"linkml_meta": {"equals_string": "recordings", "ifabsent": "string(recordings)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "recordings", "ifabsent": "string(recordings)"} + }, ) table: Optional[IntracellularRecordingsTable] = Field( None, description="""Reference to the IntracellularRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""", ) - description: Optional[str] = Field(None, description="""Description of what this table region points to.""") + description: Optional[str] = Field( + None, description="""Description of what this table region points to.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -906,34 +1027,46 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: Literal["sequential_recordings"] = Field( "sequential_recordings", json_schema_extra={ - "linkml_meta": {"equals_string": "sequential_recordings", "ifabsent": "string(sequential_recordings)"} + "linkml_meta": { + "equals_string": "sequential_recordings", + "ifabsent": "string(sequential_recordings)", + } }, ) simultaneous_recordings: SequentialRecordingsTableSimultaneousRecordings = Field( - ..., description="""A reference to one or more rows in the SimultaneousRecordingsTable table.""" + ..., + description="""A reference to one or more rows in the SimultaneousRecordingsTable table.""", ) simultaneous_recordings_index: Named[VectorIndex] = Field( ..., description="""Index dataset for the simultaneous_recordings column.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) stimulus_type: NDArray[Any, str] = Field( ..., description="""The type of stimulus used for the sequential recording.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -954,14 +1087,19 @@ class SequentialRecordingsTableSimultaneousRecordings(DynamicTableRegion): name: Literal["simultaneous_recordings"] = Field( "simultaneous_recordings", json_schema_extra={ - "linkml_meta": {"equals_string": "simultaneous_recordings", "ifabsent": "string(simultaneous_recordings)"} + "linkml_meta": { + "equals_string": "simultaneous_recordings", + "ifabsent": "string(simultaneous_recordings)", + } }, ) table: Optional[SimultaneousRecordingsTable] = Field( None, description="""Reference to the SimultaneousRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""", ) - description: Optional[str] = Field(None, description="""Description of what this table region points to.""") + description: Optional[str] = Field( + None, description="""Description of what this table region points to.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -977,25 +1115,34 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: Literal["repetitions"] = Field( "repetitions", - json_schema_extra={"linkml_meta": {"equals_string": "repetitions", "ifabsent": "string(repetitions)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "repetitions", "ifabsent": "string(repetitions)"} + }, ) sequential_recordings: RepetitionsTableSequentialRecordings = Field( - ..., description="""A reference to one or more rows in the SequentialRecordingsTable table.""" + ..., + description="""A reference to one or more rows in the SequentialRecordingsTable table.""", ) sequential_recordings_index: Named[VectorIndex] = Field( ..., description="""Index dataset for the sequential_recordings column.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -1016,14 +1163,19 @@ class RepetitionsTableSequentialRecordings(DynamicTableRegion): name: Literal["sequential_recordings"] = Field( "sequential_recordings", json_schema_extra={ - "linkml_meta": {"equals_string": "sequential_recordings", "ifabsent": "string(sequential_recordings)"} + "linkml_meta": { + "equals_string": "sequential_recordings", + "ifabsent": "string(sequential_recordings)", + } }, ) table: Optional[SequentialRecordingsTable] = Field( None, description="""Reference to the SequentialRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""", ) - description: Optional[str] = Field(None, description="""Description of what this table region points to.""") + description: Optional[str] = Field( + None, description="""Description of what this table region points to.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -1039,12 +1191,17 @@ class ExperimentalConditionsTable(DynamicTable): A table for grouping different intracellular recording repetitions together that belong to the same experimental condition. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.icephys", "tree_root": True} + ) name: Literal["experimental_conditions"] = Field( "experimental_conditions", json_schema_extra={ - "linkml_meta": {"equals_string": "experimental_conditions", "ifabsent": "string(experimental_conditions)"} + "linkml_meta": { + "equals_string": "experimental_conditions", + "ifabsent": "string(experimental_conditions)", + } }, ) repetitions: ExperimentalConditionsTableRepetitions = Field( @@ -1053,13 +1210,17 @@ class ExperimentalConditionsTable(DynamicTable): repetitions_index: Named[VectorIndex] = Field( ..., description="""Index dataset for the repetitions column.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -1079,13 +1240,17 @@ class ExperimentalConditionsTableRepetitions(DynamicTableRegion): name: Literal["repetitions"] = Field( "repetitions", - json_schema_extra={"linkml_meta": {"equals_string": "repetitions", "ifabsent": "string(repetitions)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "repetitions", "ifabsent": "string(repetitions)"} + }, ) table: Optional[RepetitionsTable] = Field( None, description="""Reference to the RepetitionsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""", ) - description: Optional[str] = Field(None, description="""Description of what this table region points to.""") + description: Optional[str] = Field( + None, description="""Description of what this table region points to.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_image.py index f2e905d..8baa00d 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_image.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_image.py @@ -47,7 +47,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -103,7 +105,9 @@ class GrayscaleImage(Image): A grayscale image. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -124,7 +128,9 @@ class RGBImage(Image): A color image. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -145,7 +151,9 @@ class RGBAImage(Image): A color image with transparency. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) resolution: Optional[np.float32] = Field( @@ -166,14 +174,17 @@ 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]. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) - data: Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] = ( - Field( - ..., - description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", - ) + data: Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] = Field( + ..., + description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -210,7 +221,9 @@ class ImageSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -227,7 +240,9 @@ class ImageSeriesExternalFile(ConfiguredBaseModel): name: Literal["external_file"] = Field( "external_file", - json_schema_extra={"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"} + }, ) starting_frame: Optional[np.int32] = Field( None, @@ -243,14 +258,17 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) - data: Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] = ( - Field( - ..., - description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", - ) + data: Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] = Field( + ..., + description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -287,7 +305,9 @@ class ImageMaskSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -300,15 +320,23 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) - distance: Optional[np.float32] = Field(None, description="""Distance from camera/monitor to target/eye.""") + distance: Optional[np.float32] = Field( + None, description="""Distance from camera/monitor to target/eye.""" + ) field_of_view: Optional[ - Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]] + Union[ + NDArray[Shape["2 width_height"], np.float32], + NDArray[Shape["3 width_height_depth"], np.float32], + ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number] + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number], ] = Field(..., description="""Images presented to subject, either grayscale or RGB""") orientation: Optional[str] = Field( None, @@ -349,7 +377,9 @@ class OpticalSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -362,7 +392,9 @@ class IndexSeries(TimeSeries): Stores indices to image frames stored in an ImageSeries. The purpose of the IndexSeries is to allow a static image stack to be stored in an Images object, 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 Images object, and the timestamps array indicates when that image was displayed. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.image", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.uint32] = Field( @@ -392,7 +424,9 @@ class IndexSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_misc.py index fba035b..fec82a0 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_misc.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_misc.py @@ -8,9 +8,22 @@ import numpy as np from ...core.v2_7_0.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync from ...core.v2_7_0.core_nwb_ecephys import ElectrodeGroup from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape -from ...hdmf_common.v1_8_0.hdmf_common_table import DynamicTableRegion, DynamicTable, VectorData, VectorIndex +from ...hdmf_common.v1_8_0.hdmf_common_table import ( + DynamicTableRegion, + DynamicTable, + VectorData, + VectorIndex, +) metamodel_version = "None" version = "2.7.0" @@ -25,7 +38,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -70,7 +85,12 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "core.nwb.misc/", "id": "core.nwb.misc", - "imports": ["core.nwb.base", "../../hdmf_common/v1_8_0/namespace", "core.nwb.ecephys", "core.nwb.language"], + "imports": [ + "core.nwb.base", + "../../hdmf_common/v1_8_0/namespace", + "core.nwb.ecephys", + "core.nwb.language", + ], "name": "core.nwb.misc", } ) @@ -81,10 +101,14 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) - data: AbstractFeatureSeriesData = Field(..., description="""Values of each feature at each time.""") + data: AbstractFeatureSeriesData = Field( + ..., description="""Values of each feature at each time.""" + ) feature_units: Optional[NDArray[Shape["* num_features"], str]] = Field( None, description="""Units of each feature.""", @@ -117,7 +141,9 @@ class AbstractFeatureSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -133,14 +159,18 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, description="""Since there can be different units for different features, store the units in 'feature_units'. The default value for this attribute is \"see 'feature_units'\".""", ) array: Optional[ - Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]] + Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_features"], np.number], + ] ] = Field(None) @@ -149,7 +179,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], str] = Field( @@ -179,7 +211,9 @@ class AnnotationSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -192,7 +226,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) data: NDArray[Shape["* num_times"], np.int8] = Field( @@ -222,7 +258,9 @@ class IntervalSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -235,15 +273,21 @@ class DecompositionSeries(TimeSeries): Spectral analysis of a time series, e.g. of an LFP or a speech signal. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field(...) - data: DecompositionSeriesData = Field(..., description="""Data decomposed into frequency bands.""") + data: DecompositionSeriesData = Field( + ..., description="""Data decomposed into frequency bands.""" + ) metric: str = Field(..., description="""The metric used, e.g. phase, amplitude, power.""") source_channels: Named[Optional[DynamicTableRegion]] = Field( None, description="""DynamicTableRegion pointer to the channels that this decomposition series was generated from.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) bands: DecompositionSeriesBands = Field( ..., @@ -271,7 +315,9 @@ class DecompositionSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -287,7 +333,8 @@ class DecompositionSeriesData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) unit: Optional[str] = Field( None, @@ -297,7 +344,13 @@ class DecompositionSeriesData(ConfiguredBaseModel): None, json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_times"}, {"alias": "num_channels"}, {"alias": "num_bands"}]} + "array": { + "dimensions": [ + {"alias": "num_times"}, + {"alias": "num_channels"}, + {"alias": "num_bands"}, + ] + } } }, ) @@ -311,13 +364,16 @@ class DecompositionSeriesBands(DynamicTable): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"}) name: Literal["bands"] = Field( - "bands", json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}} + "bands", + json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}}, ) band_name: NDArray[Any, str] = Field( ..., description="""Name of the band, e.g. theta.""", json_schema_extra={ - "linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}} + "linkml_meta": { + "array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1} + } }, ) band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field( @@ -325,7 +381,12 @@ class DecompositionSeriesBands(DynamicTable): description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_bands"}, {"alias": "low_high", "exact_cardinality": 2}]} + "array": { + "dimensions": [ + {"alias": "num_bands"}, + {"alias": "low_high", "exact_cardinality": 2}, + ] + } } }, ) @@ -343,7 +404,9 @@ class DecompositionSeriesBands(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -359,38 +422,55 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.misc", "tree_root": True} + ) name: str = Field("Units", json_schema_extra={"linkml_meta": {"ifabsent": "string(Units)"}}) spike_times_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the spike_times dataset.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, + ) + spike_times: Optional[UnitsSpikeTimes] = Field( + None, description="""Spike times for each unit in seconds.""" ) - spike_times: Optional[UnitsSpikeTimes] = Field(None, description="""Spike times for each unit in seconds.""") obs_intervals_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the obs_intervals dataset.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field( None, description="""Observation intervals for each unit.""", json_schema_extra={ "linkml_meta": { - "array": {"dimensions": [{"alias": "num_intervals"}, {"alias": "start_end", "exact_cardinality": 2}]} + "array": { + "dimensions": [ + {"alias": "num_intervals"}, + {"alias": "start_end", "exact_cardinality": 2}, + ] + } } }, ) electrodes_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into electrodes.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) electrodes: Named[Optional[DynamicTableRegion]] = Field( None, description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) electrode_group: Optional[List[ElectrodeGroup]] = Field( None, description="""Electrode group that each spike unit came from.""" @@ -411,24 +491,32 @@ class Units(DynamicTable): None, description="""Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same.""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "num_waveforms"}, {"alias": "num_samples"}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "num_waveforms"}, {"alias": "num_samples"}]} + } }, ) waveforms_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the waveforms dataset. One value for every spike event. See 'waveforms' for more detail.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) waveforms_index_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into the waveforms_index dataset. One value for every unit (row in the table). See 'waveforms' for more detail.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -448,13 +536,17 @@ class UnitsSpikeTimes(VectorData): name: Literal["spike_times"] = Field( "spike_times", - json_schema_extra={"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"} + }, ) resolution: Optional[np.float64] = Field( None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""", ) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ogen.py index a7a3779..4cf34de 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ogen.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ogen.py @@ -8,7 +8,12 @@ from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator import numpy as np from numpydantic import NDArray, Shape -from ...core.v2_7_0.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync, NWBContainer +from ...core.v2_7_0.core_nwb_base import ( + TimeSeries, + TimeSeriesStartingTime, + TimeSeriesSync, + NWBContainer, +) metamodel_version = "None" version = "2.7.0" @@ -23,7 +28,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,10 +86,15 @@ class OptogeneticSeries(TimeSeries): An optogenetic stimulus. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ogen", "tree_root": True} + ) name: str = Field(...) - data: Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_rois"], np.number]] = Field( + data: Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_rois"], np.number], + ] = Field( ..., description="""Applied power for optogenetic stimulus, in watts. Shape can be 1D or 2D. 2D data is meant to be used in an extension of OptogeneticSeries that defines what the second dimension represents.""", ) @@ -108,7 +120,9 @@ class OptogeneticSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -121,7 +135,9 @@ class OptogeneticStimulusSite(NWBContainer): A site of optogenetic stimulation. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ogen", "tree_root": True} + ) name: str = Field(...) description: str = Field(..., description="""Description of stimulation site.""") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ophys.py index 5e52571..a8777ed 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ophys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ophys.py @@ -41,7 +41,15 @@ from ...core.v2_7_0.core_nwb_image import ( IndexSeries, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + RootModel, + field_validator, + ValidationInfo, + BeforeValidator, +) from numpydantic import NDArray, Shape metamodel_version = "None" @@ -57,7 +65,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -119,7 +129,9 @@ class OnePhotonSeries(ImageSeries): Image stack recorded over time from 1-photon microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") @@ -133,13 +145,18 @@ class OnePhotonSeries(ImageSeries): binning: Optional[np.uint8] = Field( None, description="""Amount of pixels combined into 'bins'; could be 1, 2, 4, 8, etc.""" ) - power: Optional[np.float32] = Field(None, description="""Power of the excitation in mW, if known.""") - intensity: Optional[np.float32] = Field(None, description="""Intensity of the excitation in mW/mm^2, if known.""") - data: Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] = ( - Field( - ..., - description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", - ) + power: Optional[np.float32] = Field( + None, description="""Power of the excitation in mW, if known.""" + ) + intensity: Optional[np.float32] = Field( + None, description="""Intensity of the excitation in mW/mm^2, if known.""" + ) + data: Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] = Field( + ..., + description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -176,7 +193,9 @@ class OnePhotonSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -189,7 +208,9 @@ class TwoPhotonSeries(ImageSeries): Image stack recorded over time from 2-photon microscope. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") @@ -198,13 +219,17 @@ class TwoPhotonSeries(ImageSeries): description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) field_of_view: Optional[ - Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]] + Union[ + NDArray[Shape["2 width_height"], np.float32], + NDArray[Shape["3 width_height_depth"], np.float32], + ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") - data: Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]] = ( - Field( - ..., - description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", - ) + data: Union[ + NDArray[Shape["* frame, * x, * y"], np.number], + NDArray[Shape["* frame, * x, * y, * z"], np.number], + ] = Field( + ..., + description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( None, @@ -241,7 +266,9 @@ class TwoPhotonSeries(ImageSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -254,16 +281,21 @@ class RoiResponseSeries(TimeSeries): ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) - data: Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_rois"], np.number]] = Field( - ..., description="""Signals from ROIs.""" - ) + data: Union[ + NDArray[Shape["* num_times"], np.number], + NDArray[Shape["* num_times, * num_rois"], np.number], + ] = Field(..., description="""Signals from ROIs.""") rois: Named[DynamicTableRegion] = Field( ..., description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) description: Optional[str] = Field(None, description="""Description of the time series.""") comments: Optional[str] = Field( @@ -287,7 +319,9 @@ class RoiResponseSeries(TimeSeries): control_description: Optional[NDArray[Shape["* num_control_values"], str]] = Field( None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}} + }, ) sync: Optional[TimeSeriesSync] = Field( None, @@ -300,7 +334,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[RoiResponseSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}} @@ -313,7 +349,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[RoiResponseSeries]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}} @@ -326,7 +364,9 @@ 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. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[PlaneSegmentation]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "PlaneSegmentation"}]}} @@ -339,7 +379,9 @@ class PlaneSegmentation(DynamicTable): Results from image segmentation of a specific imaging plane. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) image_mask: Optional[PlaneSegmentationImageMask] = Field( @@ -349,7 +391,9 @@ class PlaneSegmentation(DynamicTable): pixel_mask_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into pixel_mask.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) pixel_mask: Optional[PlaneSegmentationPixelMask] = Field( None, @@ -358,7 +402,9 @@ class PlaneSegmentation(DynamicTable): voxel_mask_index: Named[Optional[VectorIndex]] = Field( None, description="""Index into voxel_mask.""", - json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}}, + json_schema_extra={ + "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} + }, ) voxel_mask: Optional[PlaneSegmentationVoxelMask] = Field( None, @@ -373,7 +419,9 @@ class PlaneSegmentation(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -393,9 +441,13 @@ class PlaneSegmentationImageMask(VectorData): name: Literal["image_mask"] = Field( "image_mask", - json_schema_extra={"linkml_meta": {"equals_string": "image_mask", "ifabsent": "string(image_mask)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "image_mask", "ifabsent": "string(image_mask)"} + }, + ) + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" ) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -415,12 +467,16 @@ class PlaneSegmentationPixelMask(VectorData): name: Literal["pixel_mask"] = Field( "pixel_mask", - json_schema_extra={"linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"} + }, ) x: Optional[np.uint32] = Field(None, description="""Pixel x-coordinate.""") y: Optional[np.uint32] = Field(None, description="""Pixel y-coordinate.""") weight: Optional[np.float32] = Field(None, description="""Weight of the pixel.""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -440,13 +496,17 @@ class PlaneSegmentationVoxelMask(VectorData): name: Literal["voxel_mask"] = Field( "voxel_mask", - json_schema_extra={"linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"} + }, ) x: Optional[np.uint32] = Field(None, description="""Voxel x-coordinate.""") y: Optional[np.uint32] = Field(None, description="""Voxel y-coordinate.""") z: Optional[np.uint32] = Field(None, description="""Voxel z-coordinate.""") weight: Optional[np.float32] = Field(None, description="""Weight of the voxel.""") - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -462,7 +522,9 @@ class ImagingPlane(NWBContainer): An imaging plane and its metadata. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[OpticalChannel]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "OpticalChannel"}]}} @@ -475,11 +537,15 @@ class OpticalChannel(NWBContainer): An optical channel used to record from an imaging plane. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) description: str = Field(..., description="""Description or other notes about the channel.""") - emission_lambda: np.float32 = Field(..., description="""Emission wavelength for channel, in nm.""") + emission_lambda: np.float32 = Field( + ..., description="""Emission wavelength for channel, in nm.""" + ) class MotionCorrection(NWBDataInterface): @@ -487,7 +553,9 @@ 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). """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) children: Optional[List[CorrectedImageStack]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "CorrectedImageStack"}]}} @@ -500,10 +568,14 @@ class CorrectedImageStack(NWBDataInterface): Results from motion correction of an image stack. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.ophys", "tree_root": True} + ) name: str = Field(...) - corrected: ImageSeries = Field(..., description="""Image stack with frames shifted to the common coordinates.""") + corrected: ImageSeries = Field( + ..., description="""Image stack with frames shifted to the common coordinates.""" + ) xy_translation: TimeSeries = Field( ..., 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.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_retinotopy.py index 987d3ff..b490866 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_retinotopy.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_retinotopy.py @@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,9 +81,14 @@ class ImagingRetinotopy(NWBDataInterface): DEPRECATED. 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[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "core.nwb.retinotopy", "tree_root": True} + ) - name: str = Field("ImagingRetinotopy", json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}}) + name: str = Field( + "ImagingRetinotopy", + json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}}, + ) axis_1_phase_map: ImagingRetinotopyAxis1PhaseMap = Field( ..., description="""Phase response to stimulus on the first measured axis.""" ) @@ -100,7 +107,9 @@ class ImagingRetinotopy(NWBDataInterface): ..., description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""", json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]}} + "linkml_meta": { + "array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]} + } }, ) focal_depth_image: Optional[ImagingRetinotopyFocalDepthImage] = Field( @@ -108,10 +117,12 @@ class ImagingRetinotopy(NWBDataInterface): description="""Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].""", ) sign_map: Optional[ImagingRetinotopySignMap] = Field( - None, description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""" + None, + description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""", ) vasculature_image: ImagingRetinotopyVasculatureImage = Field( - ..., description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""" + ..., + description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""", ) @@ -125,18 +136,27 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): name: Literal["axis_1_phase_map"] = Field( "axis_1_phase_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_1_phase_map", "ifabsent": "string(axis_1_phase_map)"} + "linkml_meta": { + "equals_string": "axis_1_phase_map", + "ifabsent": "string(axis_1_phase_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -150,18 +170,27 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): name: Literal["axis_1_power_map"] = Field( "axis_1_power_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_1_power_map", "ifabsent": "string(axis_1_power_map)"} + "linkml_meta": { + "equals_string": "axis_1_power_map", + "ifabsent": "string(axis_1_power_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -175,18 +204,27 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): name: Literal["axis_2_phase_map"] = Field( "axis_2_phase_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_2_phase_map", "ifabsent": "string(axis_2_phase_map)"} + "linkml_meta": { + "equals_string": "axis_2_phase_map", + "ifabsent": "string(axis_2_phase_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -200,18 +238,27 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): name: Literal["axis_2_power_map"] = Field( "axis_2_power_map", json_schema_extra={ - "linkml_meta": {"equals_string": "axis_2_power_map", "ifabsent": "string(axis_2_power_map)"} + "linkml_meta": { + "equals_string": "axis_2_power_map", + "ifabsent": "string(axis_2_power_map)", + } }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + unit: Optional[str] = Field( + None, description="""Unit that axis data is stored in (e.g., degrees).""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -225,7 +272,10 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): name: Literal["focal_depth_image"] = Field( "focal_depth_image", json_schema_extra={ - "linkml_meta": {"equals_string": "focal_depth_image", "ifabsent": "string(focal_depth_image)"} + "linkml_meta": { + "equals_string": "focal_depth_image", + "ifabsent": "string(focal_depth_image)", + } }, ) bits_per_pixel: Optional[np.int32] = Field( @@ -236,12 +286,20 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - focal_depth: Optional[np.float32] = Field(None, description="""Focal depth offset, in meters.""") - format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + focal_depth: Optional[np.float32] = Field( + None, description="""Focal depth offset, in meters.""" + ) + format: Optional[str] = Field( + None, description="""Format of image. Right now only 'raw' is supported.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -253,16 +311,23 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy"}) name: Literal["sign_map"] = Field( - "sign_map", json_schema_extra={"linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"}} + "sign_map", + json_schema_extra={ + "linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"} + }, ) dimension: Optional[np.int32] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) @@ -276,7 +341,10 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): name: Literal["vasculature_image"] = Field( "vasculature_image", json_schema_extra={ - "linkml_meta": {"equals_string": "vasculature_image", "ifabsent": "string(vasculature_image)"} + "linkml_meta": { + "equals_string": "vasculature_image", + "ifabsent": "string(vasculature_image)", + } }, ) bits_per_pixel: Optional[np.int32] = Field( @@ -287,11 +355,17 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""") - format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""") + field_of_view: Optional[np.float32] = Field( + None, description="""Size of viewing area, in meters.""" + ) + format: Optional[str] = Field( + None, description="""Format of image. Right now only 'raw' is supported.""" + ) array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( None, - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} + }, ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/namespace.py index de09be8..b347afb 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/namespace.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/namespace.py @@ -176,7 +176,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/__init__.py index 8d1c8b6..8b13789 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/__init__.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/__init__.py @@ -1 +1 @@ - + diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/hdmf_common_sparse.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/hdmf_common_sparse.py index 6c5ac2e..2ba56a5 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/hdmf_common_sparse.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/hdmf_common_sparse.py @@ -21,7 +21,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -61,7 +63,9 @@ class CSRMatrix(ConfiguredBaseModel): a compressed sparse row matrix """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.sparse", "tree_root": True} + ) name: str = Field(...) shape: Optional[int] = Field(None, description="""the shape of this sparse matrix""") @@ -78,7 +82,10 @@ class CSRMatrixIndices(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) name: Literal["indices"] = Field( - "indices", json_schema_extra={"linkml_meta": {"equals_string": "indices", "ifabsent": "string(indices)"}} + "indices", + json_schema_extra={ + "linkml_meta": {"equals_string": "indices", "ifabsent": "string(indices)"} + }, ) @@ -90,7 +97,10 @@ class CSRMatrixIndptr(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) name: Literal["indptr"] = Field( - "indptr", json_schema_extra={"linkml_meta": {"equals_string": "indptr", "ifabsent": "string(indptr)"}} + "indptr", + json_schema_extra={ + "linkml_meta": {"equals_string": "indptr", "ifabsent": "string(indptr)"} + }, ) @@ -102,7 +112,8 @@ class CSRMatrixData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/hdmf_common_table.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/hdmf_common_table.py index d5c01bd..ffd4424 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/hdmf_common_table.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/hdmf_common_table.py @@ -22,7 +22,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -63,7 +65,9 @@ class Data(ConfiguredBaseModel): An abstract data type for a dataset. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) @@ -73,10 +77,14 @@ class Index(Data): Pointers that index data values. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) - target: Optional[Data] = Field(None, description="""Target dataset that this index applies to.""") + target: Optional[Data] = Field( + None, description="""Target dataset that this index applies to.""" + ) class VectorData(Data): @@ -84,10 +92,14 @@ class VectorData(Data): An n-dimensional dataset representing a column of a DynamicTable. If used without an accompanying VectorIndex, first dimension is along the rows of the DynamicTable and each step along the first dimension is a cell of the larger table. VectorData can also be used to represent a ragged array if paired with a VectorIndex. This allows for storing arrays of varying length in a single cell of the DynamicTable by indexing into this VectorData. The first vector is at VectorData[0:VectorIndex(0)+1]. The second vector is at VectorData[VectorIndex(0)+1:VectorIndex(1)+1], and so on. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) class VectorIndex(Index): @@ -95,7 +107,9 @@ class VectorIndex(Index): Used with VectorData to encode a ragged array. An array of indices into the first dimension of the target VectorData, and forming a map between the rows of a DynamicTable and the indices of the VectorData. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) target: Optional[VectorData] = Field( @@ -108,9 +122,13 @@ class ElementIdentifiers(Data): A list of unique identifiers for values within a dataset, e.g. rows of a DynamicTable. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) - name: str = Field("element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}}) + name: str = Field( + "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} + ) class DynamicTableRegion(VectorData): @@ -118,13 +136,17 @@ class DynamicTableRegion(VectorData): DynamicTableRegion provides a link from one table to an index or region of another. The `table` attribute is a link to another `DynamicTable`, indicating which table is referenced, and the data is int(s) indicating the row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to associate rows with repeated meta-data without data duplication. They can also be used to create hierarchical relationships between multiple `DynamicTable`s. `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create ragged references, so a single cell of a `DynamicTable` can reference many rows of another `DynamicTable`. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) table: Optional[DynamicTable] = Field( None, description="""Reference to the DynamicTable object that this region applies to.""" ) - description: Optional[str] = Field(None, description="""Description of what this table region points to.""") + description: Optional[str] = Field( + None, description="""Description of what this table region points to.""" + ) class Container(ConfiguredBaseModel): @@ -132,7 +154,9 @@ class Container(ConfiguredBaseModel): 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[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) @@ -142,20 +166,26 @@ class DynamicTable(Container): A group containing multiple datasets that are aligned on the first dimension (Currently, this requirement if left up to APIs to check and enforce). Apart from a column that contains unique identifiers for each row there are no other required datasets. Users are free to add any number of VectorData objects here. Table functionality is already supported through compound types, which is analogous to storing an array-of-structs. DynamicTable can be thought of as a struct-of-arrays. This provides an alternative structure to choose from when optimizing storage for anticipated access patterns. Additionally, this type provides a way of creating a table without having to define a compound type up front. Although this convenience may be attractive, users should think carefully about how data will be accessed. DynamicTable is more appropriate for column-centric access, whereas a dataset with a compound type would be more appropriate for row-centric access. Finally, data size should also be taken into account. For small tables, performance loss may be an acceptable trade-off for the flexibility of a DynamicTable. For example, DynamicTable was originally developed for storing trial data and spike unit metadata. Both of these use cases are expected to produce relatively small tables, so the spatial locality of multiple datasets present in a DynamicTable is not expected to have a significant performance impact. Additionally, requirements of trial and unit metadata tables are sufficiently diverse that performance implications can be overlooked in favor of usability. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/namespace.py index 2d80d28..703fefe 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/namespace.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/namespace.py @@ -7,7 +7,12 @@ import sys from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator import numpy as np -from ...hdmf_common.v1_1_0.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_0.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_0.hdmf_common_table import ( Data, Index, @@ -32,7 +37,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/__init__.py index 8d1c8b6..8b13789 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/__init__.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/__init__.py @@ -1 +1 @@ - + diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/hdmf_common_sparse.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/hdmf_common_sparse.py index e91e174..32401a4 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/hdmf_common_sparse.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/hdmf_common_sparse.py @@ -21,7 +21,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -61,7 +63,9 @@ class CSRMatrix(ConfiguredBaseModel): a compressed sparse row matrix """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.sparse", "tree_root": True} + ) name: str = Field(...) shape: Optional[int] = Field(None, description="""the shape of this sparse matrix""") @@ -78,7 +82,10 @@ class CSRMatrixIndices(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) name: Literal["indices"] = Field( - "indices", json_schema_extra={"linkml_meta": {"equals_string": "indices", "ifabsent": "string(indices)"}} + "indices", + json_schema_extra={ + "linkml_meta": {"equals_string": "indices", "ifabsent": "string(indices)"} + }, ) @@ -90,7 +97,10 @@ class CSRMatrixIndptr(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) name: Literal["indptr"] = Field( - "indptr", json_schema_extra={"linkml_meta": {"equals_string": "indptr", "ifabsent": "string(indptr)"}} + "indptr", + json_schema_extra={ + "linkml_meta": {"equals_string": "indptr", "ifabsent": "string(indptr)"} + }, ) @@ -102,7 +112,8 @@ class CSRMatrixData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/hdmf_common_table.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/hdmf_common_table.py index d152fb1..e252a50 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/hdmf_common_table.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/hdmf_common_table.py @@ -22,7 +22,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -78,7 +80,9 @@ class Data(ConfiguredBaseModel): An abstract data type for a dataset. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) @@ -88,10 +92,14 @@ class Index(Data): Pointers that index data values. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) - target: Optional[Data] = Field(None, description="""Target dataset that this index applies to.""") + target: Optional[Data] = Field( + None, description="""Target dataset that this index applies to.""" + ) class VectorData(Data): @@ -99,10 +107,14 @@ class VectorData(Data): An n-dimensional dataset representing a column of a DynamicTable. If used without an accompanying VectorIndex, first dimension is along the rows of the DynamicTable and each step along the first dimension is a cell of the larger table. VectorData can also be used to represent a ragged array if paired with a VectorIndex. This allows for storing arrays of varying length in a single cell of the DynamicTable by indexing into this VectorData. The first vector is at VectorData[0:VectorIndex(0)+1]. The second vector is at VectorData[VectorIndex(0)+1:VectorIndex(1)+1], and so on. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) class VectorIndex(Index): @@ -110,7 +122,9 @@ class VectorIndex(Index): Used with VectorData to encode a ragged array. An array of indices into the first dimension of the target VectorData, and forming a map between the rows of a DynamicTable and the indices of the VectorData. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) target: Optional[VectorData] = Field( @@ -123,9 +137,13 @@ class ElementIdentifiers(Data): A list of unique identifiers for values within a dataset, e.g. rows of a DynamicTable. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) - name: str = Field("element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}}) + name: str = Field( + "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} + ) class DynamicTableRegion(VectorData): @@ -133,13 +151,17 @@ class DynamicTableRegion(VectorData): DynamicTableRegion provides a link from one table to an index or region of another. The `table` attribute is a link to another `DynamicTable`, indicating which table is referenced, and the data is int(s) indicating the row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to associate rows with repeated meta-data without data duplication. They can also be used to create hierarchical relationships between multiple `DynamicTable`s. `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create ragged references, so a single cell of a `DynamicTable` can reference many rows of another `DynamicTable`. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) table: Optional[DynamicTable] = Field( None, description="""Reference to the DynamicTable object that this region applies to.""" ) - description: Optional[str] = Field(None, description="""Description of what this table region points to.""") + description: Optional[str] = Field( + None, description="""Description of what this table region points to.""" + ) class Container(ConfiguredBaseModel): @@ -147,7 +169,9 @@ class Container(ConfiguredBaseModel): 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[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) @@ -157,20 +181,26 @@ class DynamicTable(Container): A group containing multiple datasets that are aligned on the first dimension (Currently, this requirement if left up to APIs to check and enforce). Apart from a column that contains unique identifiers for each row there are no other required datasets. Users are free to add any number of VectorData objects here. Table functionality is already supported through compound types, which is analogous to storing an array-of-structs. DynamicTable can be thought of as a struct-of-arrays. This provides an alternative structure to choose from when optimizing storage for anticipated access patterns. Additionally, this type provides a way of creating a table without having to define a compound type up front. Although this convenience may be attractive, users should think carefully about how data will be accessed. DynamicTable is more appropriate for column-centric access, whereas a dataset with a compound type would be more appropriate for row-centric access. Finally, data size should also be taken into account. For small tables, performance loss may be an acceptable trade-off for the flexibility of a DynamicTable. For example, DynamicTable was originally developed for storing trial data and spike unit metadata. Both of these use cases are expected to produce relatively small tables, so the spatial locality of multiple datasets present in a DynamicTable is not expected to have a significant performance impact. Additionally, requirements of trial and unit metadata tables are sufficiently diverse that performance implications can be overlooked in favor of usability. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/namespace.py index f2f3729..a9507d4 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/namespace.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/namespace.py @@ -7,7 +7,12 @@ import sys from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator import numpy as np -from ...hdmf_common.v1_1_2.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_2.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_2.hdmf_common_table import ( Data, Index, @@ -32,7 +37,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/__init__.py index 8d1c8b6..8b13789 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/__init__.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/__init__.py @@ -1 +1 @@ - + diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/hdmf_common_sparse.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/hdmf_common_sparse.py index 6431a9d..872d645 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/hdmf_common_sparse.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/hdmf_common_sparse.py @@ -21,7 +21,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -61,7 +63,9 @@ class CSRMatrix(ConfiguredBaseModel): a compressed sparse row matrix """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.sparse", "tree_root": True} + ) name: str = Field(...) shape: Optional[int] = Field(None, description="""the shape of this sparse matrix""") @@ -78,7 +82,10 @@ class CSRMatrixIndices(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) name: Literal["indices"] = Field( - "indices", json_schema_extra={"linkml_meta": {"equals_string": "indices", "ifabsent": "string(indices)"}} + "indices", + json_schema_extra={ + "linkml_meta": {"equals_string": "indices", "ifabsent": "string(indices)"} + }, ) @@ -90,7 +97,10 @@ class CSRMatrixIndptr(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) name: Literal["indptr"] = Field( - "indptr", json_schema_extra={"linkml_meta": {"equals_string": "indptr", "ifabsent": "string(indptr)"}} + "indptr", + json_schema_extra={ + "linkml_meta": {"equals_string": "indptr", "ifabsent": "string(indptr)"} + }, ) @@ -102,7 +112,8 @@ class CSRMatrixData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/hdmf_common_table.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/hdmf_common_table.py index 3e49ac2..4d962bd 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/hdmf_common_table.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/hdmf_common_table.py @@ -22,7 +22,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -78,7 +80,9 @@ class Data(ConfiguredBaseModel): An abstract data type for a dataset. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) @@ -88,10 +92,14 @@ class Index(Data): Pointers that index data values. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) - target: Optional[Data] = Field(None, description="""Target dataset that this index applies to.""") + target: Optional[Data] = Field( + None, description="""Target dataset that this index applies to.""" + ) class VectorData(Data): @@ -99,10 +107,14 @@ class VectorData(Data): An n-dimensional dataset representing a column of a DynamicTable. If used without an accompanying VectorIndex, first dimension is along the rows of the DynamicTable and each step along the first dimension is a cell of the larger table. VectorData can also be used to represent a ragged array if paired with a VectorIndex. This allows for storing arrays of varying length in a single cell of the DynamicTable by indexing into this VectorData. The first vector is at VectorData[0:VectorIndex(0)+1]. The second vector is at VectorData[VectorIndex(0)+1:VectorIndex(1)+1], and so on. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -118,7 +130,9 @@ class VectorIndex(Index): Used with VectorData to encode a ragged array. An array of indices into the first dimension of the target VectorData, and forming a map between the rows of a DynamicTable and the indices of the VectorData. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) target: Optional[VectorData] = Field( @@ -134,9 +148,13 @@ class ElementIdentifiers(Data): A list of unique identifiers for values within a dataset, e.g. rows of a DynamicTable. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) - name: str = Field("element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}}) + name: str = Field( + "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} + ) class DynamicTableRegion(VectorData): @@ -144,13 +162,17 @@ class DynamicTableRegion(VectorData): DynamicTableRegion provides a link from one table to an index or region of another. The `table` attribute is a link to another `DynamicTable`, indicating which table is referenced, and the data is int(s) indicating the row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to associate rows with repeated meta-data without data duplication. They can also be used to create hierarchical relationships between multiple `DynamicTable`s. `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create ragged references, so a single cell of a `DynamicTable` can reference many rows of another `DynamicTable`. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) table: Optional[DynamicTable] = Field( None, description="""Reference to the DynamicTable object that this region applies to.""" ) - description: Optional[str] = Field(None, description="""Description of what this table region points to.""") + description: Optional[str] = Field( + None, description="""Description of what this table region points to.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -166,7 +188,9 @@ class Container(ConfiguredBaseModel): 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[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) @@ -176,20 +200,26 @@ class DynamicTable(Container): A group containing multiple datasets that are aligned on the first dimension (Currently, this requirement if left up to APIs to check and enforce). Apart from a column that contains unique identifiers for each row there are no other required datasets. Users are free to add any number of VectorData objects here. Table functionality is already supported through compound types, which is analogous to storing an array-of-structs. DynamicTable can be thought of as a struct-of-arrays. This provides an alternative structure to choose from when optimizing storage for anticipated access patterns. Additionally, this type provides a way of creating a table without having to define a compound type up front. Although this convenience may be attractive, users should think carefully about how data will be accessed. DynamicTable is more appropriate for column-centric access, whereas a dataset with a compound type would be more appropriate for row-centric access. Finally, data size should also be taken into account. For small tables, performance loss may be an acceptable trade-off for the flexibility of a DynamicTable. For example, DynamicTable was originally developed for storing trial data and spike unit metadata. Both of these use cases are expected to produce relatively small tables, so the spatial locality of multiple datasets present in a DynamicTable is not expected to have a significant performance impact. Additionally, requirements of trial and unit metadata tables are sufficiently diverse that performance implications can be overlooked in favor of usability. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, ) - vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""") + vector_data: Optional[List[VectorData]] = Field( + None, description="""Vector columns of this dynamic table.""" + ) vector_index: Optional[List[VectorIndex]] = Field( None, description="""Indices for the vector columns of this dynamic table.""" ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/namespace.py index 0add7c6..e8dac61 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/namespace.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/namespace.py @@ -7,7 +7,12 @@ import sys from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator import numpy as np -from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix, + CSRMatrixIndices, + CSRMatrixIndptr, + CSRMatrixData, +) from ...hdmf_common.v1_1_3.hdmf_common_table import ( Data, Index, @@ -32,7 +37,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/__init__.py index 8d1c8b6..8b13789 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/__init__.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/__init__.py @@ -1 +1 @@ - + diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_base.py index 3a77371..078665b 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_base.py @@ -21,7 +21,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -61,7 +63,9 @@ class Data(ConfiguredBaseModel): An abstract data type for a dataset. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.base", "tree_root": True} + ) name: str = Field(...) @@ -71,7 +75,9 @@ class Container(ConfiguredBaseModel): An abstract data type for a group storing collections of data and metadata. Base type for all data and metadata containers. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.base", "tree_root": True} + ) name: str = Field(...) @@ -81,7 +87,9 @@ class SimpleMultiContainer(Container): A simple Container for holding onto multiple containers. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.base", "tree_root": True} + ) children: Optional[List[Container]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "Container"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_sparse.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_sparse.py index 1a98f71..d2aa6c8 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_sparse.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_sparse.py @@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,7 +81,9 @@ class CSRMatrix(Container): A compressed sparse row matrix. Data are stored in the standard CSR format, where column indices for row i are stored in indices[indptr[i]:indptr[i+1]] and their corresponding values are stored in data[indptr[i]:indptr[i+1]]. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.sparse", "tree_root": True} + ) name: str = Field(...) shape: Optional[np.uint64] = Field( @@ -88,12 +92,16 @@ class CSRMatrix(Container): indices: NDArray[Shape["* number_of_non_zero_values"], np.uint64] = Field( ..., description="""The column indices.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "number_of_non_zero_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "number_of_non_zero_values"}]}} + }, ) indptr: NDArray[Shape["* number_of_rows_in_the_matrix_1"], np.uint64] = Field( ..., description="""The row index pointer.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "number_of_rows_in_the_matrix_1"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "number_of_rows_in_the_matrix_1"}]}} + }, ) data: CSRMatrixData = Field(..., description="""The non-zero values in the matrix.""") @@ -106,7 +114,8 @@ class CSRMatrixData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_table.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_table.py index 10f975a..d43ac03 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_table.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_table.py @@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,10 +81,14 @@ class VectorData(Data): An n-dimensional dataset representing a column of a DynamicTable. If used without an accompanying VectorIndex, first dimension is along the rows of the DynamicTable and each step along the first dimension is a cell of the larger table. VectorData can also be used to represent a ragged array if paired with a VectorIndex. This allows for storing arrays of varying length in a single cell of the DynamicTable by indexing into this VectorData. The first vector is at VectorData[0:VectorIndex[0]]. The second vector is at VectorData[VectorIndex[0]:VectorIndex[1]], and so on. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -98,13 +104,17 @@ class VectorIndex(VectorData): Used with VectorData to encode a ragged array. An array of indices into the first dimension of the target VectorData, and forming a map between the rows of a DynamicTable and the indices of the VectorData. The name of the VectorIndex is expected to be the name of the target VectorData object followed by \"_index\". """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) target: Optional[VectorData] = Field( None, description="""Reference to the target dataset that this index applies to.""" ) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -120,9 +130,13 @@ class ElementIdentifiers(Data): A list of unique identifiers for values within a dataset, e.g. rows of a DynamicTable. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) - name: str = Field("element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}}) + name: str = Field( + "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} + ) class DynamicTableRegion(VectorData): @@ -130,13 +144,17 @@ class DynamicTableRegion(VectorData): DynamicTableRegion provides a link from one table to an index or region of another. The `table` attribute is a link to another `DynamicTable`, indicating which table is referenced, and the data is int(s) indicating the row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to associate rows with repeated meta-data without data duplication. They can also be used to create hierarchical relationships between multiple `DynamicTable`s. `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create ragged references, so a single cell of a `DynamicTable` can reference many rows of another `DynamicTable`. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) table: Optional[DynamicTable] = Field( None, description="""Reference to the DynamicTable object that this region applies to.""" ) - description: Optional[str] = Field(None, description="""Description of what this table region points to.""") + description: Optional[str] = Field( + None, description="""Description of what this table region points to.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -152,14 +170,18 @@ class DynamicTable(Container): A group containing multiple datasets that are aligned on the first dimension (Currently, this requirement if left up to APIs to check and enforce). These datasets represent different columns in the table. Apart from a column that contains unique identifiers for each row, there are no other required datasets. Users are free to add any number of custom VectorData objects (columns) here. DynamicTable also supports ragged array columns, where each element can be of a different size. To add a ragged array column, use a VectorIndex type to index the corresponding VectorData type. See documentation for VectorData and VectorIndex for more details. Unlike a compound data type, which is analogous to storing an array-of-structs, a DynamicTable can be thought of as a struct-of-arrays. This provides an alternative structure to choose from when optimizing storage for anticipated access patterns. Additionally, this type provides a way of creating a table without having to define a compound type up front. Although this convenience may be attractive, users should think carefully about how data will be accessed. DynamicTable is more appropriate for column-centric access, whereas a dataset with a compound type would be more appropriate for row-centric access. Finally, data size should also be taken into account. For small tables, performance loss may be an acceptable trade-off for the flexibility of a DynamicTable. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -175,7 +197,9 @@ class AlignedDynamicTable(DynamicTable): DynamicTable container that supports storing a collection of sub-tables. Each sub-table is a DynamicTable itself that is aligned with the main table by row index. I.e., all DynamicTables stored in this group MUST have the same number of rows. This type effectively defines a 2-level table in which the main data is stored in the main table implemented by this type and additional columns of the table are grouped into categories, with each category being represented by a separate DynamicTable stored within the group. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) children: Optional[List[DynamicTable]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "DynamicTable"}]}} @@ -185,7 +209,9 @@ class AlignedDynamicTable(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/namespace.py index 7f54ad2..b9cf9ac 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/namespace.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/namespace.py @@ -31,7 +31,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -61,7 +63,12 @@ linkml_meta = LinkMLMeta( "default_prefix": "hdmf-common/", "description": "Common data structures provided by HDMF", "id": "hdmf-common", - "imports": ["hdmf-common.base", "hdmf-common.table", "hdmf-common.sparse", "hdmf-common.nwb.language"], + "imports": [ + "hdmf-common.base", + "hdmf-common.table", + "hdmf-common.sparse", + "hdmf-common.nwb.language", + ], "name": "hdmf-common", } ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/__init__.py index 8d1c8b6..8b13789 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/__init__.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/__init__.py @@ -1 +1 @@ - + diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/hdmf_common_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/hdmf_common_base.py index 05fd3b0..93ec4a2 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/hdmf_common_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/hdmf_common_base.py @@ -21,7 +21,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -61,7 +63,9 @@ class Data(ConfiguredBaseModel): An abstract data type for a dataset. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.base", "tree_root": True} + ) name: str = Field(...) @@ -71,7 +75,9 @@ class Container(ConfiguredBaseModel): An abstract data type for a group storing collections of data and metadata. Base type for all data and metadata containers. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.base", "tree_root": True} + ) name: str = Field(...) @@ -81,7 +87,9 @@ class SimpleMultiContainer(Container): A simple Container for holding onto multiple containers. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.base", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.base", "tree_root": True} + ) children: Optional[List[Container]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "Container"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/hdmf_common_sparse.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/hdmf_common_sparse.py index ac904bf..ea89600 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/hdmf_common_sparse.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/hdmf_common_sparse.py @@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,7 +81,9 @@ class CSRMatrix(Container): A compressed sparse row matrix. Data are stored in the standard CSR format, where column indices for row i are stored in indices[indptr[i]:indptr[i+1]] and their corresponding values are stored in data[indptr[i]:indptr[i+1]]. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.sparse", "tree_root": True} + ) name: str = Field(...) shape: Optional[np.uint64] = Field( @@ -88,12 +92,16 @@ class CSRMatrix(Container): indices: NDArray[Shape["* number_of_non_zero_values"], np.uint64] = Field( ..., description="""The column indices.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "number_of_non_zero_values"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "number_of_non_zero_values"}]}} + }, ) indptr: NDArray[Shape["* number_of_rows_in_the_matrix_1"], np.uint64] = Field( ..., description="""The row index pointer.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "number_of_rows_in_the_matrix_1"}]}}}, + json_schema_extra={ + "linkml_meta": {"array": {"dimensions": [{"alias": "number_of_rows_in_the_matrix_1"}]}} + }, ) data: CSRMatrixData = Field(..., description="""The non-zero values in the matrix.""") @@ -106,7 +114,8 @@ class CSRMatrixData(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) name: Literal["data"] = Field( - "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}} + "data", + json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/hdmf_common_table.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/hdmf_common_table.py index 8d0c5c5..efff5ec 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/hdmf_common_table.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/hdmf_common_table.py @@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -79,10 +81,14 @@ class VectorData(Data): An n-dimensional dataset representing a column of a DynamicTable. If used without an accompanying VectorIndex, first dimension is along the rows of the DynamicTable and each step along the first dimension is a cell of the larger table. VectorData can also be used to represent a ragged array if paired with a VectorIndex. This allows for storing arrays of varying length in a single cell of the DynamicTable by indexing into this VectorData. The first vector is at VectorData[0:VectorIndex[0]]. The second vector is at VectorData[VectorIndex[0]:VectorIndex[1]], and so on. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -98,13 +104,17 @@ class VectorIndex(VectorData): Used with VectorData to encode a ragged array. An array of indices into the first dimension of the target VectorData, and forming a map between the rows of a DynamicTable and the indices of the VectorData. The name of the VectorIndex is expected to be the name of the target VectorData object followed by \"_index\". """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) target: Optional[VectorData] = Field( None, description="""Reference to the target dataset that this index applies to.""" ) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -120,9 +130,13 @@ class ElementIdentifiers(Data): A list of unique identifiers for values within a dataset, e.g. rows of a DynamicTable. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) - name: str = Field("element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}}) + name: str = Field( + "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} + ) class DynamicTableRegion(VectorData): @@ -130,13 +144,17 @@ class DynamicTableRegion(VectorData): DynamicTableRegion provides a link from one table to an index or region of another. The `table` attribute is a link to another `DynamicTable`, indicating which table is referenced, and the data is int(s) indicating the row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to associate rows with repeated meta-data without data duplication. They can also be used to create hierarchical relationships between multiple `DynamicTable`s. `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create ragged references, so a single cell of a `DynamicTable` can reference many rows of another `DynamicTable`. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) table: Optional[DynamicTable] = Field( None, description="""Reference to the DynamicTable object that this region applies to.""" ) - description: Optional[str] = Field(None, description="""Description of what this table region points to.""") + description: Optional[str] = Field( + None, description="""Description of what this table region points to.""" + ) array: Optional[ Union[ NDArray[Shape["* dim0"], Any], @@ -152,14 +170,18 @@ class DynamicTable(Container): A group containing multiple datasets that are aligned on the first dimension (Currently, this requirement if left up to APIs to check and enforce). These datasets represent different columns in the table. Apart from a column that contains unique identifiers for each row, there are no other required datasets. Users are free to add any number of custom VectorData objects (columns) here. DynamicTable also supports ragged array columns, where each element can be of a different size. To add a ragged array column, use a VectorIndex type to index the corresponding VectorData type. See documentation for VectorData and VectorIndex for more details. Unlike a compound data type, which is analogous to storing an array-of-structs, a DynamicTable can be thought of as a struct-of-arrays. This provides an alternative structure to choose from when optimizing storage for anticipated access patterns. Additionally, this type provides a way of creating a table without having to define a compound type up front. Although this convenience may be attractive, users should think carefully about how data will be accessed. DynamicTable is more appropriate for column-centric access, whereas a dataset with a compound type would be more appropriate for row-centric access. Finally, data size should also be taken into account. For small tables, performance loss may be an acceptable trade-off for the flexibility of a DynamicTable. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) name: str = Field(...) colnames: Optional[str] = Field( None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", @@ -175,7 +197,9 @@ class AlignedDynamicTable(DynamicTable): DynamicTable container that supports storing a collection of sub-tables. Each sub-table is a DynamicTable itself that is aligned with the main table by row index. I.e., all DynamicTables stored in this group MUST have the same number of rows. This type effectively defines a 2-level table in which the main data is stored in the main table implemented by this type and additional columns of the table are grouped into categories, with each category being represented by a separate DynamicTable stored within the group. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.table", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-common.table", "tree_root": True} + ) children: Optional[List[DynamicTable]] = Field( None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "DynamicTable"}]}} @@ -185,7 +209,9 @@ class AlignedDynamicTable(DynamicTable): None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""", ) - description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") + description: Optional[str] = Field( + None, description="""Description of what is in this dynamic table.""" + ) id: NDArray[Shape["* num_rows"], int] = Field( ..., description="""Array of unique identifiers for the rows of this dynamic table.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/namespace.py index a816776..8b9bf5b 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/namespace.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/namespace.py @@ -31,7 +31,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -61,7 +63,12 @@ linkml_meta = LinkMLMeta( "default_prefix": "hdmf-common/", "description": "Common data structures provided by HDMF", "id": "hdmf-common", - "imports": ["hdmf-common.base", "hdmf-common.table", "hdmf-common.sparse", "hdmf-common.nwb.language"], + "imports": [ + "hdmf-common.base", + "hdmf-common.table", + "hdmf-common.sparse", + "hdmf-common.nwb.language", + ], "name": "hdmf-common", } ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_experimental.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_experimental.py index c625da7..090e4cd 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_experimental.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_experimental.py @@ -31,7 +31,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -71,13 +73,18 @@ class EnumData(VectorData): Data that come from a fixed set of values. A data value of i corresponds to the i-th value in the VectorData referenced by the 'elements' attribute. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.experimental", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-experimental.experimental", "tree_root": True} + ) name: str = Field(...) elements: Optional[VectorData] = Field( - None, description="""Reference to the VectorData object that contains the enumerable elements""" + None, + description="""Reference to the VectorData object that contains the enumerable elements""", + ) + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" ) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") array: Optional[ Union[ NDArray[Shape["* dim0"], Any], diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_resources.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_resources.py index 05909e9..57d1635 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_resources.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_resources.py @@ -31,7 +31,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -71,11 +73,14 @@ class ExternalResources(Container): A set of four tables for tracking external resource references in a file. NOTE: this data type is in beta testing and is subject to change in a later version. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-experimental.resources", "tree_root": True} + ) name: str = Field(...) keys: ExternalResourcesKeys = Field( - ..., description="""A table for storing user terms that are used to refer to external resources.""" + ..., + description="""A table for storing user terms that are used to refer to external resources.""", ) entities: ExternalResourcesEntities = Field( ..., description="""A table for mapping user terms (i.e., keys) to resource entities.""" @@ -84,7 +89,8 @@ class ExternalResources(Container): ..., description="""A table for mapping user terms (i.e., keys) to resource entities.""" ) objects: ExternalResourcesObjects = Field( - ..., description="""A table for identifying which objects in a file contain references to external resources.""" + ..., + description="""A table for identifying which objects in a file contain references to external resources.""", ) object_keys: ExternalResourcesObjectKeys = Field( ..., description="""A table for identifying which objects use which keys.""" @@ -99,9 +105,13 @@ class ExternalResourcesKeys(Data): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) name: Literal["keys"] = Field( - "keys", json_schema_extra={"linkml_meta": {"equals_string": "keys", "ifabsent": "string(keys)"}} + "keys", + json_schema_extra={"linkml_meta": {"equals_string": "keys", "ifabsent": "string(keys)"}}, + ) + key: str = Field( + ..., + description="""The user term that maps to one or more resources in the 'resources' table.""", ) - key: str = Field(..., description="""The user term that maps to one or more resources in the 'resources' table.""") class ExternalResourcesEntities(Data): @@ -112,13 +122,17 @@ class ExternalResourcesEntities(Data): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) name: Literal["entities"] = Field( - "entities", json_schema_extra={"linkml_meta": {"equals_string": "entities", "ifabsent": "string(entities)"}} + "entities", + json_schema_extra={ + "linkml_meta": {"equals_string": "entities", "ifabsent": "string(entities)"} + }, ) keys_idx: np.uint64 = Field(..., description="""The index to the key in the 'keys' table.""") resources_idx: np.uint64 = Field(..., description="""The index into the 'resources' table""") entity_id: str = Field(..., description="""The unique identifier entity.""") entity_uri: str = Field( - ..., description="""The URI for the entity this reference applies to. This can be an empty string.""" + ..., + description="""The URI for the entity this reference applies to. This can be an empty string.""", ) @@ -130,10 +144,15 @@ class ExternalResourcesResources(Data): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) name: Literal["resources"] = Field( - "resources", json_schema_extra={"linkml_meta": {"equals_string": "resources", "ifabsent": "string(resources)"}} + "resources", + json_schema_extra={ + "linkml_meta": {"equals_string": "resources", "ifabsent": "string(resources)"} + }, ) resource: str = Field(..., description="""The name of the resource.""") - resource_uri: str = Field(..., description="""The URI for the resource. This can be an empty string.""") + resource_uri: str = Field( + ..., description="""The URI for the resource. This can be an empty string.""" + ) class ExternalResourcesObjects(Data): @@ -144,7 +163,10 @@ class ExternalResourcesObjects(Data): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) name: Literal["objects"] = Field( - "objects", json_schema_extra={"linkml_meta": {"equals_string": "objects", "ifabsent": "string(objects)"}} + "objects", + json_schema_extra={ + "linkml_meta": {"equals_string": "objects", "ifabsent": "string(objects)"} + }, ) object_id: str = Field(..., description="""The UUID for the object.""") field: str = Field( @@ -162,7 +184,9 @@ class ExternalResourcesObjectKeys(Data): name: Literal["object_keys"] = Field( "object_keys", - json_schema_extra={"linkml_meta": {"equals_string": "object_keys", "ifabsent": "string(object_keys)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "object_keys", "ifabsent": "string(object_keys)"} + }, ) objects_idx: np.uint64 = Field( ..., description="""The index to the 'objects' table for the object that holds the key.""" diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/namespace.py index 9e3964e..69ffad1 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/namespace.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/namespace.py @@ -40,7 +40,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -68,10 +70,16 @@ linkml_meta = LinkMLMeta( "namespace": {"tag": "namespace", "value": "hdmf-experimental"}, }, "default_prefix": "hdmf-experimental/", - "description": "Experimental data structures provided by HDMF. These are not " - "guaranteed to be available in the future", + "description": ( + "Experimental data structures provided by HDMF. These are not " + "guaranteed to be available in the future" + ), "id": "hdmf-experimental", - "imports": ["hdmf-experimental.experimental", "hdmf-experimental.resources", "hdmf-experimental.nwb.language"], + "imports": [ + "hdmf-experimental.experimental", + "hdmf-experimental.resources", + "hdmf-experimental.nwb.language", + ], "name": "hdmf-experimental", } ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_5_0/hdmf_experimental_experimental.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_5_0/hdmf_experimental_experimental.py index a21d66f..e43d2ea 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_5_0/hdmf_experimental_experimental.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_5_0/hdmf_experimental_experimental.py @@ -31,7 +31,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -71,13 +73,18 @@ class EnumData(VectorData): Data that come from a fixed set of values. A data value of i corresponds to the i-th value in the VectorData referenced by the 'elements' attribute. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.experimental", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-experimental.experimental", "tree_root": True} + ) name: str = Field(...) elements: Optional[VectorData] = Field( - None, description="""Reference to the VectorData object that contains the enumerable elements""" + None, + description="""Reference to the VectorData object that contains the enumerable elements""", + ) + description: Optional[str] = Field( + None, description="""Description of what these vectors represent.""" ) - description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") array: Optional[ Union[ NDArray[Shape["* dim0"], Any], diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_5_0/hdmf_experimental_resources.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_5_0/hdmf_experimental_resources.py index a69e632..867b122 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_5_0/hdmf_experimental_resources.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_5_0/hdmf_experimental_resources.py @@ -31,7 +31,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -71,21 +73,31 @@ class HERD(Container): HDMF External Resources Data Structure. A set of six tables for tracking external resource references in a file or across multiple files. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources", "tree_root": True}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( + {"from_schema": "hdmf-experimental.resources", "tree_root": True} + ) name: str = Field(...) keys: HERDKeys = Field( - ..., description="""A table for storing user terms that are used to refer to external resources.""" + ..., + description="""A table for storing user terms that are used to refer to external resources.""", + ) + files: HERDFiles = Field( + ..., description="""A table for storing object ids of files used in external resources.""" ) - files: HERDFiles = Field(..., description="""A table for storing object ids of files used in external resources.""") entities: HERDEntities = Field( ..., description="""A table for mapping user terms (i.e., keys) to resource entities.""" ) objects: HERDObjects = Field( - ..., description="""A table for identifying which objects in a file contain references to external resources.""" + ..., + description="""A table for identifying which objects in a file contain references to external resources.""", + ) + object_keys: HERDObjectKeys = Field( + ..., description="""A table for identifying which objects use which keys.""" + ) + entity_keys: HERDEntityKeys = Field( + ..., description="""A table for identifying which keys use which entity.""" ) - object_keys: HERDObjectKeys = Field(..., description="""A table for identifying which objects use which keys.""") - entity_keys: HERDEntityKeys = Field(..., description="""A table for identifying which keys use which entity.""") class HERDKeys(Data): @@ -96,7 +108,8 @@ class HERDKeys(Data): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) name: Literal["keys"] = Field( - "keys", json_schema_extra={"linkml_meta": {"equals_string": "keys", "ifabsent": "string(keys)"}} + "keys", + json_schema_extra={"linkml_meta": {"equals_string": "keys", "ifabsent": "string(keys)"}}, ) key: str = Field( ..., @@ -112,10 +125,12 @@ class HERDFiles(Data): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) name: Literal["files"] = Field( - "files", json_schema_extra={"linkml_meta": {"equals_string": "files", "ifabsent": "string(files)"}} + "files", + json_schema_extra={"linkml_meta": {"equals_string": "files", "ifabsent": "string(files)"}}, ) file_object_id: str = Field( - ..., description="""The object id (UUID) of a file that contains objects that refers to external resources.""" + ..., + description="""The object id (UUID) of a file that contains objects that refers to external resources.""", ) @@ -127,7 +142,10 @@ class HERDEntities(Data): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) name: Literal["entities"] = Field( - "entities", json_schema_extra={"linkml_meta": {"equals_string": "entities", "ifabsent": "string(entities)"}} + "entities", + json_schema_extra={ + "linkml_meta": {"equals_string": "entities", "ifabsent": "string(entities)"} + }, ) entity_id: str = Field( ..., @@ -147,7 +165,10 @@ class HERDObjects(Data): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) name: Literal["objects"] = Field( - "objects", json_schema_extra={"linkml_meta": {"equals_string": "objects", "ifabsent": "string(objects)"}} + "objects", + json_schema_extra={ + "linkml_meta": {"equals_string": "objects", "ifabsent": "string(objects)"} + }, ) files_idx: np.uint64 = Field( ..., description="""The row index to the file in the `files` table containing the object.""" @@ -173,12 +194,16 @@ class HERDObjectKeys(Data): name: Literal["object_keys"] = Field( "object_keys", - json_schema_extra={"linkml_meta": {"equals_string": "object_keys", "ifabsent": "string(object_keys)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "object_keys", "ifabsent": "string(object_keys)"} + }, ) objects_idx: np.uint64 = Field( ..., description="""The row index to the object in the `objects` table that holds the key""" ) - keys_idx: np.uint64 = Field(..., description="""The row index to the key in the `keys` table.""") + keys_idx: np.uint64 = Field( + ..., description="""The row index to the key in the `keys` table.""" + ) class HERDEntityKeys(Data): @@ -190,10 +215,16 @@ class HERDEntityKeys(Data): name: Literal["entity_keys"] = Field( "entity_keys", - json_schema_extra={"linkml_meta": {"equals_string": "entity_keys", "ifabsent": "string(entity_keys)"}}, + json_schema_extra={ + "linkml_meta": {"equals_string": "entity_keys", "ifabsent": "string(entity_keys)"} + }, + ) + entities_idx: np.uint64 = Field( + ..., description="""The row index to the entity in the `entities` table.""" + ) + keys_idx: np.uint64 = Field( + ..., description="""The row index to the key in the `keys` table.""" ) - entities_idx: np.uint64 = Field(..., description="""The row index to the entity in the `entities` table.""") - keys_idx: np.uint64 = Field(..., description="""The row index to the key in the `keys` table.""") # Model rebuild diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_5_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_5_0/namespace.py index b62d5dd..8f32985 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_5_0/namespace.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_5_0/namespace.py @@ -41,7 +41,9 @@ class ConfiguredBaseModel(BaseModel): use_enum_values=True, strict=False, ) - hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file") + hdf5_path: Optional[str] = Field( + None, description="The absolute path that this object is stored in an NWB file" + ) object_id: Optional[str] = Field(None, description="Unique UUID for each object") @@ -69,10 +71,16 @@ linkml_meta = LinkMLMeta( "namespace": {"tag": "namespace", "value": "hdmf-experimental"}, }, "default_prefix": "hdmf-experimental/", - "description": "Experimental data structures provided by HDMF. These are not " - "guaranteed to be available in the future.", + "description": ( + "Experimental data structures provided by HDMF. These are not " + "guaranteed to be available in the future." + ), "id": "hdmf-experimental", - "imports": ["hdmf-experimental.experimental", "hdmf-experimental.resources", "hdmf-experimental.nwb.language"], + "imports": [ + "hdmf-experimental.experimental", + "hdmf-experimental.resources", + "hdmf-experimental.nwb.language", + ], "name": "hdmf-experimental", } ) diff --git a/nwb_linkml/tests/test_includes.py b/nwb_linkml/tests/test_includes.py index ce59503..d88ffcf 100644 --- a/nwb_linkml/tests/test_includes.py +++ b/nwb_linkml/tests/test_includes.py @@ -1,10 +1,13 @@ from pydantic import BaseModel + from nwb_linkml.includes import Named + def test_named_generic(): """ the Named type should fill in the ``name`` field in a model from the field name """ + class Child(BaseModel): name: str value: int @@ -13,5 +16,5 @@ def test_named_generic(): field_name: Named[Child] # should instantiate correctly and have name set - instance = Parent(field_name={'value': 1}) - assert instance.field_name.name == 'field_name' \ No newline at end of file + instance = Parent(field_name={"value": 1}) + assert instance.field_name.name == "field_name" diff --git a/nwb_linkml/tests/test_includes/test_hdmf.py b/nwb_linkml/tests/test_includes/test_hdmf.py index c5c2f01..0024917 100644 --- a/nwb_linkml/tests/test_includes/test_hdmf.py +++ b/nwb_linkml/tests/test_includes/test_hdmf.py @@ -1,8 +1,13 @@ -import pytest from typing import Tuple -import numpy as np -from nwb_linkml.models.pydantic.core.v2_7_0.namespace import ElectricalSeries, NWBFileGeneralExtracellularEphysElectrodes +import numpy as np +import pytest + +from nwb_linkml.models.pydantic.core.v2_7_0.namespace import ( + ElectricalSeries, + NWBFileGeneralExtracellularEphysElectrodes, +) + @pytest.fixture() def electrical_series() -> Tuple[ElectricalSeries, NWBFileGeneralExtracellularEphysElectrodes]: @@ -11,12 +16,12 @@ def electrical_series() -> Tuple[ElectricalSeries, NWBFileGeneralExtracellularEp """ n_electrodes = 5 n_times = 100 - data = np.arange(0, n_electrodes*n_times).reshape(n_times, n_electrodes) + data = np.arange(0, n_electrodes * n_times).reshape(n_times, n_electrodes) timestamps = np.linspace(0, 1, n_times) # make electrodes tables electrodes = NWBFileGeneralExtracellularEphysElectrodes( - id = np.arange(0, n_electrodes), - x = np.arange(0, n_electrodes), - y = np.arange(n_electrodes, n_electrodes*2) - ) \ No newline at end of file + id=np.arange(0, n_electrodes), + x=np.arange(0, n_electrodes), + y=np.arange(n_electrodes, n_electrodes * 2), + )