diff --git a/nwb_linkml/src/nwb_linkml/generators/pydantic.py b/nwb_linkml/src/nwb_linkml/generators/pydantic.py index 188c422..3e68710 100644 --- a/nwb_linkml/src/nwb_linkml/generators/pydantic.py +++ b/nwb_linkml/src/nwb_linkml/generators/pydantic.py @@ -42,7 +42,7 @@ from typing import ClassVar, Dict, List, Optional, Tuple, Type, Union from linkml.generators import PydanticGenerator from linkml.generators.pydanticgen.build import SlotResult from linkml.generators.pydanticgen.array import ArrayRepresentation, NumpydanticArray -from linkml.generators.pydanticgen.template import PydanticModule, Import, ObjectImport +from linkml.generators.pydanticgen.template import PydanticModule, Import, Imports from linkml_runtime.linkml_model.meta import ( Annotation, AnonymousSlotExpression, @@ -203,7 +203,9 @@ class AfterGenerateSlot: slot.injected_classes = named_injects else: slot.injected_classes.extend([ModelTypeString, _get_name, NamedString]) - if slot.imports: + if isinstance(slot.imports, list): + slot.imports = Imports(imports=slot.imports) + NamedImports + elif isinstance(slot.imports, Imports): slot.imports += NamedImports else: slot.imports = NamedImports 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 517ed29..4bc6c35 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 @@ -47,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 cd96ce2..e574c6b 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 @@ -7,60 +7,14 @@ 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 ...core.v2_2_0.core_nwb_misc import ( - AbstractFeatureSeries, - AbstractFeatureSeriesData, - AnnotationSeries, - IntervalSeries, - DecompositionSeries, - DecompositionSeriesData, - DecompositionSeriesBands, - Units, - UnitsSpikeTimes, -) -from ...core.v2_2_0.core_nwb_ecephys import ( - ElectricalSeries, - SpikeEventSeries, - FeatureExtraction, - EventDetection, - EventWaveform, - FilteredEphys, - LFP, - ElectrodeGroup, - ElectrodeGroupPosition, - ClusterWaveforms, - Clustering, -) -from ...core.v2_2_0.core_nwb_device import Device +from numpydantic import NDArray, Shape +from ...core.v2_2_0.core_nwb_misc import IntervalSeries from ...core.v2_2_0.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, TimeSeries, - TimeSeriesData, TimeSeriesStartingTime, TimeSeriesSync, - ProcessingModule, - Images, + NWBDataInterface, ) -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, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) -from numpydantic import NDArray, Shape metamodel_version = "None" version = "2.2.0" @@ -99,21 +53,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 009acb6..87bd7a4 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 @@ -64,7 +64,8 @@ class LinkMLMeta(RootModel): 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): 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 0422862..d802c37 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 @@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 21cd7b7..cf1adbd 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 @@ -7,107 +7,21 @@ 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 ...core.v2_2_0.core_nwb_misc import ( - AbstractFeatureSeries, - AbstractFeatureSeriesData, - AnnotationSeries, - IntervalSeries, - DecompositionSeries, - DecompositionSeriesData, - DecompositionSeriesBands, - Units, - UnitsSpikeTimes, -) -from ...core.v2_2_0.core_nwb_ecephys import ( - ElectricalSeries, - SpikeEventSeries, - FeatureExtraction, - EventDetection, - EventWaveform, - FilteredEphys, - LFP, - ElectrodeGroup, - ElectrodeGroupPosition, - ClusterWaveforms, - Clustering, -) +from ...core.v2_2_0.core_nwb_epoch import TimeIntervals +from ...core.v2_2_0.core_nwb_misc import Units from ...core.v2_2_0.core_nwb_device import Device +from ...core.v2_2_0.core_nwb_ogen import OptogeneticStimulusSite +from ...core.v2_2_0.core_nwb_ophys import ImagingPlane from ...core.v2_2_0.core_nwb_base import ( - NWBData, - Image, NWBContainer, NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, ProcessingModule, - Images, -) -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, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) -from ...core.v2_2_0.core_nwb_epoch import TimeIntervals, TimeIntervalsTimeseries -from ...core.v2_2_0.core_nwb_ophys import ( - TwoPhotonSeries, - RoiResponseSeries, - DfOverF, - Fluorescence, - ImageSegmentation, - ImagingPlane, - ImagingPlaneManifold, - ImagingPlaneOriginCoords, - ImagingPlaneGridSpacing, - OpticalChannel, - MotionCorrection, -) -from ...core.v2_2_0.core_nwb_image import ( - GrayscaleImage, - RGBImage, - RGBAImage, - ImageSeries, - ImageSeriesExternalFile, - ImageMaskSeries, - OpticalSeries, - IndexSeries, -) -from ...core.v2_2_0.core_nwb_ogen import OptogeneticSeries, OptogeneticStimulusSite -from ...core.v2_2_0.core_nwb_icephys import ( - PatchClampSeries, - PatchClampSeriesData, - CurrentClampSeries, - CurrentClampSeriesData, - IZeroClampSeries, - CurrentClampStimulusSeries, - CurrentClampStimulusSeriesData, - VoltageClampSeries, - VoltageClampSeriesData, - VoltageClampSeriesCapacitanceFast, - VoltageClampSeriesCapacitanceSlow, - VoltageClampSeriesResistanceCompBandwidth, - VoltageClampSeriesResistanceCompCorrection, - VoltageClampSeriesResistanceCompPrediction, - VoltageClampSeriesWholeCellCapacitanceComp, - VoltageClampSeriesWholeCellSeriesResistanceComp, - VoltageClampStimulusSeries, - VoltageClampStimulusSeriesData, - IntracellularElectrode, - SweepTable, + TimeSeries, ) +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 +from ...core.v2_2_0.core_nwb_icephys import IntracellularElectrode, SweepTable metamodel_version = "None" version = "2.2.0" @@ -146,21 +60,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 ec612cf..7eb4679 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,34 +5,11 @@ 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_table import ( - Data, - Index, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) -from ...core.v2_2_0.core_nwb_device import Device from ...core.v2_2_0.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, TimeSeries, - TimeSeriesData, TimeSeriesStartingTime, TimeSeriesSync, - ProcessingModule, - Images, + NWBContainer, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from pydantic import ( @@ -45,6 +22,7 @@ from pydantic import ( BeforeValidator, ) from numpydantic import NDArray, Shape +from ...hdmf_common.v1_1_0.hdmf_common_table import DynamicTable, VectorIndex, VectorData metamodel_version = "None" version = "2.2.0" @@ -87,7 +65,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 223b0b5..fa26d72 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 @@ -7,35 +7,8 @@ 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 ...core.v2_2_0.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -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, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) from numpydantic import NDArray, Shape +from ...core.v2_2_0.core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync metamodel_version = "None" version = "2.2.0" @@ -74,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 612058d..58ceb2e 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 @@ -66,7 +66,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 a290f59..cd3c8ac 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 @@ -52,21 +52,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 12d6cd1..9ae5919 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 @@ -5,45 +5,7 @@ from enum import Enum import re import sys import numpy as np -from ...core.v2_2_0.core_nwb_device import Device -from ...core.v2_2_0.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -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, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) -from ...core.v2_2_0.core_nwb_image import ( - GrayscaleImage, - RGBImage, - RGBAImage, - ImageSeries, - ImageSeriesExternalFile, - ImageMaskSeries, - OpticalSeries, - IndexSeries, -) +from ...core.v2_2_0.core_nwb_image import ImageSeries, ImageSeriesExternalFile from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from pydantic import ( BaseModel, @@ -54,7 +16,15 @@ from pydantic import ( ValidationInfo, BeforeValidator, ) +from ...hdmf_common.v1_1_0.hdmf_common_table import DynamicTableRegion, DynamicTable from numpydantic import NDArray, Shape +from ...core.v2_2_0.core_nwb_base import ( + TimeSeriesStartingTime, + TimeSeriesSync, + TimeSeries, + NWBDataInterface, + NWBContainer, +) metamodel_version = "None" version = "2.2.0" @@ -97,7 +67,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 7127d66..351f028 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 @@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 38e7cea..df1e7e7 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 @@ -47,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 35cca64..143813d 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 @@ -7,60 +7,14 @@ 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 ...core.v2_2_1.core_nwb_misc import ( - AbstractFeatureSeries, - AbstractFeatureSeriesData, - AnnotationSeries, - IntervalSeries, - DecompositionSeries, - DecompositionSeriesData, - DecompositionSeriesBands, - Units, - UnitsSpikeTimes, -) -from ...core.v2_2_1.core_nwb_ecephys import ( - ElectricalSeries, - SpikeEventSeries, - FeatureExtraction, - EventDetection, - EventWaveform, - FilteredEphys, - LFP, - ElectrodeGroup, - ElectrodeGroupPosition, - ClusterWaveforms, - Clustering, -) -from ...core.v2_2_1.core_nwb_device import Device +from numpydantic import NDArray, Shape +from ...core.v2_2_1.core_nwb_misc import IntervalSeries from ...core.v2_2_1.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, TimeSeries, - TimeSeriesData, TimeSeriesStartingTime, TimeSeriesSync, - ProcessingModule, - Images, + NWBDataInterface, ) -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, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) -from numpydantic import NDArray, Shape metamodel_version = "None" version = "2.2.1" @@ -99,21 +53,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 cc00287..4895ac4 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 @@ -64,7 +64,8 @@ class LinkMLMeta(RootModel): 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): 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 ec59bad..ad01523 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 @@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 2e87c11..3faf47c 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 @@ -7,107 +7,21 @@ 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 ...core.v2_2_1.core_nwb_misc import ( - AbstractFeatureSeries, - AbstractFeatureSeriesData, - AnnotationSeries, - IntervalSeries, - DecompositionSeries, - DecompositionSeriesData, - DecompositionSeriesBands, - Units, - UnitsSpikeTimes, -) -from ...core.v2_2_1.core_nwb_ecephys import ( - ElectricalSeries, - SpikeEventSeries, - FeatureExtraction, - EventDetection, - EventWaveform, - FilteredEphys, - LFP, - ElectrodeGroup, - ElectrodeGroupPosition, - ClusterWaveforms, - Clustering, -) +from ...core.v2_2_1.core_nwb_epoch import TimeIntervals +from ...core.v2_2_1.core_nwb_misc import Units from ...core.v2_2_1.core_nwb_device import Device +from ...core.v2_2_1.core_nwb_ogen import OptogeneticStimulusSite +from ...core.v2_2_1.core_nwb_ophys import ImagingPlane from ...core.v2_2_1.core_nwb_base import ( - NWBData, - Image, NWBContainer, NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, ProcessingModule, - Images, -) -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, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) -from ...core.v2_2_1.core_nwb_epoch import TimeIntervals, TimeIntervalsTimeseries -from ...core.v2_2_1.core_nwb_ophys import ( - TwoPhotonSeries, - RoiResponseSeries, - DfOverF, - Fluorescence, - ImageSegmentation, - ImagingPlane, - ImagingPlaneManifold, - ImagingPlaneOriginCoords, - ImagingPlaneGridSpacing, - OpticalChannel, - MotionCorrection, -) -from ...core.v2_2_1.core_nwb_image import ( - GrayscaleImage, - RGBImage, - RGBAImage, - ImageSeries, - ImageSeriesExternalFile, - ImageMaskSeries, - OpticalSeries, - IndexSeries, -) -from ...core.v2_2_1.core_nwb_ogen import OptogeneticSeries, OptogeneticStimulusSite -from ...core.v2_2_1.core_nwb_icephys import ( - PatchClampSeries, - PatchClampSeriesData, - CurrentClampSeries, - CurrentClampSeriesData, - IZeroClampSeries, - CurrentClampStimulusSeries, - CurrentClampStimulusSeriesData, - VoltageClampSeries, - VoltageClampSeriesData, - VoltageClampSeriesCapacitanceFast, - VoltageClampSeriesCapacitanceSlow, - VoltageClampSeriesResistanceCompBandwidth, - VoltageClampSeriesResistanceCompCorrection, - VoltageClampSeriesResistanceCompPrediction, - VoltageClampSeriesWholeCellCapacitanceComp, - VoltageClampSeriesWholeCellSeriesResistanceComp, - VoltageClampStimulusSeries, - VoltageClampStimulusSeriesData, - IntracellularElectrode, - SweepTable, + TimeSeries, ) +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 +from ...core.v2_2_1.core_nwb_icephys import IntracellularElectrode, SweepTable metamodel_version = "None" version = "2.2.1" @@ -146,21 +60,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 e40a2a3..3b96bf5 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,34 +5,11 @@ 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_table import ( - Data, - Index, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) -from ...core.v2_2_1.core_nwb_device import Device from ...core.v2_2_1.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, TimeSeries, - TimeSeriesData, TimeSeriesStartingTime, TimeSeriesSync, - ProcessingModule, - Images, + NWBContainer, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from pydantic import ( @@ -45,6 +22,7 @@ from pydantic import ( BeforeValidator, ) from numpydantic import NDArray, Shape +from ...hdmf_common.v1_1_2.hdmf_common_table import DynamicTable, VectorIndex, VectorData metamodel_version = "None" version = "2.2.1" @@ -87,7 +65,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 3d34dc8..f7b0d84 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 @@ -7,35 +7,8 @@ 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 ...core.v2_2_1.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -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, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) from numpydantic import NDArray, Shape +from ...core.v2_2_1.core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync metamodel_version = "None" version = "2.2.1" @@ -74,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 5f1a792..16f9bea 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 @@ -66,7 +66,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 79300ad..7a99546 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 @@ -52,21 +52,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 d285d35..6b4e114 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 @@ -5,45 +5,7 @@ from enum import Enum import re import sys import numpy as np -from ...core.v2_2_1.core_nwb_device import Device -from ...core.v2_2_1.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -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, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) -from ...core.v2_2_1.core_nwb_image import ( - GrayscaleImage, - RGBImage, - RGBAImage, - ImageSeries, - ImageSeriesExternalFile, - ImageMaskSeries, - OpticalSeries, - IndexSeries, -) +from ...core.v2_2_1.core_nwb_image import ImageSeries, ImageSeriesExternalFile from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from pydantic import ( BaseModel, @@ -54,7 +16,15 @@ from pydantic import ( ValidationInfo, BeforeValidator, ) +from ...hdmf_common.v1_1_2.hdmf_common_table import DynamicTableRegion, DynamicTable from numpydantic import NDArray, Shape +from ...core.v2_2_1.core_nwb_base import ( + TimeSeriesStartingTime, + TimeSeriesSync, + TimeSeries, + NWBDataInterface, + NWBContainer, +) metamodel_version = "None" version = "2.2.1" @@ -97,7 +67,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 3885a3d..e14720f 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 @@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 226082d..556fa21 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 @@ -47,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 1094150..39a00bd 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 @@ -7,60 +7,14 @@ 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 ...core.v2_2_2.core_nwb_misc import ( - AbstractFeatureSeries, - AbstractFeatureSeriesData, - AnnotationSeries, - IntervalSeries, - DecompositionSeries, - DecompositionSeriesData, - DecompositionSeriesBands, - Units, - UnitsSpikeTimes, -) -from ...core.v2_2_2.core_nwb_ecephys import ( - ElectricalSeries, - SpikeEventSeries, - FeatureExtraction, - EventDetection, - EventWaveform, - FilteredEphys, - LFP, - ElectrodeGroup, - ElectrodeGroupPosition, - ClusterWaveforms, - Clustering, -) -from ...core.v2_2_2.core_nwb_device import Device +from numpydantic import NDArray, Shape +from ...core.v2_2_2.core_nwb_misc import IntervalSeries from ...core.v2_2_2.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, TimeSeries, - TimeSeriesData, TimeSeriesStartingTime, TimeSeriesSync, - ProcessingModule, - Images, + NWBDataInterface, ) -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, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) -from numpydantic import NDArray, Shape metamodel_version = "None" version = "2.2.2" @@ -99,21 +53,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 689e3bd..dce2054 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 @@ -64,7 +64,8 @@ class LinkMLMeta(RootModel): 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): 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 e833469..34d95d8 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 @@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 6ee5eaa..32fe49a 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 @@ -7,103 +7,21 @@ 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 ...core.v2_2_2.core_nwb_misc import ( - AbstractFeatureSeries, - AbstractFeatureSeriesData, - AnnotationSeries, - IntervalSeries, - DecompositionSeries, - DecompositionSeriesData, - DecompositionSeriesBands, - Units, - UnitsSpikeTimes, -) -from ...core.v2_2_2.core_nwb_ecephys import ( - ElectricalSeries, - SpikeEventSeries, - FeatureExtraction, - EventDetection, - EventWaveform, - FilteredEphys, - LFP, - ElectrodeGroup, - ElectrodeGroupPosition, - ClusterWaveforms, - Clustering, -) +from ...core.v2_2_2.core_nwb_epoch import TimeIntervals +from ...core.v2_2_2.core_nwb_misc import Units from ...core.v2_2_2.core_nwb_device import Device +from ...core.v2_2_2.core_nwb_ogen import OptogeneticStimulusSite +from ...core.v2_2_2.core_nwb_ophys import ImagingPlane from ...core.v2_2_2.core_nwb_base import ( - NWBData, - Image, NWBContainer, NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, ProcessingModule, - Images, -) -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, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) -from ...core.v2_2_2.core_nwb_epoch import TimeIntervals, TimeIntervalsTimeseries -from ...core.v2_2_2.core_nwb_ophys import ( - TwoPhotonSeries, - RoiResponseSeries, - DfOverF, - Fluorescence, - ImageSegmentation, - ImagingPlane, - MotionCorrection, -) -from ...core.v2_2_2.core_nwb_image import ( - GrayscaleImage, - RGBImage, - RGBAImage, - ImageSeries, - ImageSeriesExternalFile, - ImageMaskSeries, - OpticalSeries, - IndexSeries, -) -from ...core.v2_2_2.core_nwb_ogen import OptogeneticSeries, OptogeneticStimulusSite -from ...core.v2_2_2.core_nwb_icephys import ( - PatchClampSeries, - PatchClampSeriesData, - CurrentClampSeries, - CurrentClampSeriesData, - IZeroClampSeries, - CurrentClampStimulusSeries, - CurrentClampStimulusSeriesData, - VoltageClampSeries, - VoltageClampSeriesData, - VoltageClampSeriesCapacitanceFast, - VoltageClampSeriesCapacitanceSlow, - VoltageClampSeriesResistanceCompBandwidth, - VoltageClampSeriesResistanceCompCorrection, - VoltageClampSeriesResistanceCompPrediction, - VoltageClampSeriesWholeCellCapacitanceComp, - VoltageClampSeriesWholeCellSeriesResistanceComp, - VoltageClampStimulusSeries, - VoltageClampStimulusSeriesData, - IntracellularElectrode, - SweepTable, + TimeSeries, ) +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 +from ...core.v2_2_2.core_nwb_icephys import IntracellularElectrode, SweepTable metamodel_version = "None" version = "2.2.2" @@ -142,21 +60,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 2df4422..a7fd4fd 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,34 +5,11 @@ 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_table import ( - Data, - Index, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) -from ...core.v2_2_2.core_nwb_device import Device from ...core.v2_2_2.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, TimeSeries, - TimeSeriesData, TimeSeriesStartingTime, TimeSeriesSync, - ProcessingModule, - Images, + NWBContainer, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from pydantic import ( @@ -45,6 +22,7 @@ from pydantic import ( BeforeValidator, ) from numpydantic import NDArray, Shape +from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTable, VectorIndex, VectorData metamodel_version = "None" version = "2.2.2" @@ -87,7 +65,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 b555724..11c8e94 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 @@ -7,35 +7,8 @@ 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 ...core.v2_2_2.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -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, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) from numpydantic import NDArray, Shape +from ...core.v2_2_2.core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync metamodel_version = "None" version = "2.2.2" @@ -74,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 dc05ee6..5c649b8 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 @@ -66,7 +66,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 9dd1568..9be92dd 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 @@ -52,21 +52,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 f0dfc8d..4a1b85f 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 @@ -5,45 +5,7 @@ from enum import Enum import re import sys import numpy as np -from ...core.v2_2_2.core_nwb_device import Device -from ...core.v2_2_2.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -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, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) -from ...core.v2_2_2.core_nwb_image import ( - GrayscaleImage, - RGBImage, - RGBAImage, - ImageSeries, - ImageSeriesExternalFile, - ImageMaskSeries, - OpticalSeries, - IndexSeries, -) +from ...core.v2_2_2.core_nwb_image import ImageSeries, ImageSeriesExternalFile from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from pydantic import ( BaseModel, @@ -55,6 +17,14 @@ from pydantic import ( BeforeValidator, ) from numpydantic import NDArray, Shape +from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTableRegion, DynamicTable +from ...core.v2_2_2.core_nwb_base import ( + TimeSeriesStartingTime, + TimeSeriesSync, + TimeSeries, + NWBDataInterface, + NWBContainer, +) metamodel_version = "None" version = "2.2.2" @@ -97,7 +67,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 c9add37..b1c56d8 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 @@ -47,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 9ea7cb3..0cec2c7 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 @@ -47,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 a107f25..a3f0972 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 @@ -7,60 +7,14 @@ 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 ...core.v2_2_4.core_nwb_misc import ( - AbstractFeatureSeries, - AbstractFeatureSeriesData, - AnnotationSeries, - IntervalSeries, - DecompositionSeries, - DecompositionSeriesData, - DecompositionSeriesBands, - Units, - UnitsSpikeTimes, -) -from ...core.v2_2_4.core_nwb_ecephys import ( - ElectricalSeries, - SpikeEventSeries, - FeatureExtraction, - EventDetection, - EventWaveform, - FilteredEphys, - LFP, - ElectrodeGroup, - ElectrodeGroupPosition, - ClusterWaveforms, - Clustering, -) -from ...core.v2_2_4.core_nwb_device import Device +from numpydantic import NDArray, Shape +from ...core.v2_2_4.core_nwb_misc import IntervalSeries from ...core.v2_2_4.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, TimeSeries, - TimeSeriesData, TimeSeriesStartingTime, TimeSeriesSync, - ProcessingModule, - Images, + NWBDataInterface, ) -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, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) -from numpydantic import NDArray, Shape metamodel_version = "None" version = "2.2.4" @@ -99,21 +53,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 f52bc43..4490dee 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 @@ -64,7 +64,8 @@ class LinkMLMeta(RootModel): 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): 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 e608030..ded8672 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 @@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 7b33bbc..ac4135f 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 @@ -7,109 +7,22 @@ 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 ...core.v2_2_4.core_nwb_misc import ( - AbstractFeatureSeries, - AbstractFeatureSeriesData, - AnnotationSeries, - IntervalSeries, - DecompositionSeries, - DecompositionSeriesData, - DecompositionSeriesBands, - Units, - UnitsSpikeTimes, -) -from ...core.v2_2_4.core_nwb_ecephys import ( - ElectricalSeries, - SpikeEventSeries, - FeatureExtraction, - EventDetection, - EventWaveform, - FilteredEphys, - LFP, - ElectrodeGroup, - ElectrodeGroupPosition, - ClusterWaveforms, - Clustering, -) +from ...core.v2_2_4.core_nwb_epoch import TimeIntervals +from ...core.v2_2_4.core_nwb_misc import Units from ...core.v2_2_4.core_nwb_device import Device +from ...core.v2_2_4.core_nwb_ogen import OptogeneticStimulusSite +from ...core.v2_2_4.core_nwb_ophys import ImagingPlane +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 +from ...core.v2_2_4.core_nwb_icephys import IntracellularElectrode, SweepTable from ...core.v2_2_4.core_nwb_base import ( NWBData, - Image, NWBContainer, NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, ProcessingModule, - Images, + TimeSeries, ) -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, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) -from ...core.v2_2_4.core_nwb_epoch import TimeIntervals, TimeIntervalsTimeseries -from ...core.v2_2_4.core_nwb_ophys import ( - TwoPhotonSeries, - RoiResponseSeries, - DfOverF, - Fluorescence, - ImageSegmentation, - PlaneSegmentation, - PlaneSegmentationImageMask, - PlaneSegmentationPixelMask, - PlaneSegmentationVoxelMask, - ImagingPlane, - OpticalChannel, - MotionCorrection, - CorrectedImageStack, -) -from ...core.v2_2_4.core_nwb_image import ( - GrayscaleImage, - RGBImage, - RGBAImage, - ImageSeries, - ImageSeriesExternalFile, - ImageMaskSeries, - OpticalSeries, - IndexSeries, -) -from ...core.v2_2_4.core_nwb_ogen import OptogeneticSeries, OptogeneticStimulusSite -from ...core.v2_2_4.core_nwb_icephys import ( - PatchClampSeries, - PatchClampSeriesData, - CurrentClampSeries, - CurrentClampSeriesData, - IZeroClampSeries, - CurrentClampStimulusSeries, - CurrentClampStimulusSeriesData, - VoltageClampSeries, - VoltageClampSeriesData, - VoltageClampSeriesCapacitanceFast, - VoltageClampSeriesCapacitanceSlow, - VoltageClampSeriesResistanceCompBandwidth, - VoltageClampSeriesResistanceCompCorrection, - VoltageClampSeriesResistanceCompPrediction, - VoltageClampSeriesWholeCellCapacitanceComp, - VoltageClampSeriesWholeCellSeriesResistanceComp, - VoltageClampStimulusSeries, - VoltageClampStimulusSeriesData, - IntracellularElectrode, - SweepTable, -) -from numpydantic import NDArray, Shape metamodel_version = "None" version = "2.2.4" @@ -148,21 +61,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 fccc547..d7e6f39 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,34 +5,11 @@ 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_table import ( - Data, - Index, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) -from ...core.v2_2_4.core_nwb_device import Device from ...core.v2_2_4.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, TimeSeries, - TimeSeriesData, TimeSeriesStartingTime, TimeSeriesSync, - ProcessingModule, - Images, + NWBContainer, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from pydantic import ( @@ -45,6 +22,7 @@ from pydantic import ( BeforeValidator, ) from numpydantic import NDArray, Shape +from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTable, VectorIndex, VectorData metamodel_version = "None" version = "2.2.4" @@ -87,7 +65,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 a7c3c9a..4bd8bd5 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 @@ -7,35 +7,8 @@ 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 ...core.v2_2_4.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -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, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) from numpydantic import NDArray, Shape +from ...core.v2_2_4.core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync metamodel_version = "None" version = "2.2.4" @@ -74,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 3273444..e45a26f 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 @@ -66,7 +66,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 1130b61..06238c6 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 @@ -52,21 +52,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 45465c9..f1fd32a 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 @@ -5,45 +5,6 @@ from enum import Enum import re import sys import numpy as np -from ...core.v2_2_4.core_nwb_device import Device -from ...core.v2_2_4.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -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, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) -from ...core.v2_2_4.core_nwb_image import ( - GrayscaleImage, - RGBImage, - RGBAImage, - ImageSeries, - ImageSeriesExternalFile, - ImageMaskSeries, - OpticalSeries, - IndexSeries, -) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from pydantic import ( BaseModel, @@ -55,6 +16,20 @@ from pydantic import ( BeforeValidator, ) from numpydantic import NDArray, Shape +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + DynamicTableRegion, + DynamicTable, + VectorIndex, + VectorData, +) +from ...core.v2_2_4.core_nwb_image import ImageSeries, ImageSeriesExternalFile +from ...core.v2_2_4.core_nwb_base import ( + TimeSeriesStartingTime, + TimeSeriesSync, + TimeSeries, + NWBDataInterface, + NWBContainer, +) metamodel_version = "None" version = "2.2.4" @@ -97,7 +72,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 73cba7f..b204be8 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 @@ -47,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 5fa3d20..defb8e9 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 @@ -47,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 7e73e80..012e884 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 @@ -7,60 +7,14 @@ 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 ...core.v2_2_5.core_nwb_misc import ( - AbstractFeatureSeries, - AbstractFeatureSeriesData, - AnnotationSeries, - IntervalSeries, - DecompositionSeries, - DecompositionSeriesData, - DecompositionSeriesBands, - Units, - UnitsSpikeTimes, -) -from ...core.v2_2_5.core_nwb_ecephys import ( - ElectricalSeries, - SpikeEventSeries, - FeatureExtraction, - EventDetection, - EventWaveform, - FilteredEphys, - LFP, - ElectrodeGroup, - ElectrodeGroupPosition, - ClusterWaveforms, - Clustering, -) -from ...core.v2_2_5.core_nwb_device import Device +from numpydantic import NDArray, Shape +from ...core.v2_2_5.core_nwb_misc import IntervalSeries from ...core.v2_2_5.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, TimeSeries, - TimeSeriesData, TimeSeriesStartingTime, TimeSeriesSync, - ProcessingModule, - Images, + NWBDataInterface, ) -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, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) -from numpydantic import NDArray, Shape metamodel_version = "None" version = "2.2.5" @@ -99,21 +53,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 137dc9a..8bb75d3 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 @@ -64,7 +64,8 @@ class LinkMLMeta(RootModel): 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): 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 88ff4f9..b7d6928 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 @@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 86b8376..d2a1e8f 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 @@ -7,109 +7,22 @@ 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 ...core.v2_2_5.core_nwb_misc import ( - AbstractFeatureSeries, - AbstractFeatureSeriesData, - AnnotationSeries, - IntervalSeries, - DecompositionSeries, - DecompositionSeriesData, - DecompositionSeriesBands, - Units, - UnitsSpikeTimes, -) -from ...core.v2_2_5.core_nwb_ecephys import ( - ElectricalSeries, - SpikeEventSeries, - FeatureExtraction, - EventDetection, - EventWaveform, - FilteredEphys, - LFP, - ElectrodeGroup, - ElectrodeGroupPosition, - ClusterWaveforms, - Clustering, -) +from ...core.v2_2_5.core_nwb_epoch import TimeIntervals +from ...core.v2_2_5.core_nwb_misc import Units from ...core.v2_2_5.core_nwb_device import Device +from ...core.v2_2_5.core_nwb_ogen import OptogeneticStimulusSite +from ...core.v2_2_5.core_nwb_ophys import ImagingPlane +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 +from ...core.v2_2_5.core_nwb_icephys import IntracellularElectrode, SweepTable from ...core.v2_2_5.core_nwb_base import ( NWBData, - Image, NWBContainer, NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, ProcessingModule, - Images, + TimeSeries, ) -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, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) -from ...core.v2_2_5.core_nwb_epoch import TimeIntervals, TimeIntervalsTimeseries -from ...core.v2_2_5.core_nwb_ophys import ( - TwoPhotonSeries, - RoiResponseSeries, - DfOverF, - Fluorescence, - ImageSegmentation, - PlaneSegmentation, - PlaneSegmentationImageMask, - PlaneSegmentationPixelMask, - PlaneSegmentationVoxelMask, - ImagingPlane, - OpticalChannel, - MotionCorrection, - CorrectedImageStack, -) -from ...core.v2_2_5.core_nwb_image import ( - GrayscaleImage, - RGBImage, - RGBAImage, - ImageSeries, - ImageSeriesExternalFile, - ImageMaskSeries, - OpticalSeries, - IndexSeries, -) -from ...core.v2_2_5.core_nwb_ogen import OptogeneticSeries, OptogeneticStimulusSite -from ...core.v2_2_5.core_nwb_icephys import ( - PatchClampSeries, - PatchClampSeriesData, - CurrentClampSeries, - CurrentClampSeriesData, - IZeroClampSeries, - CurrentClampStimulusSeries, - CurrentClampStimulusSeriesData, - VoltageClampSeries, - VoltageClampSeriesData, - VoltageClampSeriesCapacitanceFast, - VoltageClampSeriesCapacitanceSlow, - VoltageClampSeriesResistanceCompBandwidth, - VoltageClampSeriesResistanceCompCorrection, - VoltageClampSeriesResistanceCompPrediction, - VoltageClampSeriesWholeCellCapacitanceComp, - VoltageClampSeriesWholeCellSeriesResistanceComp, - VoltageClampStimulusSeries, - VoltageClampStimulusSeriesData, - IntracellularElectrode, - SweepTable, -) -from numpydantic import NDArray, Shape metamodel_version = "None" version = "2.2.5" @@ -148,21 +61,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 8398175..166ecb0 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,34 +5,11 @@ 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_table import ( - Data, - Index, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) -from ...core.v2_2_5.core_nwb_device import Device from ...core.v2_2_5.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, TimeSeries, - TimeSeriesData, TimeSeriesStartingTime, TimeSeriesSync, - ProcessingModule, - Images, + NWBContainer, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from pydantic import ( @@ -45,6 +22,7 @@ from pydantic import ( BeforeValidator, ) from numpydantic import NDArray, Shape +from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTable, VectorIndex, VectorData metamodel_version = "None" version = "2.2.5" @@ -87,7 +65,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 a6c5500..b74228e 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 @@ -7,35 +7,8 @@ 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 ...core.v2_2_5.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -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, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) from numpydantic import NDArray, Shape +from ...core.v2_2_5.core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync metamodel_version = "None" version = "2.2.5" @@ -74,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 1c2481c..5dd004e 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 @@ -66,7 +66,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 1723dba..5b95cba 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 @@ -52,21 +52,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 7dc895e..b9117ef 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 @@ -5,45 +5,6 @@ from enum import Enum import re import sys import numpy as np -from ...core.v2_2_5.core_nwb_device import Device -from ...core.v2_2_5.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -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, - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - Container, - DynamicTable, -) -from ...core.v2_2_5.core_nwb_image import ( - GrayscaleImage, - RGBImage, - RGBAImage, - ImageSeries, - ImageSeriesExternalFile, - ImageMaskSeries, - OpticalSeries, - IndexSeries, -) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from pydantic import ( BaseModel, @@ -55,6 +16,20 @@ from pydantic import ( BeforeValidator, ) from numpydantic import NDArray, Shape +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + DynamicTableRegion, + DynamicTable, + VectorIndex, + VectorData, +) +from ...core.v2_2_5.core_nwb_image import ImageSeries, ImageSeriesExternalFile +from ...core.v2_2_5.core_nwb_base import ( + TimeSeriesStartingTime, + TimeSeriesSync, + TimeSeries, + NWBDataInterface, + NWBContainer, +) metamodel_version = "None" version = "2.2.5" @@ -97,7 +72,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 a80f14e..4c3f758 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 @@ -47,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 53ddb67..d6fc9fa 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 @@ -48,21 +48,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 71498cf..b764c15 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 @@ -7,54 +7,14 @@ 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 ...core.v2_3_0.core_nwb_misc import ( - AbstractFeatureSeries, - AbstractFeatureSeriesData, - AnnotationSeries, - IntervalSeries, - DecompositionSeries, - DecompositionSeriesData, - DecompositionSeriesBands, - Units, - UnitsSpikeTimes, -) -from ...core.v2_3_0.core_nwb_ecephys import ( - ElectricalSeries, - SpikeEventSeries, - FeatureExtraction, - EventDetection, - EventWaveform, - FilteredEphys, - LFP, - ElectrodeGroup, - ElectrodeGroupPosition, - ClusterWaveforms, - Clustering, -) -from ...core.v2_3_0.core_nwb_device import Device +from numpydantic import NDArray, Shape +from ...core.v2_3_0.core_nwb_misc import IntervalSeries from ...core.v2_3_0.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, TimeSeries, - TimeSeriesData, TimeSeriesStartingTime, TimeSeriesSync, - ProcessingModule, - Images, + NWBDataInterface, ) -from ...hdmf_common.v1_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) -from numpydantic import NDArray, Shape metamodel_version = "None" version = "2.3.0" @@ -93,21 +53,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 5dcbe3f..2e00b45 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 @@ -64,7 +64,8 @@ class LinkMLMeta(RootModel): 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): 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 1b888c7..3e322e9 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 @@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 a916845..e4d19ca 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 @@ -7,103 +7,22 @@ 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 ...core.v2_3_0.core_nwb_misc import ( - AbstractFeatureSeries, - AbstractFeatureSeriesData, - AnnotationSeries, - IntervalSeries, - DecompositionSeries, - DecompositionSeriesData, - DecompositionSeriesBands, - Units, - UnitsSpikeTimes, -) -from ...core.v2_3_0.core_nwb_ecephys import ( - ElectricalSeries, - SpikeEventSeries, - FeatureExtraction, - EventDetection, - EventWaveform, - FilteredEphys, - LFP, - ElectrodeGroup, - ElectrodeGroupPosition, - ClusterWaveforms, - Clustering, -) +from ...core.v2_3_0.core_nwb_epoch import TimeIntervals +from ...core.v2_3_0.core_nwb_misc import Units from ...core.v2_3_0.core_nwb_device import Device +from ...core.v2_3_0.core_nwb_ogen import OptogeneticStimulusSite +from ...core.v2_3_0.core_nwb_ophys import ImagingPlane +from ...core.v2_3_0.core_nwb_ecephys import ElectrodeGroup +from numpydantic import NDArray, Shape +from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, VectorData +from ...core.v2_3_0.core_nwb_icephys import IntracellularElectrode, SweepTable from ...core.v2_3_0.core_nwb_base import ( NWBData, - Image, NWBContainer, NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, ProcessingModule, - Images, + TimeSeries, ) -from ...hdmf_common.v1_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) -from ...core.v2_3_0.core_nwb_epoch import TimeIntervals, TimeIntervalsTimeseries -from ...core.v2_3_0.core_nwb_ophys import ( - TwoPhotonSeries, - RoiResponseSeries, - DfOverF, - Fluorescence, - ImageSegmentation, - PlaneSegmentation, - PlaneSegmentationImageMask, - PlaneSegmentationPixelMask, - PlaneSegmentationVoxelMask, - ImagingPlane, - OpticalChannel, - MotionCorrection, - CorrectedImageStack, -) -from ...core.v2_3_0.core_nwb_image import ( - GrayscaleImage, - RGBImage, - RGBAImage, - ImageSeries, - ImageSeriesExternalFile, - ImageMaskSeries, - OpticalSeries, - IndexSeries, -) -from ...core.v2_3_0.core_nwb_ogen import OptogeneticSeries, OptogeneticStimulusSite -from ...core.v2_3_0.core_nwb_icephys import ( - PatchClampSeries, - PatchClampSeriesData, - CurrentClampSeries, - CurrentClampSeriesData, - IZeroClampSeries, - CurrentClampStimulusSeries, - CurrentClampStimulusSeriesData, - VoltageClampSeries, - VoltageClampSeriesData, - VoltageClampSeriesCapacitanceFast, - VoltageClampSeriesCapacitanceSlow, - VoltageClampSeriesResistanceCompBandwidth, - VoltageClampSeriesResistanceCompCorrection, - VoltageClampSeriesResistanceCompPrediction, - VoltageClampSeriesWholeCellCapacitanceComp, - VoltageClampSeriesWholeCellSeriesResistanceComp, - VoltageClampStimulusSeries, - VoltageClampStimulusSeriesData, - IntracellularElectrode, - SweepTable, -) -from numpydantic import NDArray, Shape metamodel_version = "None" version = "2.3.0" @@ -142,21 +61,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 48973c1..48af82c 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 @@ -5,28 +5,11 @@ from enum import Enum import re import sys import numpy as np -from ...hdmf_common.v1_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) -from ...core.v2_3_0.core_nwb_device import Device from ...core.v2_3_0.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, TimeSeries, - TimeSeriesData, TimeSeriesStartingTime, TimeSeriesSync, - ProcessingModule, - Images, + NWBContainer, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from pydantic import ( @@ -39,6 +22,7 @@ from pydantic import ( BeforeValidator, ) from numpydantic import NDArray, Shape +from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, VectorIndex, VectorData metamodel_version = "None" version = "2.3.0" @@ -81,7 +65,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 8c7f6a7..d54abe3 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 @@ -7,30 +7,8 @@ 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 ...core.v2_3_0.core_nwb_device import Device -from ...core.v2_3_0.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -from ...hdmf_common.v1_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) from numpydantic import NDArray, Shape +from ...core.v2_3_0.core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync metamodel_version = "None" version = "2.3.0" @@ -69,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 043a569..e2165a6 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 @@ -66,7 +66,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 bdd0669..71d202b 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 @@ -52,21 +52,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 b10dd83..0f02344 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 @@ -5,39 +5,6 @@ from enum import Enum import re import sys import numpy as np -from ...core.v2_3_0.core_nwb_device import Device -from ...core.v2_3_0.core_nwb_base import ( - NWBData, - Image, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -from ...hdmf_common.v1_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) -from ...core.v2_3_0.core_nwb_image import ( - GrayscaleImage, - RGBImage, - RGBAImage, - ImageSeries, - ImageSeriesExternalFile, - ImageMaskSeries, - OpticalSeries, - IndexSeries, -) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from pydantic import ( BaseModel, @@ -49,6 +16,20 @@ from pydantic import ( BeforeValidator, ) from numpydantic import NDArray, Shape +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, + DynamicTable, + VectorIndex, + VectorData, +) +from ...core.v2_3_0.core_nwb_image import ImageSeries, ImageSeriesExternalFile +from ...core.v2_3_0.core_nwb_base import ( + TimeSeriesStartingTime, + TimeSeriesSync, + TimeSeries, + NWBDataInterface, + NWBContainer, +) metamodel_version = "None" version = "2.3.0" @@ -91,7 +72,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 8efb904..6af3e96 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 @@ -47,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 92a1f7e..fe433cd 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 @@ -48,21 +48,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 0931744..8e859b8 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 @@ -7,55 +7,14 @@ 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 ...core.v2_4_0.core_nwb_misc import ( - AbstractFeatureSeries, - AbstractFeatureSeriesData, - AnnotationSeries, - IntervalSeries, - DecompositionSeries, - DecompositionSeriesData, - DecompositionSeriesBands, - Units, - UnitsSpikeTimes, -) -from ...core.v2_4_0.core_nwb_ecephys import ( - ElectricalSeries, - SpikeEventSeries, - FeatureExtraction, - EventDetection, - EventWaveform, - FilteredEphys, - LFP, - ElectrodeGroup, - ElectrodeGroupPosition, - ClusterWaveforms, - Clustering, -) -from ...core.v2_4_0.core_nwb_device import Device +from numpydantic import NDArray, Shape +from ...core.v2_4_0.core_nwb_misc import IntervalSeries from ...core.v2_4_0.core_nwb_base import ( - NWBData, - TimeSeriesReferenceVectorData, - Image, - NWBContainer, - NWBDataInterface, TimeSeries, - TimeSeriesData, TimeSeriesStartingTime, TimeSeriesSync, - ProcessingModule, - Images, + NWBDataInterface, ) -from ...hdmf_common.v1_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) -from numpydantic import NDArray, Shape metamodel_version = "None" version = "2.4.0" @@ -94,21 +53,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 1e4b58f..078ffc1 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 @@ -64,7 +64,8 @@ class LinkMLMeta(RootModel): 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): 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 dbff30e..68eac88 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 @@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 89862ef..c2c5d26 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 @@ -7,116 +7,30 @@ 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 ...core.v2_4_0.core_nwb_misc import ( - AbstractFeatureSeries, - AbstractFeatureSeriesData, - AnnotationSeries, - IntervalSeries, - DecompositionSeries, - DecompositionSeriesData, - DecompositionSeriesBands, - Units, - UnitsSpikeTimes, -) -from ...core.v2_4_0.core_nwb_ecephys import ( - ElectricalSeries, - SpikeEventSeries, - FeatureExtraction, - EventDetection, - EventWaveform, - FilteredEphys, - LFP, - ElectrodeGroup, - ElectrodeGroupPosition, - ClusterWaveforms, - Clustering, -) +from ...core.v2_4_0.core_nwb_epoch import TimeIntervals +from ...core.v2_4_0.core_nwb_misc import Units from ...core.v2_4_0.core_nwb_device import Device -from ...core.v2_4_0.core_nwb_base import ( - NWBData, - TimeSeriesReferenceVectorData, - Image, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -from ...hdmf_common.v1_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) -from ...core.v2_4_0.core_nwb_epoch import TimeIntervals, TimeIntervalsTimeseries -from ...core.v2_4_0.core_nwb_ophys import ( - TwoPhotonSeries, - RoiResponseSeries, - DfOverF, - Fluorescence, - ImageSegmentation, - PlaneSegmentation, - PlaneSegmentationImageMask, - PlaneSegmentationPixelMask, - PlaneSegmentationVoxelMask, - ImagingPlane, - OpticalChannel, - MotionCorrection, - CorrectedImageStack, -) -from ...core.v2_4_0.core_nwb_image import ( - GrayscaleImage, - RGBImage, - RGBAImage, - ImageSeries, - ImageSeriesExternalFile, - ImageMaskSeries, - OpticalSeries, - IndexSeries, -) -from ...core.v2_4_0.core_nwb_ogen import OptogeneticSeries, OptogeneticStimulusSite +from ...core.v2_4_0.core_nwb_ogen import OptogeneticStimulusSite +from ...core.v2_4_0.core_nwb_ophys import ImagingPlane +from ...core.v2_4_0.core_nwb_ecephys import ElectrodeGroup +from numpydantic import NDArray, Shape +from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, VectorData from ...core.v2_4_0.core_nwb_icephys import ( - PatchClampSeries, - PatchClampSeriesData, - CurrentClampSeries, - CurrentClampSeriesData, - IZeroClampSeries, - CurrentClampStimulusSeries, - CurrentClampStimulusSeriesData, - VoltageClampSeries, - VoltageClampSeriesData, - VoltageClampSeriesCapacitanceFast, - VoltageClampSeriesCapacitanceSlow, - VoltageClampSeriesResistanceCompBandwidth, - VoltageClampSeriesResistanceCompCorrection, - VoltageClampSeriesResistanceCompPrediction, - VoltageClampSeriesWholeCellCapacitanceComp, - VoltageClampSeriesWholeCellSeriesResistanceComp, - VoltageClampStimulusSeries, - VoltageClampStimulusSeriesData, IntracellularElectrode, SweepTable, - IntracellularElectrodesTable, - IntracellularStimuliTable, - IntracellularResponsesTable, IntracellularRecordingsTable, SimultaneousRecordingsTable, - SimultaneousRecordingsTableRecordings, SequentialRecordingsTable, - SequentialRecordingsTableSimultaneousRecordings, RepetitionsTable, - RepetitionsTableSequentialRecordings, ExperimentalConditionsTable, - ExperimentalConditionsTableRepetitions, ) -from numpydantic import NDArray, Shape +from ...core.v2_4_0.core_nwb_base import ( + NWBData, + NWBContainer, + NWBDataInterface, + ProcessingModule, + TimeSeries, +) metamodel_version = "None" version = "2.4.0" @@ -155,21 +69,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 a21be46..7ae2703 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 @@ -5,29 +5,12 @@ from enum import Enum import re import sys import numpy as np -from ...hdmf_common.v1_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) -from ...core.v2_4_0.core_nwb_device import Device from ...core.v2_4_0.core_nwb_base import ( - NWBData, - TimeSeriesReferenceVectorData, - Image, - NWBContainer, - NWBDataInterface, TimeSeries, - TimeSeriesData, TimeSeriesStartingTime, TimeSeriesSync, - ProcessingModule, - Images, + NWBContainer, + TimeSeriesReferenceVectorData, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from pydantic import ( @@ -40,6 +23,13 @@ from pydantic import ( BeforeValidator, ) from numpydantic import NDArray, Shape +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTable, + VectorIndex, + VectorData, + AlignedDynamicTable, + DynamicTableRegion, +) metamodel_version = "None" version = "2.4.0" @@ -82,7 +72,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 407d1ad..1209210 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 @@ -7,31 +7,8 @@ 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 ...core.v2_4_0.core_nwb_device import Device -from ...core.v2_4_0.core_nwb_base import ( - NWBData, - TimeSeriesReferenceVectorData, - Image, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -from ...hdmf_common.v1_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) from numpydantic import NDArray, Shape +from ...core.v2_4_0.core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync metamodel_version = "None" version = "2.4.0" @@ -70,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 56cc233..83f1e14 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 @@ -66,7 +66,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 78f7870..2b145ce 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 @@ -52,21 +52,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 62a3641..7c14767 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 @@ -5,40 +5,6 @@ from enum import Enum import re import sys import numpy as np -from ...core.v2_4_0.core_nwb_device import Device -from ...core.v2_4_0.core_nwb_base import ( - NWBData, - TimeSeriesReferenceVectorData, - Image, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -from ...hdmf_common.v1_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) -from ...core.v2_4_0.core_nwb_image import ( - GrayscaleImage, - RGBImage, - RGBAImage, - ImageSeries, - ImageSeriesExternalFile, - ImageMaskSeries, - OpticalSeries, - IndexSeries, -) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from pydantic import ( BaseModel, @@ -50,6 +16,20 @@ from pydantic import ( BeforeValidator, ) from numpydantic import NDArray, Shape +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, + DynamicTable, + VectorIndex, + VectorData, +) +from ...core.v2_4_0.core_nwb_image import ImageSeries, ImageSeriesExternalFile +from ...core.v2_4_0.core_nwb_base import ( + TimeSeriesStartingTime, + TimeSeriesSync, + TimeSeries, + NWBDataInterface, + NWBContainer, +) metamodel_version = "None" version = "2.4.0" @@ -92,7 +72,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 4ca390b..aaad019 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 @@ -47,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 9b976e9..a686488 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 @@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): @@ -168,6 +169,9 @@ class ImageReferences(NWBData): ) name: str = Field(...) + image: List[Image] = Field( + ..., description="""Ordered dataset of references to Image objects.""" + ) class NWBContainer(Container): 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 c912e61..4c8757c 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 @@ -7,56 +7,14 @@ 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 ...core.v2_5_0.core_nwb_misc import ( - AbstractFeatureSeries, - AbstractFeatureSeriesData, - AnnotationSeries, - IntervalSeries, - DecompositionSeries, - DecompositionSeriesData, - DecompositionSeriesBands, - Units, - UnitsSpikeTimes, -) -from ...core.v2_5_0.core_nwb_ecephys import ( - ElectricalSeries, - SpikeEventSeries, - FeatureExtraction, - EventDetection, - EventWaveform, - FilteredEphys, - LFP, - ElectrodeGroup, - ElectrodeGroupPosition, - ClusterWaveforms, - Clustering, -) -from ...core.v2_5_0.core_nwb_device import Device +from numpydantic import NDArray, Shape +from ...core.v2_5_0.core_nwb_misc import IntervalSeries from ...core.v2_5_0.core_nwb_base import ( - NWBData, - TimeSeriesReferenceVectorData, - Image, - ImageReferences, - NWBContainer, - NWBDataInterface, TimeSeries, - TimeSeriesData, TimeSeriesStartingTime, TimeSeriesSync, - ProcessingModule, - Images, + NWBDataInterface, ) -from ...hdmf_common.v1_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) -from numpydantic import NDArray, Shape metamodel_version = "None" version = "2.5.0" @@ -95,21 +53,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 71f47b3..ad473ec 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 @@ -64,7 +64,8 @@ class LinkMLMeta(RootModel): 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): 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 b4d396a..e55c2ea 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 @@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 33d05c4..fb4442a 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 @@ -7,117 +7,31 @@ 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 ...core.v2_5_0.core_nwb_misc import ( - AbstractFeatureSeries, - AbstractFeatureSeriesData, - AnnotationSeries, - IntervalSeries, - DecompositionSeries, - DecompositionSeriesData, - DecompositionSeriesBands, - Units, - UnitsSpikeTimes, -) -from ...core.v2_5_0.core_nwb_ecephys import ( - ElectricalSeries, - SpikeEventSeries, - FeatureExtraction, - EventDetection, - EventWaveform, - FilteredEphys, - LFP, - ElectrodeGroup, - ElectrodeGroupPosition, - ClusterWaveforms, - Clustering, -) -from ...core.v2_5_0.core_nwb_device import Device -from ...core.v2_5_0.core_nwb_base import ( - NWBData, - TimeSeriesReferenceVectorData, - Image, - ImageReferences, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -from ...hdmf_common.v1_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) from ...core.v2_5_0.core_nwb_epoch import TimeIntervals -from ...core.v2_5_0.core_nwb_ophys import ( - TwoPhotonSeries, - RoiResponseSeries, - DfOverF, - Fluorescence, - ImageSegmentation, - PlaneSegmentation, - PlaneSegmentationImageMask, - PlaneSegmentationPixelMask, - PlaneSegmentationVoxelMask, - ImagingPlane, - OpticalChannel, - MotionCorrection, - CorrectedImageStack, -) -from ...core.v2_5_0.core_nwb_image import ( - GrayscaleImage, - RGBImage, - RGBAImage, - ImageSeries, - ImageSeriesExternalFile, - ImageMaskSeries, - OpticalSeries, - IndexSeries, -) -from ...core.v2_5_0.core_nwb_ogen import OptogeneticSeries, OptogeneticStimulusSite +from ...core.v2_5_0.core_nwb_misc import Units +from ...core.v2_5_0.core_nwb_device import Device +from ...core.v2_5_0.core_nwb_ogen import OptogeneticStimulusSite +from ...core.v2_5_0.core_nwb_ophys import ImagingPlane +from ...core.v2_5_0.core_nwb_ecephys import ElectrodeGroup +from numpydantic import NDArray, Shape +from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, VectorData from ...core.v2_5_0.core_nwb_icephys import ( - PatchClampSeries, - PatchClampSeriesData, - CurrentClampSeries, - CurrentClampSeriesData, - IZeroClampSeries, - CurrentClampStimulusSeries, - CurrentClampStimulusSeriesData, - VoltageClampSeries, - VoltageClampSeriesData, - VoltageClampSeriesCapacitanceFast, - VoltageClampSeriesCapacitanceSlow, - VoltageClampSeriesResistanceCompBandwidth, - VoltageClampSeriesResistanceCompCorrection, - VoltageClampSeriesResistanceCompPrediction, - VoltageClampSeriesWholeCellCapacitanceComp, - VoltageClampSeriesWholeCellSeriesResistanceComp, - VoltageClampStimulusSeries, - VoltageClampStimulusSeriesData, IntracellularElectrode, SweepTable, - IntracellularElectrodesTable, - IntracellularStimuliTable, - IntracellularResponsesTable, IntracellularRecordingsTable, SimultaneousRecordingsTable, - SimultaneousRecordingsTableRecordings, SequentialRecordingsTable, - SequentialRecordingsTableSimultaneousRecordings, RepetitionsTable, - RepetitionsTableSequentialRecordings, ExperimentalConditionsTable, - ExperimentalConditionsTableRepetitions, ) -from numpydantic import NDArray, Shape +from ...core.v2_5_0.core_nwb_base import ( + NWBData, + NWBContainer, + NWBDataInterface, + ProcessingModule, + TimeSeries, + Images, +) metamodel_version = "None" version = "2.5.0" @@ -156,21 +70,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 773fe2f..0ff7aa1 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 @@ -5,30 +5,12 @@ from enum import Enum import re import sys import numpy as np -from ...hdmf_common.v1_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) -from ...core.v2_5_0.core_nwb_device import Device from ...core.v2_5_0.core_nwb_base import ( - NWBData, - TimeSeriesReferenceVectorData, - Image, - ImageReferences, - NWBContainer, - NWBDataInterface, TimeSeries, - TimeSeriesData, TimeSeriesStartingTime, TimeSeriesSync, - ProcessingModule, - Images, + NWBContainer, + TimeSeriesReferenceVectorData, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from pydantic import ( @@ -41,6 +23,13 @@ from pydantic import ( BeforeValidator, ) from numpydantic import NDArray, Shape +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTable, + VectorIndex, + VectorData, + AlignedDynamicTable, + DynamicTableRegion, +) metamodel_version = "None" version = "2.5.0" @@ -83,7 +72,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 171ed7c..52ffddb 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 @@ -7,32 +7,8 @@ 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 ...core.v2_5_0.core_nwb_device import Device -from ...core.v2_5_0.core_nwb_base import ( - NWBData, - TimeSeriesReferenceVectorData, - Image, - ImageReferences, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -from ...hdmf_common.v1_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) from numpydantic import NDArray, Shape +from ...core.v2_5_0.core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync metamodel_version = "None" version = "2.5.0" @@ -71,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 510c7cf..bbf2692 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 @@ -66,7 +66,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 7978fd3..618462b 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 @@ -52,21 +52,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 b82801e..1206850 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 @@ -5,41 +5,6 @@ from enum import Enum import re import sys import numpy as np -from ...core.v2_5_0.core_nwb_device import Device -from ...core.v2_5_0.core_nwb_base import ( - NWBData, - TimeSeriesReferenceVectorData, - Image, - ImageReferences, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -from ...hdmf_common.v1_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) -from ...core.v2_5_0.core_nwb_image import ( - GrayscaleImage, - RGBImage, - RGBAImage, - ImageSeries, - ImageSeriesExternalFile, - ImageMaskSeries, - OpticalSeries, - IndexSeries, -) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from pydantic import ( BaseModel, @@ -51,6 +16,20 @@ from pydantic import ( BeforeValidator, ) from numpydantic import NDArray, Shape +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, + DynamicTable, + VectorIndex, + VectorData, +) +from ...core.v2_5_0.core_nwb_image import ImageSeries, ImageSeriesExternalFile +from ...core.v2_5_0.core_nwb_base import ( + TimeSeriesStartingTime, + TimeSeriesSync, + TimeSeries, + NWBDataInterface, + NWBContainer, +) metamodel_version = "None" version = "2.5.0" @@ -93,7 +72,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 629130a..c8b182e 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 @@ -47,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 f2e9356..d890d13 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 @@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): @@ -168,6 +169,9 @@ class ImageReferences(NWBData): ) name: str = Field(...) + image: List[Image] = Field( + ..., description="""Ordered dataset of references to Image objects.""" + ) class NWBContainer(Container): 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 abcef5a..bc29452 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 @@ -7,56 +7,14 @@ 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 ...core.v2_6_0_alpha.core_nwb_misc import ( - AbstractFeatureSeries, - AbstractFeatureSeriesData, - AnnotationSeries, - IntervalSeries, - DecompositionSeries, - DecompositionSeriesData, - DecompositionSeriesBands, - Units, - UnitsSpikeTimes, -) -from ...core.v2_6_0_alpha.core_nwb_ecephys import ( - ElectricalSeries, - SpikeEventSeries, - FeatureExtraction, - EventDetection, - EventWaveform, - FilteredEphys, - LFP, - ElectrodeGroup, - ElectrodeGroupPosition, - ClusterWaveforms, - Clustering, -) -from ...core.v2_6_0_alpha.core_nwb_device import Device +from numpydantic import NDArray, Shape +from ...core.v2_6_0_alpha.core_nwb_misc import IntervalSeries from ...core.v2_6_0_alpha.core_nwb_base import ( - NWBData, - TimeSeriesReferenceVectorData, - Image, - ImageReferences, - NWBContainer, - NWBDataInterface, TimeSeries, - TimeSeriesData, TimeSeriesStartingTime, TimeSeriesSync, - ProcessingModule, - Images, + NWBDataInterface, ) -from ...hdmf_common.v1_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) -from numpydantic import NDArray, Shape metamodel_version = "None" version = "2.6.0-alpha" @@ -95,21 +53,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 6be4d32..5143425 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 @@ -64,7 +64,8 @@ class LinkMLMeta(RootModel): 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): 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 25a397b..635e417 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 @@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 ec7360e..f1e2354 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 @@ -7,118 +7,31 @@ 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 ...core.v2_6_0_alpha.core_nwb_misc import ( - AbstractFeatureSeries, - AbstractFeatureSeriesData, - AnnotationSeries, - IntervalSeries, - DecompositionSeries, - DecompositionSeriesData, - DecompositionSeriesBands, - Units, - UnitsSpikeTimes, -) -from ...core.v2_6_0_alpha.core_nwb_ecephys import ( - ElectricalSeries, - SpikeEventSeries, - FeatureExtraction, - EventDetection, - EventWaveform, - FilteredEphys, - LFP, - ElectrodeGroup, - ElectrodeGroupPosition, - ClusterWaveforms, - Clustering, -) -from ...core.v2_6_0_alpha.core_nwb_device import Device -from ...core.v2_6_0_alpha.core_nwb_base import ( - NWBData, - TimeSeriesReferenceVectorData, - Image, - ImageReferences, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -from ...hdmf_common.v1_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) from ...core.v2_6_0_alpha.core_nwb_epoch import TimeIntervals -from ...core.v2_6_0_alpha.core_nwb_ophys import ( - OnePhotonSeries, - TwoPhotonSeries, - RoiResponseSeries, - DfOverF, - Fluorescence, - ImageSegmentation, - PlaneSegmentation, - PlaneSegmentationImageMask, - PlaneSegmentationPixelMask, - PlaneSegmentationVoxelMask, - ImagingPlane, - OpticalChannel, - MotionCorrection, - CorrectedImageStack, -) -from ...core.v2_6_0_alpha.core_nwb_image import ( - GrayscaleImage, - RGBImage, - RGBAImage, - ImageSeries, - ImageSeriesExternalFile, - ImageMaskSeries, - OpticalSeries, - IndexSeries, -) -from ...core.v2_6_0_alpha.core_nwb_ogen import OptogeneticSeries, OptogeneticStimulusSite +from ...core.v2_6_0_alpha.core_nwb_misc import Units +from ...core.v2_6_0_alpha.core_nwb_device import Device +from ...core.v2_6_0_alpha.core_nwb_ogen import OptogeneticStimulusSite +from ...core.v2_6_0_alpha.core_nwb_ophys import ImagingPlane +from ...core.v2_6_0_alpha.core_nwb_ecephys import ElectrodeGroup +from numpydantic import NDArray, Shape +from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, VectorData from ...core.v2_6_0_alpha.core_nwb_icephys import ( - PatchClampSeries, - PatchClampSeriesData, - CurrentClampSeries, - CurrentClampSeriesData, - IZeroClampSeries, - CurrentClampStimulusSeries, - CurrentClampStimulusSeriesData, - VoltageClampSeries, - VoltageClampSeriesData, - VoltageClampSeriesCapacitanceFast, - VoltageClampSeriesCapacitanceSlow, - VoltageClampSeriesResistanceCompBandwidth, - VoltageClampSeriesResistanceCompCorrection, - VoltageClampSeriesResistanceCompPrediction, - VoltageClampSeriesWholeCellCapacitanceComp, - VoltageClampSeriesWholeCellSeriesResistanceComp, - VoltageClampStimulusSeries, - VoltageClampStimulusSeriesData, IntracellularElectrode, SweepTable, - IntracellularElectrodesTable, - IntracellularStimuliTable, - IntracellularResponsesTable, IntracellularRecordingsTable, SimultaneousRecordingsTable, - SimultaneousRecordingsTableRecordings, SequentialRecordingsTable, - SequentialRecordingsTableSimultaneousRecordings, RepetitionsTable, - RepetitionsTableSequentialRecordings, ExperimentalConditionsTable, - ExperimentalConditionsTableRepetitions, ) -from numpydantic import NDArray, Shape +from ...core.v2_6_0_alpha.core_nwb_base import ( + NWBData, + NWBContainer, + NWBDataInterface, + ProcessingModule, + TimeSeries, + Images, +) metamodel_version = "None" version = "2.6.0-alpha" @@ -157,21 +70,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 e12fbf7..fe0ff7c 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 @@ -5,30 +5,12 @@ from enum import Enum import re import sys import numpy as np -from ...hdmf_common.v1_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) -from ...core.v2_6_0_alpha.core_nwb_device import Device from ...core.v2_6_0_alpha.core_nwb_base import ( - NWBData, - TimeSeriesReferenceVectorData, - Image, - ImageReferences, - NWBContainer, - NWBDataInterface, TimeSeries, - TimeSeriesData, TimeSeriesStartingTime, TimeSeriesSync, - ProcessingModule, - Images, + NWBContainer, + TimeSeriesReferenceVectorData, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from pydantic import ( @@ -41,6 +23,13 @@ from pydantic import ( BeforeValidator, ) from numpydantic import NDArray, Shape +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTable, + VectorIndex, + VectorData, + AlignedDynamicTable, + DynamicTableRegion, +) metamodel_version = "None" version = "2.6.0-alpha" @@ -83,7 +72,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 ab0de92..e1ee620 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 @@ -7,32 +7,13 @@ 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 ...core.v2_6_0_alpha.core_nwb_device import Device +from numpydantic import NDArray, Shape from ...core.v2_6_0_alpha.core_nwb_base import ( - NWBData, - TimeSeriesReferenceVectorData, Image, - ImageReferences, - NWBContainer, - NWBDataInterface, TimeSeries, - TimeSeriesData, TimeSeriesStartingTime, TimeSeriesSync, - ProcessingModule, - Images, ) -from ...hdmf_common.v1_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) -from numpydantic import NDArray, Shape metamodel_version = "None" version = "2.6.0-alpha" @@ -71,21 +52,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 5355215..eca3094 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 @@ -66,7 +66,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 34bce13..8b0a950 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 @@ -52,21 +52,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 ccd787e..b7b8841 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 @@ -5,41 +5,6 @@ from enum import Enum import re import sys import numpy as np -from ...core.v2_6_0_alpha.core_nwb_device import Device -from ...core.v2_6_0_alpha.core_nwb_base import ( - NWBData, - TimeSeriesReferenceVectorData, - Image, - ImageReferences, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -from ...hdmf_common.v1_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) -from ...core.v2_6_0_alpha.core_nwb_image import ( - GrayscaleImage, - RGBImage, - RGBAImage, - ImageSeries, - ImageSeriesExternalFile, - ImageMaskSeries, - OpticalSeries, - IndexSeries, -) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from pydantic import ( BaseModel, @@ -51,6 +16,20 @@ from pydantic import ( BeforeValidator, ) from numpydantic import NDArray, Shape +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, + DynamicTable, + VectorIndex, + VectorData, +) +from ...core.v2_6_0_alpha.core_nwb_image import ImageSeries, ImageSeriesExternalFile +from ...core.v2_6_0_alpha.core_nwb_base import ( + TimeSeriesStartingTime, + TimeSeriesSync, + TimeSeries, + NWBDataInterface, + NWBContainer, +) metamodel_version = "None" version = "2.6.0-alpha" @@ -93,7 +72,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 dfc09b4..fd2509b 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 @@ -47,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 404c5fa..b76ba30 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 @@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): @@ -168,6 +169,9 @@ class ImageReferences(NWBData): ) name: str = Field(...) + image: List[Image] = Field( + ..., description="""Ordered dataset of references to Image objects.""" + ) class NWBContainer(Container): 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 54c77a5..991d017 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 @@ -7,56 +7,14 @@ 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 ...core.v2_7_0.core_nwb_misc import ( - AbstractFeatureSeries, - AbstractFeatureSeriesData, - AnnotationSeries, - IntervalSeries, - DecompositionSeries, - DecompositionSeriesData, - DecompositionSeriesBands, - Units, - UnitsSpikeTimes, -) -from ...core.v2_7_0.core_nwb_ecephys import ( - ElectricalSeries, - SpikeEventSeries, - FeatureExtraction, - EventDetection, - EventWaveform, - FilteredEphys, - LFP, - ElectrodeGroup, - ElectrodeGroupPosition, - ClusterWaveforms, - Clustering, -) -from ...core.v2_7_0.core_nwb_device import Device +from numpydantic import NDArray, Shape +from ...core.v2_7_0.core_nwb_misc import IntervalSeries from ...core.v2_7_0.core_nwb_base import ( - NWBData, - TimeSeriesReferenceVectorData, - Image, - ImageReferences, - NWBContainer, - NWBDataInterface, TimeSeries, - TimeSeriesData, TimeSeriesStartingTime, TimeSeriesSync, - ProcessingModule, - Images, + NWBDataInterface, ) -from ...hdmf_common.v1_8_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_8_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_8_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) -from numpydantic import NDArray, Shape metamodel_version = "None" version = "2.7.0" @@ -95,21 +53,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 c8bb299..b4049fc 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 @@ -64,7 +64,8 @@ class LinkMLMeta(RootModel): 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): 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 27670dc..2d844c9 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 @@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 97bdbf3..47cb4ad 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 @@ -7,118 +7,31 @@ 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 ...core.v2_7_0.core_nwb_misc import ( - AbstractFeatureSeries, - AbstractFeatureSeriesData, - AnnotationSeries, - IntervalSeries, - DecompositionSeries, - DecompositionSeriesData, - DecompositionSeriesBands, - Units, - UnitsSpikeTimes, -) -from ...core.v2_7_0.core_nwb_ecephys import ( - ElectricalSeries, - SpikeEventSeries, - FeatureExtraction, - EventDetection, - EventWaveform, - FilteredEphys, - LFP, - ElectrodeGroup, - ElectrodeGroupPosition, - ClusterWaveforms, - Clustering, -) -from ...core.v2_7_0.core_nwb_device import Device -from ...core.v2_7_0.core_nwb_base import ( - NWBData, - TimeSeriesReferenceVectorData, - Image, - ImageReferences, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -from ...hdmf_common.v1_8_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_8_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_8_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) from ...core.v2_7_0.core_nwb_epoch import TimeIntervals -from ...core.v2_7_0.core_nwb_ophys import ( - OnePhotonSeries, - TwoPhotonSeries, - RoiResponseSeries, - DfOverF, - Fluorescence, - ImageSegmentation, - PlaneSegmentation, - PlaneSegmentationImageMask, - PlaneSegmentationPixelMask, - PlaneSegmentationVoxelMask, - ImagingPlane, - OpticalChannel, - MotionCorrection, - CorrectedImageStack, -) -from ...core.v2_7_0.core_nwb_image import ( - GrayscaleImage, - RGBImage, - RGBAImage, - ImageSeries, - ImageSeriesExternalFile, - ImageMaskSeries, - OpticalSeries, - IndexSeries, -) -from ...core.v2_7_0.core_nwb_ogen import OptogeneticSeries, OptogeneticStimulusSite +from ...core.v2_7_0.core_nwb_misc import Units +from ...core.v2_7_0.core_nwb_device import Device +from ...core.v2_7_0.core_nwb_ogen import OptogeneticStimulusSite +from ...core.v2_7_0.core_nwb_ophys import ImagingPlane +from ...core.v2_7_0.core_nwb_ecephys import ElectrodeGroup +from numpydantic import NDArray, Shape +from ...hdmf_common.v1_8_0.hdmf_common_table import DynamicTable, VectorData from ...core.v2_7_0.core_nwb_icephys import ( - PatchClampSeries, - PatchClampSeriesData, - CurrentClampSeries, - CurrentClampSeriesData, - IZeroClampSeries, - CurrentClampStimulusSeries, - CurrentClampStimulusSeriesData, - VoltageClampSeries, - VoltageClampSeriesData, - VoltageClampSeriesCapacitanceFast, - VoltageClampSeriesCapacitanceSlow, - VoltageClampSeriesResistanceCompBandwidth, - VoltageClampSeriesResistanceCompCorrection, - VoltageClampSeriesResistanceCompPrediction, - VoltageClampSeriesWholeCellCapacitanceComp, - VoltageClampSeriesWholeCellSeriesResistanceComp, - VoltageClampStimulusSeries, - VoltageClampStimulusSeriesData, IntracellularElectrode, SweepTable, - IntracellularElectrodesTable, - IntracellularStimuliTable, - IntracellularResponsesTable, IntracellularRecordingsTable, SimultaneousRecordingsTable, - SimultaneousRecordingsTableRecordings, SequentialRecordingsTable, - SequentialRecordingsTableSimultaneousRecordings, RepetitionsTable, - RepetitionsTableSequentialRecordings, ExperimentalConditionsTable, - ExperimentalConditionsTableRepetitions, ) -from numpydantic import NDArray, Shape +from ...core.v2_7_0.core_nwb_base import ( + NWBData, + NWBContainer, + NWBDataInterface, + ProcessingModule, + TimeSeries, + Images, +) metamodel_version = "None" version = "2.7.0" @@ -157,21 +70,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 ab6d663..a7b2f34 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 @@ -5,30 +5,12 @@ from enum import Enum import re import sys import numpy as np -from ...hdmf_common.v1_8_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_8_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_8_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) -from ...core.v2_7_0.core_nwb_device import Device from ...core.v2_7_0.core_nwb_base import ( - NWBData, - TimeSeriesReferenceVectorData, - Image, - ImageReferences, - NWBContainer, - NWBDataInterface, TimeSeries, - TimeSeriesData, TimeSeriesStartingTime, TimeSeriesSync, - ProcessingModule, - Images, + NWBContainer, + TimeSeriesReferenceVectorData, ) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from pydantic import ( @@ -41,6 +23,13 @@ from pydantic import ( BeforeValidator, ) from numpydantic import NDArray, Shape +from ...hdmf_common.v1_8_0.hdmf_common_table import ( + DynamicTable, + VectorIndex, + VectorData, + AlignedDynamicTable, + DynamicTableRegion, +) metamodel_version = "None" version = "2.7.0" @@ -83,7 +72,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 8baa00d..7377214 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 @@ -7,32 +7,8 @@ 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 ...core.v2_7_0.core_nwb_device import Device -from ...core.v2_7_0.core_nwb_base import ( - NWBData, - TimeSeriesReferenceVectorData, - Image, - ImageReferences, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -from ...hdmf_common.v1_8_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_8_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_8_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) from numpydantic import NDArray, Shape +from ...core.v2_7_0.core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync metamodel_version = "None" version = "2.7.0" @@ -71,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 fec82a0..474d3d7 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 @@ -66,7 +66,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 4cf34de..46d16a7 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 @@ -52,21 +52,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 a8777ed..c687196 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 @@ -5,41 +5,6 @@ from enum import Enum import re import sys import numpy as np -from ...core.v2_7_0.core_nwb_device import Device -from ...core.v2_7_0.core_nwb_base import ( - NWBData, - TimeSeriesReferenceVectorData, - Image, - ImageReferences, - NWBContainer, - NWBDataInterface, - TimeSeries, - TimeSeriesData, - TimeSeriesStartingTime, - TimeSeriesSync, - ProcessingModule, - Images, -) -from ...hdmf_common.v1_8_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_8_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_8_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) -from ...core.v2_7_0.core_nwb_image import ( - GrayscaleImage, - RGBImage, - RGBAImage, - ImageSeries, - ImageSeriesExternalFile, - ImageMaskSeries, - OpticalSeries, - IndexSeries, -) from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from pydantic import ( BaseModel, @@ -51,6 +16,20 @@ from pydantic import ( BeforeValidator, ) from numpydantic import NDArray, Shape +from ...hdmf_common.v1_8_0.hdmf_common_table import ( + DynamicTableRegion, + DynamicTable, + VectorIndex, + VectorData, +) +from ...core.v2_7_0.core_nwb_image import ImageSeries, ImageSeriesExternalFile +from ...core.v2_7_0.core_nwb_base import ( + TimeSeriesStartingTime, + TimeSeriesSync, + TimeSeries, + NWBDataInterface, + NWBContainer, +) metamodel_version = "None" version = "2.7.0" @@ -93,7 +72,8 @@ NUMPYDANTIC_VERSION = "1.2.1" 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): 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 b490866..f65ed6c 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 @@ -47,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 e252a50..0b75bec 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 @@ -46,21 +46,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 4d962bd..ae84bd1 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 @@ -46,21 +46,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 d2aa6c8..e520f5f 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 @@ -7,7 +7,7 @@ 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_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer +from ...hdmf_common.v1_5_0.hdmf_common_base import Container from numpydantic import NDArray, Shape metamodel_version = "None" @@ -47,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 d43ac03..9e2b445 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 @@ -47,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 ea89600..230460c 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 @@ -7,7 +7,7 @@ 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_8_0.hdmf_common_base import Data, Container, SimpleMultiContainer +from ...hdmf_common.v1_8_0.hdmf_common_base import Container from numpydantic import NDArray, Shape metamodel_version = "None" @@ -47,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { 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 efff5ec..46ad6ef 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 @@ -47,21 +47,6 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" - -ModelType = TypeVar("ModelType", bound=Type[BaseModel]) - - -def _get_name(item: BaseModel | dict, info: ValidationInfo): - assert isinstance(item, (BaseModel, dict)) - name = info.field_name - if isinstance(item, BaseModel): - item.name = name - else: - item["name"] = name - return item - - -Named = Annotated[ModelType, BeforeValidator(_get_name)] linkml_meta = LinkMLMeta( { "annotations": { diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/__init__.py @@ -0,0 +1 @@ + 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 090e4cd..81104c3 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 @@ -7,16 +7,7 @@ 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_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) +from ...hdmf_common.v1_5_0.hdmf_common_table import VectorData metamodel_version = "None" version = "0.1.0" 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 57d1635..db8a186 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 @@ -7,16 +7,7 @@ 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_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) +from ...hdmf_common.v1_5_0.hdmf_common_base import Container, Data metamodel_version = "None" version = "0.1.0" diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_5_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_5_0/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_5_0/__init__.py @@ -0,0 +1 @@ + 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 e43d2ea..ac60310 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 @@ -7,16 +7,7 @@ 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_8_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_8_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_8_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) +from ...hdmf_common.v1_8_0.hdmf_common_table import VectorData metamodel_version = "None" version = "0.5.0" 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 867b122..cde0cca 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 @@ -7,16 +7,7 @@ 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_8_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_8_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_8_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) +from ...hdmf_common.v1_8_0.hdmf_common_base import Container, Data metamodel_version = "None" version = "0.5.0" diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.base.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.base.yaml index 3bddf3d..ae17645 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.base.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.base.yaml @@ -107,6 +107,12 @@ classes: name: name range: string required: true + image: + name: image + description: Ordered dataset of references to Image objects. + range: Image + required: true + multivalued: true tree_root: true NWBContainer: name: NWBContainer diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.base.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.base.yaml index 6bbbcfe..df86c7a 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.base.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.base.yaml @@ -107,6 +107,12 @@ classes: name: name range: string required: true + image: + name: image + description: Ordered dataset of references to Image objects. + range: Image + required: true + multivalued: true tree_root: true NWBContainer: name: NWBContainer diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_7_0/core.nwb.base.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_7_0/core.nwb.base.yaml index d948d77..b21d698 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_7_0/core.nwb.base.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_7_0/core.nwb.base.yaml @@ -107,6 +107,12 @@ classes: name: name range: string required: true + image: + name: image + description: Ordered dataset of references to Image objects. + range: Image + required: true + multivalued: true tree_root: true NWBContainer: name: NWBContainer diff --git a/scripts/generate_core.py b/scripts/generate_core.py index efa9252..e711e0e 100644 --- a/scripts/generate_core.py +++ b/scripts/generate_core.py @@ -102,12 +102,9 @@ def generate_versions(yaml_path:Path, pydantic_path:Path, dry_run:bool=False): # build pydantic ns_files = [res['namespace'] for res in linkml_res.values()] - all_schema = [] - for ns_file in ns_files: - all_schema.extend(list(ns_file.parent.glob('*.yaml'))) - pydantic_task = build_progress.add_task('', name=version, action='', total=len(all_schema)) - for schema in all_schema: + pydantic_task = build_progress.add_task('', name=version, action='', total=len(ns_files)) + for schema in ns_files: pbar_string = ' - '.join([schema.parts[-3], schema.parts[-2], schema.parts[-1]]) build_progress.update(pydantic_task, action=pbar_string) pydantic_provider.build(schema, versions=core_ns.versions, split=True)