regenerate models after fixing classvar mutation in numpydantic linkml branch

This commit is contained in:
sneakers-the-rat 2024-07-29 17:34:28 -07:00
parent f955c2acc3
commit 19e49cf68d
Signed by untrusted user who does not match committer: jonny
GPG key ID: 6DCB96EF1E4D232D
127 changed files with 474 additions and 3292 deletions

View file

@ -42,7 +42,7 @@ from typing import ClassVar, Dict, List, Optional, Tuple, Type, Union
from linkml.generators import PydanticGenerator from linkml.generators import PydanticGenerator
from linkml.generators.pydanticgen.build import SlotResult from linkml.generators.pydanticgen.build import SlotResult
from linkml.generators.pydanticgen.array import ArrayRepresentation, NumpydanticArray 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 ( from linkml_runtime.linkml_model.meta import (
Annotation, Annotation,
AnonymousSlotExpression, AnonymousSlotExpression,
@ -203,7 +203,9 @@ class AfterGenerateSlot:
slot.injected_classes = named_injects slot.injected_classes = named_injects
else: else:
slot.injected_classes.extend([ModelTypeString, _get_name, NamedString]) 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 slot.imports += NamedImports
else: else:
slot.imports = NamedImports slot.imports = NamedImports

View file

@ -47,21 +47,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -7,60 +7,14 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np import numpy as np
from ...core.v2_2_0.core_nwb_misc import ( from numpydantic import NDArray, Shape
AbstractFeatureSeries, from ...core.v2_2_0.core_nwb_misc import IntervalSeries
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 ...core.v2_2_0.core_nwb_base import ( from ...core.v2_2_0.core_nwb_base import (
NWBData,
Image,
NWBContainer,
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeriesSync, TimeSeriesSync,
ProcessingModule, NWBDataInterface,
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
metamodel_version = "None" metamodel_version = "None"
version = "2.2.0" version = "2.2.0"
@ -99,21 +53,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -64,7 +64,8 @@ class LinkMLMeta(RootModel):
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -7,107 +7,21 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np import numpy as np
from ...core.v2_2_0.core_nwb_misc import ( from ...core.v2_2_0.core_nwb_epoch import TimeIntervals
AbstractFeatureSeries, from ...core.v2_2_0.core_nwb_misc import Units
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 ...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 ( from ...core.v2_2_0.core_nwb_base import (
NWBData,
Image,
NWBContainer, NWBContainer,
NWBDataInterface, NWBDataInterface,
TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime,
TimeSeriesSync,
ProcessingModule, ProcessingModule,
Images, TimeSeries,
)
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,
) )
from ...core.v2_2_0.core_nwb_ecephys import ElectrodeGroup
from numpydantic import NDArray, Shape 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" metamodel_version = "None"
version = "2.2.0" version = "2.2.0"
@ -146,21 +60,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -5,34 +5,11 @@ from enum import Enum
import re import re
import sys import sys
import numpy as np 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 ( from ...core.v2_2_0.core_nwb_base import (
NWBData,
Image,
NWBContainer,
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeriesSync, TimeSeriesSync,
ProcessingModule, NWBContainer,
Images,
) )
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import ( from pydantic import (
@ -45,6 +22,7 @@ from pydantic import (
BeforeValidator, BeforeValidator,
) )
from numpydantic import NDArray, Shape from numpydantic import NDArray, Shape
from ...hdmf_common.v1_1_0.hdmf_common_table import DynamicTable, VectorIndex, VectorData
metamodel_version = "None" metamodel_version = "None"
version = "2.2.0" version = "2.2.0"
@ -87,7 +65,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -7,35 +7,8 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np 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 numpydantic import NDArray, Shape
from ...core.v2_2_0.core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync
metamodel_version = "None" metamodel_version = "None"
version = "2.2.0" version = "2.2.0"
@ -74,21 +47,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -66,7 +66,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -52,21 +52,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -5,45 +5,7 @@ from enum import Enum
import re import re
import sys import sys
import numpy as np import numpy as np
from ...core.v2_2_0.core_nwb_device import Device from ...core.v2_2_0.core_nwb_image import ImageSeries, ImageSeriesExternalFile
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 typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import ( from pydantic import (
BaseModel, BaseModel,
@ -54,7 +16,15 @@ from pydantic import (
ValidationInfo, ValidationInfo,
BeforeValidator, BeforeValidator,
) )
from ...hdmf_common.v1_1_0.hdmf_common_table import DynamicTableRegion, DynamicTable
from numpydantic import NDArray, Shape from numpydantic import NDArray, Shape
from ...core.v2_2_0.core_nwb_base import (
TimeSeriesStartingTime,
TimeSeriesSync,
TimeSeries,
NWBDataInterface,
NWBContainer,
)
metamodel_version = "None" metamodel_version = "None"
version = "2.2.0" version = "2.2.0"
@ -97,7 +67,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -47,21 +47,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -7,60 +7,14 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np import numpy as np
from ...core.v2_2_1.core_nwb_misc import ( from numpydantic import NDArray, Shape
AbstractFeatureSeries, from ...core.v2_2_1.core_nwb_misc import IntervalSeries
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 ...core.v2_2_1.core_nwb_base import ( from ...core.v2_2_1.core_nwb_base import (
NWBData,
Image,
NWBContainer,
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeriesSync, TimeSeriesSync,
ProcessingModule, NWBDataInterface,
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
metamodel_version = "None" metamodel_version = "None"
version = "2.2.1" version = "2.2.1"
@ -99,21 +53,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -64,7 +64,8 @@ class LinkMLMeta(RootModel):
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -7,107 +7,21 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np import numpy as np
from ...core.v2_2_1.core_nwb_misc import ( from ...core.v2_2_1.core_nwb_epoch import TimeIntervals
AbstractFeatureSeries, from ...core.v2_2_1.core_nwb_misc import Units
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 ...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 ( from ...core.v2_2_1.core_nwb_base import (
NWBData,
Image,
NWBContainer, NWBContainer,
NWBDataInterface, NWBDataInterface,
TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime,
TimeSeriesSync,
ProcessingModule, ProcessingModule,
Images, TimeSeries,
)
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,
) )
from ...core.v2_2_1.core_nwb_ecephys import ElectrodeGroup
from numpydantic import NDArray, Shape 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" metamodel_version = "None"
version = "2.2.1" version = "2.2.1"
@ -146,21 +60,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -5,34 +5,11 @@ from enum import Enum
import re import re
import sys import sys
import numpy as np 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 ( from ...core.v2_2_1.core_nwb_base import (
NWBData,
Image,
NWBContainer,
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeriesSync, TimeSeriesSync,
ProcessingModule, NWBContainer,
Images,
) )
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import ( from pydantic import (
@ -45,6 +22,7 @@ from pydantic import (
BeforeValidator, BeforeValidator,
) )
from numpydantic import NDArray, Shape from numpydantic import NDArray, Shape
from ...hdmf_common.v1_1_2.hdmf_common_table import DynamicTable, VectorIndex, VectorData
metamodel_version = "None" metamodel_version = "None"
version = "2.2.1" version = "2.2.1"
@ -87,7 +65,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -7,35 +7,8 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np 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 numpydantic import NDArray, Shape
from ...core.v2_2_1.core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync
metamodel_version = "None" metamodel_version = "None"
version = "2.2.1" version = "2.2.1"
@ -74,21 +47,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -66,7 +66,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -52,21 +52,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -5,45 +5,7 @@ from enum import Enum
import re import re
import sys import sys
import numpy as np import numpy as np
from ...core.v2_2_1.core_nwb_device import Device from ...core.v2_2_1.core_nwb_image import ImageSeries, ImageSeriesExternalFile
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 typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import ( from pydantic import (
BaseModel, BaseModel,
@ -54,7 +16,15 @@ from pydantic import (
ValidationInfo, ValidationInfo,
BeforeValidator, BeforeValidator,
) )
from ...hdmf_common.v1_1_2.hdmf_common_table import DynamicTableRegion, DynamicTable
from numpydantic import NDArray, Shape from numpydantic import NDArray, Shape
from ...core.v2_2_1.core_nwb_base import (
TimeSeriesStartingTime,
TimeSeriesSync,
TimeSeries,
NWBDataInterface,
NWBContainer,
)
metamodel_version = "None" metamodel_version = "None"
version = "2.2.1" version = "2.2.1"
@ -97,7 +67,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -47,21 +47,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -7,60 +7,14 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np import numpy as np
from ...core.v2_2_2.core_nwb_misc import ( from numpydantic import NDArray, Shape
AbstractFeatureSeries, from ...core.v2_2_2.core_nwb_misc import IntervalSeries
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 ...core.v2_2_2.core_nwb_base import ( from ...core.v2_2_2.core_nwb_base import (
NWBData,
Image,
NWBContainer,
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeriesSync, TimeSeriesSync,
ProcessingModule, NWBDataInterface,
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
metamodel_version = "None" metamodel_version = "None"
version = "2.2.2" version = "2.2.2"
@ -99,21 +53,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -64,7 +64,8 @@ class LinkMLMeta(RootModel):
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -7,103 +7,21 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np import numpy as np
from ...core.v2_2_2.core_nwb_misc import ( from ...core.v2_2_2.core_nwb_epoch import TimeIntervals
AbstractFeatureSeries, from ...core.v2_2_2.core_nwb_misc import Units
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 ...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 ( from ...core.v2_2_2.core_nwb_base import (
NWBData,
Image,
NWBContainer, NWBContainer,
NWBDataInterface, NWBDataInterface,
TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime,
TimeSeriesSync,
ProcessingModule, 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_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,
) )
from ...core.v2_2_2.core_nwb_ecephys import ElectrodeGroup
from numpydantic import NDArray, Shape 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" metamodel_version = "None"
version = "2.2.2" version = "2.2.2"
@ -142,21 +60,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -5,34 +5,11 @@ from enum import Enum
import re import re
import sys import sys
import numpy as np 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 ( from ...core.v2_2_2.core_nwb_base import (
NWBData,
Image,
NWBContainer,
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeriesSync, TimeSeriesSync,
ProcessingModule, NWBContainer,
Images,
) )
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import ( from pydantic import (
@ -45,6 +22,7 @@ from pydantic import (
BeforeValidator, BeforeValidator,
) )
from numpydantic import NDArray, Shape from numpydantic import NDArray, Shape
from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTable, VectorIndex, VectorData
metamodel_version = "None" metamodel_version = "None"
version = "2.2.2" version = "2.2.2"
@ -87,7 +65,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -7,35 +7,8 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np 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 numpydantic import NDArray, Shape
from ...core.v2_2_2.core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync
metamodel_version = "None" metamodel_version = "None"
version = "2.2.2" version = "2.2.2"
@ -74,21 +47,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -66,7 +66,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -52,21 +52,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -5,45 +5,7 @@ from enum import Enum
import re import re
import sys import sys
import numpy as np import numpy as np
from ...core.v2_2_2.core_nwb_device import Device from ...core.v2_2_2.core_nwb_image import ImageSeries, ImageSeriesExternalFile
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 typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import ( from pydantic import (
BaseModel, BaseModel,
@ -55,6 +17,14 @@ from pydantic import (
BeforeValidator, BeforeValidator,
) )
from numpydantic import NDArray, Shape 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" metamodel_version = "None"
version = "2.2.2" version = "2.2.2"
@ -97,7 +67,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -47,21 +47,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -47,21 +47,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -7,60 +7,14 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np import numpy as np
from ...core.v2_2_4.core_nwb_misc import ( from numpydantic import NDArray, Shape
AbstractFeatureSeries, from ...core.v2_2_4.core_nwb_misc import IntervalSeries
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 ...core.v2_2_4.core_nwb_base import ( from ...core.v2_2_4.core_nwb_base import (
NWBData,
Image,
NWBContainer,
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeriesSync, TimeSeriesSync,
ProcessingModule, NWBDataInterface,
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
metamodel_version = "None" metamodel_version = "None"
version = "2.2.4" version = "2.2.4"
@ -99,21 +53,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -64,7 +64,8 @@ class LinkMLMeta(RootModel):
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -7,109 +7,22 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np import numpy as np
from ...core.v2_2_4.core_nwb_misc import ( from ...core.v2_2_4.core_nwb_epoch import TimeIntervals
AbstractFeatureSeries, from ...core.v2_2_4.core_nwb_misc import Units
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 ...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 ( from ...core.v2_2_4.core_nwb_base import (
NWBData, NWBData,
Image,
NWBContainer, NWBContainer,
NWBDataInterface, NWBDataInterface,
TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime,
TimeSeriesSync,
ProcessingModule, 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" metamodel_version = "None"
version = "2.2.4" version = "2.2.4"
@ -148,21 +61,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -5,34 +5,11 @@ from enum import Enum
import re import re
import sys import sys
import numpy as np 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 ( from ...core.v2_2_4.core_nwb_base import (
NWBData,
Image,
NWBContainer,
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeriesSync, TimeSeriesSync,
ProcessingModule, NWBContainer,
Images,
) )
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import ( from pydantic import (
@ -45,6 +22,7 @@ from pydantic import (
BeforeValidator, BeforeValidator,
) )
from numpydantic import NDArray, Shape from numpydantic import NDArray, Shape
from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTable, VectorIndex, VectorData
metamodel_version = "None" metamodel_version = "None"
version = "2.2.4" version = "2.2.4"
@ -87,7 +65,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -7,35 +7,8 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np 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 numpydantic import NDArray, Shape
from ...core.v2_2_4.core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync
metamodel_version = "None" metamodel_version = "None"
version = "2.2.4" version = "2.2.4"
@ -74,21 +47,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -66,7 +66,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -52,21 +52,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -5,45 +5,6 @@ from enum import Enum
import re import re
import sys import sys
import numpy as np 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 typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import ( from pydantic import (
BaseModel, BaseModel,
@ -55,6 +16,20 @@ from pydantic import (
BeforeValidator, BeforeValidator,
) )
from numpydantic import NDArray, Shape 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" metamodel_version = "None"
version = "2.2.4" version = "2.2.4"
@ -97,7 +72,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -47,21 +47,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -47,21 +47,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -7,60 +7,14 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np import numpy as np
from ...core.v2_2_5.core_nwb_misc import ( from numpydantic import NDArray, Shape
AbstractFeatureSeries, from ...core.v2_2_5.core_nwb_misc import IntervalSeries
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 ...core.v2_2_5.core_nwb_base import ( from ...core.v2_2_5.core_nwb_base import (
NWBData,
Image,
NWBContainer,
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeriesSync, TimeSeriesSync,
ProcessingModule, NWBDataInterface,
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
metamodel_version = "None" metamodel_version = "None"
version = "2.2.5" version = "2.2.5"
@ -99,21 +53,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -64,7 +64,8 @@ class LinkMLMeta(RootModel):
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -7,109 +7,22 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np import numpy as np
from ...core.v2_2_5.core_nwb_misc import ( from ...core.v2_2_5.core_nwb_epoch import TimeIntervals
AbstractFeatureSeries, from ...core.v2_2_5.core_nwb_misc import Units
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 ...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 ( from ...core.v2_2_5.core_nwb_base import (
NWBData, NWBData,
Image,
NWBContainer, NWBContainer,
NWBDataInterface, NWBDataInterface,
TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime,
TimeSeriesSync,
ProcessingModule, 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" metamodel_version = "None"
version = "2.2.5" version = "2.2.5"
@ -148,21 +61,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -5,34 +5,11 @@ from enum import Enum
import re import re
import sys import sys
import numpy as np 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 ( from ...core.v2_2_5.core_nwb_base import (
NWBData,
Image,
NWBContainer,
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeriesSync, TimeSeriesSync,
ProcessingModule, NWBContainer,
Images,
) )
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import ( from pydantic import (
@ -45,6 +22,7 @@ from pydantic import (
BeforeValidator, BeforeValidator,
) )
from numpydantic import NDArray, Shape from numpydantic import NDArray, Shape
from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTable, VectorIndex, VectorData
metamodel_version = "None" metamodel_version = "None"
version = "2.2.5" version = "2.2.5"
@ -87,7 +65,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -7,35 +7,8 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np 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 numpydantic import NDArray, Shape
from ...core.v2_2_5.core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync
metamodel_version = "None" metamodel_version = "None"
version = "2.2.5" version = "2.2.5"
@ -74,21 +47,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -66,7 +66,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -52,21 +52,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -5,45 +5,6 @@ from enum import Enum
import re import re
import sys import sys
import numpy as np 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 typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import ( from pydantic import (
BaseModel, BaseModel,
@ -55,6 +16,20 @@ from pydantic import (
BeforeValidator, BeforeValidator,
) )
from numpydantic import NDArray, Shape 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" metamodel_version = "None"
version = "2.2.5" version = "2.2.5"
@ -97,7 +72,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -47,21 +47,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -48,21 +48,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -7,54 +7,14 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np import numpy as np
from ...core.v2_3_0.core_nwb_misc import ( from numpydantic import NDArray, Shape
AbstractFeatureSeries, from ...core.v2_3_0.core_nwb_misc import IntervalSeries
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 ...core.v2_3_0.core_nwb_base import ( from ...core.v2_3_0.core_nwb_base import (
NWBData,
Image,
NWBContainer,
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeriesSync, TimeSeriesSync,
ProcessingModule, NWBDataInterface,
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" metamodel_version = "None"
version = "2.3.0" version = "2.3.0"
@ -93,21 +53,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -64,7 +64,8 @@ class LinkMLMeta(RootModel):
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -7,103 +7,22 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np import numpy as np
from ...core.v2_3_0.core_nwb_misc import ( from ...core.v2_3_0.core_nwb_epoch import TimeIntervals
AbstractFeatureSeries, from ...core.v2_3_0.core_nwb_misc import Units
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 ...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 ( from ...core.v2_3_0.core_nwb_base import (
NWBData, NWBData,
Image,
NWBContainer, NWBContainer,
NWBDataInterface, NWBDataInterface,
TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime,
TimeSeriesSync,
ProcessingModule, 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" metamodel_version = "None"
version = "2.3.0" version = "2.3.0"
@ -142,21 +61,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -5,28 +5,11 @@ from enum import Enum
import re import re
import sys import sys
import numpy as np 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 ( from ...core.v2_3_0.core_nwb_base import (
NWBData,
Image,
NWBContainer,
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeriesSync, TimeSeriesSync,
ProcessingModule, NWBContainer,
Images,
) )
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import ( from pydantic import (
@ -39,6 +22,7 @@ from pydantic import (
BeforeValidator, BeforeValidator,
) )
from numpydantic import NDArray, Shape from numpydantic import NDArray, Shape
from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, VectorIndex, VectorData
metamodel_version = "None" metamodel_version = "None"
version = "2.3.0" version = "2.3.0"
@ -81,7 +65,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -7,30 +7,8 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np 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 numpydantic import NDArray, Shape
from ...core.v2_3_0.core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync
metamodel_version = "None" metamodel_version = "None"
version = "2.3.0" version = "2.3.0"
@ -69,21 +47,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -66,7 +66,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -52,21 +52,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -5,39 +5,6 @@ from enum import Enum
import re import re
import sys import sys
import numpy as np 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 typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import ( from pydantic import (
BaseModel, BaseModel,
@ -49,6 +16,20 @@ from pydantic import (
BeforeValidator, BeforeValidator,
) )
from numpydantic import NDArray, Shape 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" metamodel_version = "None"
version = "2.3.0" version = "2.3.0"
@ -91,7 +72,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -47,21 +47,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -48,21 +48,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -7,55 +7,14 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np import numpy as np
from ...core.v2_4_0.core_nwb_misc import ( from numpydantic import NDArray, Shape
AbstractFeatureSeries, from ...core.v2_4_0.core_nwb_misc import IntervalSeries
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 ...core.v2_4_0.core_nwb_base import ( from ...core.v2_4_0.core_nwb_base import (
NWBData,
TimeSeriesReferenceVectorData,
Image,
NWBContainer,
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeriesSync, TimeSeriesSync,
ProcessingModule, NWBDataInterface,
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" metamodel_version = "None"
version = "2.4.0" version = "2.4.0"
@ -94,21 +53,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -64,7 +64,8 @@ class LinkMLMeta(RootModel):
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -7,116 +7,30 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np import numpy as np
from ...core.v2_4_0.core_nwb_misc import ( from ...core.v2_4_0.core_nwb_epoch import TimeIntervals
AbstractFeatureSeries, from ...core.v2_4_0.core_nwb_misc import Units
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 ...core.v2_4_0.core_nwb_device import Device
from ...core.v2_4_0.core_nwb_base import ( from ...core.v2_4_0.core_nwb_ogen import OptogeneticStimulusSite
NWBData, from ...core.v2_4_0.core_nwb_ophys import ImagingPlane
TimeSeriesReferenceVectorData, from ...core.v2_4_0.core_nwb_ecephys import ElectrodeGroup
Image, from numpydantic import NDArray, Shape
NWBContainer, from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, VectorData
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_icephys import ( 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, IntracellularElectrode,
SweepTable, SweepTable,
IntracellularElectrodesTable,
IntracellularStimuliTable,
IntracellularResponsesTable,
IntracellularRecordingsTable, IntracellularRecordingsTable,
SimultaneousRecordingsTable, SimultaneousRecordingsTable,
SimultaneousRecordingsTableRecordings,
SequentialRecordingsTable, SequentialRecordingsTable,
SequentialRecordingsTableSimultaneousRecordings,
RepetitionsTable, RepetitionsTable,
RepetitionsTableSequentialRecordings,
ExperimentalConditionsTable, ExperimentalConditionsTable,
ExperimentalConditionsTableRepetitions,
) )
from numpydantic import NDArray, Shape from ...core.v2_4_0.core_nwb_base import (
NWBData,
NWBContainer,
NWBDataInterface,
ProcessingModule,
TimeSeries,
)
metamodel_version = "None" metamodel_version = "None"
version = "2.4.0" version = "2.4.0"
@ -155,21 +69,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -5,29 +5,12 @@ from enum import Enum
import re import re
import sys import sys
import numpy as np 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 ( from ...core.v2_4_0.core_nwb_base import (
NWBData,
TimeSeriesReferenceVectorData,
Image,
NWBContainer,
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeriesSync, TimeSeriesSync,
ProcessingModule, NWBContainer,
Images, TimeSeriesReferenceVectorData,
) )
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import ( from pydantic import (
@ -40,6 +23,13 @@ from pydantic import (
BeforeValidator, BeforeValidator,
) )
from numpydantic import NDArray, Shape from numpydantic import NDArray, Shape
from ...hdmf_common.v1_5_0.hdmf_common_table import (
DynamicTable,
VectorIndex,
VectorData,
AlignedDynamicTable,
DynamicTableRegion,
)
metamodel_version = "None" metamodel_version = "None"
version = "2.4.0" version = "2.4.0"
@ -82,7 +72,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -7,31 +7,8 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np 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 numpydantic import NDArray, Shape
from ...core.v2_4_0.core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync
metamodel_version = "None" metamodel_version = "None"
version = "2.4.0" version = "2.4.0"
@ -70,21 +47,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -66,7 +66,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -52,21 +52,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -5,40 +5,6 @@ from enum import Enum
import re import re
import sys import sys
import numpy as np 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 typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import ( from pydantic import (
BaseModel, BaseModel,
@ -50,6 +16,20 @@ from pydantic import (
BeforeValidator, BeforeValidator,
) )
from numpydantic import NDArray, Shape 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" metamodel_version = "None"
version = "2.4.0" version = "2.4.0"
@ -92,7 +72,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -47,21 +47,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):
@ -168,6 +169,9 @@ class ImageReferences(NWBData):
) )
name: str = Field(...) name: str = Field(...)
image: List[Image] = Field(
..., description="""Ordered dataset of references to Image objects."""
)
class NWBContainer(Container): class NWBContainer(Container):

View file

@ -7,56 +7,14 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np import numpy as np
from ...core.v2_5_0.core_nwb_misc import ( from numpydantic import NDArray, Shape
AbstractFeatureSeries, from ...core.v2_5_0.core_nwb_misc import IntervalSeries
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 ( from ...core.v2_5_0.core_nwb_base import (
NWBData,
TimeSeriesReferenceVectorData,
Image,
ImageReferences,
NWBContainer,
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeriesSync, TimeSeriesSync,
ProcessingModule, NWBDataInterface,
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" metamodel_version = "None"
version = "2.5.0" version = "2.5.0"
@ -95,21 +53,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -64,7 +64,8 @@ class LinkMLMeta(RootModel):
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -7,117 +7,31 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np 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_epoch import TimeIntervals
from ...core.v2_5_0.core_nwb_ophys import ( from ...core.v2_5_0.core_nwb_misc import Units
TwoPhotonSeries, from ...core.v2_5_0.core_nwb_device import Device
RoiResponseSeries, from ...core.v2_5_0.core_nwb_ogen import OptogeneticStimulusSite
DfOverF, from ...core.v2_5_0.core_nwb_ophys import ImagingPlane
Fluorescence, from ...core.v2_5_0.core_nwb_ecephys import ElectrodeGroup
ImageSegmentation, from numpydantic import NDArray, Shape
PlaneSegmentation, from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, VectorData
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_icephys import ( 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, IntracellularElectrode,
SweepTable, SweepTable,
IntracellularElectrodesTable,
IntracellularStimuliTable,
IntracellularResponsesTable,
IntracellularRecordingsTable, IntracellularRecordingsTable,
SimultaneousRecordingsTable, SimultaneousRecordingsTable,
SimultaneousRecordingsTableRecordings,
SequentialRecordingsTable, SequentialRecordingsTable,
SequentialRecordingsTableSimultaneousRecordings,
RepetitionsTable, RepetitionsTable,
RepetitionsTableSequentialRecordings,
ExperimentalConditionsTable, 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" metamodel_version = "None"
version = "2.5.0" version = "2.5.0"
@ -156,21 +70,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -5,30 +5,12 @@ from enum import Enum
import re import re
import sys import sys
import numpy as np 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 ( from ...core.v2_5_0.core_nwb_base import (
NWBData,
TimeSeriesReferenceVectorData,
Image,
ImageReferences,
NWBContainer,
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeriesSync, TimeSeriesSync,
ProcessingModule, NWBContainer,
Images, TimeSeriesReferenceVectorData,
) )
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import ( from pydantic import (
@ -41,6 +23,13 @@ from pydantic import (
BeforeValidator, BeforeValidator,
) )
from numpydantic import NDArray, Shape from numpydantic import NDArray, Shape
from ...hdmf_common.v1_5_0.hdmf_common_table import (
DynamicTable,
VectorIndex,
VectorData,
AlignedDynamicTable,
DynamicTableRegion,
)
metamodel_version = "None" metamodel_version = "None"
version = "2.5.0" version = "2.5.0"
@ -83,7 +72,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -7,32 +7,8 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np 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 numpydantic import NDArray, Shape
from ...core.v2_5_0.core_nwb_base import Image, TimeSeries, TimeSeriesStartingTime, TimeSeriesSync
metamodel_version = "None" metamodel_version = "None"
version = "2.5.0" version = "2.5.0"
@ -71,21 +47,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -66,7 +66,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -52,21 +52,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -5,41 +5,6 @@ from enum import Enum
import re import re
import sys import sys
import numpy as np 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 typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import ( from pydantic import (
BaseModel, BaseModel,
@ -51,6 +16,20 @@ from pydantic import (
BeforeValidator, BeforeValidator,
) )
from numpydantic import NDArray, Shape 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" metamodel_version = "None"
version = "2.5.0" version = "2.5.0"
@ -93,7 +72,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -47,21 +47,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):
@ -168,6 +169,9 @@ class ImageReferences(NWBData):
) )
name: str = Field(...) name: str = Field(...)
image: List[Image] = Field(
..., description="""Ordered dataset of references to Image objects."""
)
class NWBContainer(Container): class NWBContainer(Container):

View file

@ -7,56 +7,14 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np import numpy as np
from ...core.v2_6_0_alpha.core_nwb_misc import ( from numpydantic import NDArray, Shape
AbstractFeatureSeries, from ...core.v2_6_0_alpha.core_nwb_misc import IntervalSeries
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 ( from ...core.v2_6_0_alpha.core_nwb_base import (
NWBData,
TimeSeriesReferenceVectorData,
Image,
ImageReferences,
NWBContainer,
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeriesSync, TimeSeriesSync,
ProcessingModule, NWBDataInterface,
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" metamodel_version = "None"
version = "2.6.0-alpha" version = "2.6.0-alpha"
@ -95,21 +53,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -64,7 +64,8 @@ class LinkMLMeta(RootModel):
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -60,7 +60,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -7,118 +7,31 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np 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_epoch import TimeIntervals
from ...core.v2_6_0_alpha.core_nwb_ophys import ( from ...core.v2_6_0_alpha.core_nwb_misc import Units
OnePhotonSeries, from ...core.v2_6_0_alpha.core_nwb_device import Device
TwoPhotonSeries, from ...core.v2_6_0_alpha.core_nwb_ogen import OptogeneticStimulusSite
RoiResponseSeries, from ...core.v2_6_0_alpha.core_nwb_ophys import ImagingPlane
DfOverF, from ...core.v2_6_0_alpha.core_nwb_ecephys import ElectrodeGroup
Fluorescence, from numpydantic import NDArray, Shape
ImageSegmentation, from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, VectorData
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_icephys import ( 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, IntracellularElectrode,
SweepTable, SweepTable,
IntracellularElectrodesTable,
IntracellularStimuliTable,
IntracellularResponsesTable,
IntracellularRecordingsTable, IntracellularRecordingsTable,
SimultaneousRecordingsTable, SimultaneousRecordingsTable,
SimultaneousRecordingsTableRecordings,
SequentialRecordingsTable, SequentialRecordingsTable,
SequentialRecordingsTableSimultaneousRecordings,
RepetitionsTable, RepetitionsTable,
RepetitionsTableSequentialRecordings,
ExperimentalConditionsTable, 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" metamodel_version = "None"
version = "2.6.0-alpha" version = "2.6.0-alpha"
@ -157,21 +70,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -5,30 +5,12 @@ from enum import Enum
import re import re
import sys import sys
import numpy as np 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 ( from ...core.v2_6_0_alpha.core_nwb_base import (
NWBData,
TimeSeriesReferenceVectorData,
Image,
ImageReferences,
NWBContainer,
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeriesSync, TimeSeriesSync,
ProcessingModule, NWBContainer,
Images, TimeSeriesReferenceVectorData,
) )
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import ( from pydantic import (
@ -41,6 +23,13 @@ from pydantic import (
BeforeValidator, BeforeValidator,
) )
from numpydantic import NDArray, Shape from numpydantic import NDArray, Shape
from ...hdmf_common.v1_5_0.hdmf_common_table import (
DynamicTable,
VectorIndex,
VectorData,
AlignedDynamicTable,
DynamicTableRegion,
)
metamodel_version = "None" metamodel_version = "None"
version = "2.6.0-alpha" version = "2.6.0-alpha"
@ -83,7 +72,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -7,32 +7,13 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np 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 ( from ...core.v2_6_0_alpha.core_nwb_base import (
NWBData,
TimeSeriesReferenceVectorData,
Image, Image,
ImageReferences,
NWBContainer,
NWBDataInterface,
TimeSeries, TimeSeries,
TimeSeriesData,
TimeSeriesStartingTime, TimeSeriesStartingTime,
TimeSeriesSync, 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" metamodel_version = "None"
version = "2.6.0-alpha" version = "2.6.0-alpha"
@ -71,21 +52,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -66,7 +66,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -52,21 +52,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

View file

@ -5,41 +5,6 @@ from enum import Enum
import re import re
import sys import sys
import numpy as np 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 typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import ( from pydantic import (
BaseModel, BaseModel,
@ -51,6 +16,20 @@ from pydantic import (
BeforeValidator, BeforeValidator,
) )
from numpydantic import NDArray, Shape 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" metamodel_version = "None"
version = "2.6.0-alpha" version = "2.6.0-alpha"
@ -93,7 +72,8 @@ NUMPYDANTIC_VERSION = "1.2.1"
ModelType = TypeVar("ModelType", bound=Type[BaseModel]) 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)) assert isinstance(item, (BaseModel, dict))
name = info.field_name name = info.field_name
if isinstance(item, BaseModel): if isinstance(item, BaseModel):

View file

@ -47,21 +47,6 @@ class LinkMLMeta(RootModel):
NUMPYDANTIC_VERSION = "1.2.1" 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( linkml_meta = LinkMLMeta(
{ {
"annotations": { "annotations": {

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