diff --git a/nwb_linkml/tests/test_io/test_io_nwb.py b/nwb_linkml/tests/test_io/test_io_nwb.py index b91c64f..88cded3 100644 --- a/nwb_linkml/tests/test_io/test_io_nwb.py +++ b/nwb_linkml/tests/test_io/test_io_nwb.py @@ -73,8 +73,14 @@ def test_nwbfile_dump(read_nwbfile): electrodes = read_nwbfile.general.extracellular_ephys.electrodes.model_dump_json( round_trip=True ) + data = read_nwbfile.general.model_dump_json(round_trip=True) + + file = read_nwbfile.model_dump_json( + round_trip=True, exclude_none=True, exclude_unset=True, exclude_defaults=True + ) + # data = read_nwbfile.model_dump_json(round_trip=True, serialize_as_any=True) - # pdb.set_trace() + pdb.set_trace() def test_timeseries(read_nwbfile, read_pynwb): diff --git a/nwb_models/src/nwb_models/models/pydantic/core/v2_7_0/core_nwb_base.py b/nwb_models/src/nwb_models/models/pydantic/core/v2_7_0/core_nwb_base.py index 6c8a7fb..408a7e2 100644 --- a/nwb_models/src/nwb_models/models/pydantic/core/v2_7_0/core_nwb_base.py +++ b/nwb_models/src/nwb_models/models/pydantic/core/v2_7_0/core_nwb_base.py @@ -17,10 +17,10 @@ from typing import ( Optional, Tuple, Type, - TypeVar, Union, overload, ) +from typing_extensions import TypeVar import numpy as np from numpydantic import NDArray, Shape @@ -154,7 +154,7 @@ class LinkMLMeta(RootModel): NUMPYDANTIC_VERSION = "1.2.1" -T = TypeVar("T", bound=NDArray) +T = TypeVar("T", default=NDArray) class VectorDataMixin(ConfiguredBaseModel, Generic[T]): @@ -364,7 +364,7 @@ class TimeSeriesReferenceVectorData(TimeSeriesReferenceVectorDataMixin, VectorDa description="""Number of data samples available in this time series, during this epoch""", json_schema_extra={"linkml_meta": {"array": {"exact_number_dimensions": 1}}}, ) - timeseries: NDArray[Shape["*"], TimeSeries] = Field( + timeseries: List[TimeSeries] = Field( ..., description="""The TimeSeries that this index applies to""", json_schema_extra={"linkml_meta": {"array": {"exact_number_dimensions": 1}}},