diff --git a/nwb_linkml/src/nwb_linkml/generators/pydantic.py b/nwb_linkml/src/nwb_linkml/generators/pydantic.py index 59f7d4a..d3d8395 100644 --- a/nwb_linkml/src/nwb_linkml/generators/pydantic.py +++ b/nwb_linkml/src/nwb_linkml/generators/pydantic.py @@ -38,7 +38,6 @@ class NWBPydanticGenerator(PydanticGenerator): Subclass of pydantic generator, custom behavior is in overridden lifecycle methods :) """ - injected_fields: List[str] = ( ( 'hdf5_path: Optional[str] = Field(None, description="The absolute path that this object' diff --git a/nwb_linkml/src/nwb_linkml/lang_elements.py b/nwb_linkml/src/nwb_linkml/lang_elements.py index 4ebd6d4..c199062 100644 --- a/nwb_linkml/src/nwb_linkml/lang_elements.py +++ b/nwb_linkml/src/nwb_linkml/lang_elements.py @@ -33,7 +33,9 @@ def _make_dtypes() -> List[TypeDefinition]: # repr_string = f"np.{np_type.__name__}" if np_type.__module__ == "numpy" else None atype = TypeDefinition( - name=nwbtype, minimum_value=amin, typeof=linkmltype, # repr=repr_string + name=nwbtype, + minimum_value=amin, + typeof=linkmltype, # repr=repr_string ) DTypeTypes.append(atype) return DTypeTypes diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_base.py index 4bc6c35..17d7363 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_base.py @@ -83,15 +83,15 @@ class Image(NWBData): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -143,12 +143,12 @@ class TimeSeries(NWBDataInterface): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -177,11 +177,11 @@ class TimeSeriesData(ConfiguredBaseModel): "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) - conversion: Optional[np.float32] = Field( + conversion: Optional[float] = Field( None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""", ) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""", ) @@ -212,11 +212,11 @@ class TimeSeriesStartingTime(ConfiguredBaseModel): "linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"} }, ) - rate: Optional[np.float32] = Field(None, description="""Sampling rate, in Hz.""") + rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""") unit: Optional[str] = Field( None, description="""Unit of measurement for time, which is fixed to 'seconds'.""" ) - value: np.float64 = Field(...) + value: float = Field(...) class TimeSeriesSync(ConfiguredBaseModel): diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_behavior.py index e574c6b..c258f24 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_behavior.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_behavior.py @@ -93,12 +93,12 @@ class SpatialSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -133,8 +133,8 @@ class SpatialSeriesData(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_features"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_features"], float], ] ] = Field(None) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ecephys.py index 74b8d44..22d4a40 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ecephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ecephys.py @@ -108,9 +108,9 @@ class ElectricalSeries(TimeSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_channels"], np.number], - NDArray[Shape["* num_times, * num_channels, * num_samples"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_channels"], float], + NDArray[Shape["* num_times, * num_channels, * num_samples"], float], ] = Field(..., description="""Recorded voltage data.""") electrodes: Named[DynamicTableRegion] = Field( ..., @@ -119,7 +119,7 @@ class ElectricalSeries(TimeSeries): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( + channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field( None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}}, @@ -133,12 +133,12 @@ class ElectricalSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -167,10 +167,10 @@ class SpikeEventSeries(ElectricalSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_events, * num_samples"], np.number], - NDArray[Shape["* num_events, * num_channels, * num_samples"], np.number], + NDArray[Shape["* num_events, * num_samples"], float], + NDArray[Shape["* num_events, * num_channels, * num_samples"], float], ] = Field(..., description="""Spike waveforms.""") - timestamps: NDArray[Shape["* num_times"], np.float64] = Field( + timestamps: NDArray[Shape["* num_times"], float] = Field( ..., description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -182,7 +182,7 @@ class SpikeEventSeries(ElectricalSeries): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( + channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field( None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}}, @@ -196,7 +196,7 @@ class SpikeEventSeries(ElectricalSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -232,7 +232,7 @@ class FeatureExtraction(NWBDataInterface): description="""Description of features (eg, ''PC1'') for each of the extracted features.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_features"}]}}}, ) - features: NDArray[Shape["* num_events, * num_channels, * num_features"], np.float32] = Field( + features: NDArray[Shape["* num_events, * num_channels, * num_features"], float] = Field( ..., description="""Multi-dimensional array of features extracted from each event.""", json_schema_extra={ @@ -247,7 +247,7 @@ class FeatureExtraction(NWBDataInterface): } }, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Times of events that features correspond to (can be a link).""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, @@ -277,12 +277,12 @@ class EventDetection(NWBDataInterface): ..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""", ) - source_idx: NDArray[Shape["* num_events"], np.int32] = Field( + source_idx: NDArray[Shape["* num_events"], int] = Field( ..., description="""Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Timestamps of events, in seconds.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, @@ -367,9 +367,9 @@ class ElectrodeGroupPosition(ConfiguredBaseModel): "linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"} }, ) - x: Optional[np.float32] = Field(None, description="""x coordinate""") - y: Optional[np.float32] = Field(None, description="""y coordinate""") - z: Optional[np.float32] = Field(None, description="""z coordinate""") + x: Optional[float] = Field(None, description="""x coordinate""") + y: Optional[float] = Field(None, description="""y coordinate""") + z: Optional[float] = Field(None, description="""z coordinate""") class ClusterWaveforms(NWBDataInterface): @@ -388,7 +388,7 @@ class ClusterWaveforms(NWBDataInterface): waveform_filtering: str = Field( ..., description="""Filtering applied to data before generating mean/sd""" ) - waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( + waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], float] = Field( ..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""", json_schema_extra={ @@ -397,7 +397,7 @@ class ClusterWaveforms(NWBDataInterface): } }, ) - waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( + waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], float] = Field( ..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""", json_schema_extra={ @@ -424,17 +424,17 @@ class Clustering(NWBDataInterface): ..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""", ) - num: NDArray[Shape["* num_events"], np.int32] = Field( + num: NDArray[Shape["* num_events"], int] = Field( ..., description="""Cluster number of each event""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, ) - peak_over_rms: NDArray[Shape["* num_clusters"], np.float32] = Field( + peak_over_rms: NDArray[Shape["* num_clusters"], float] = Field( ..., description="""Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}]}}}, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_epoch.py index d802c37..1cf2bb7 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_epoch.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_epoch.py @@ -96,7 +96,7 @@ class TimeIntervals(DynamicTable): ) name: str = Field(...) - start_time: NDArray[Any, np.float32] = Field( + start_time: NDArray[Any, float] = Field( ..., description="""Start time of epoch, in seconds.""", json_schema_extra={ @@ -105,7 +105,7 @@ class TimeIntervals(DynamicTable): } }, ) - stop_time: NDArray[Any, np.float32] = Field( + stop_time: NDArray[Any, float] = Field( ..., description="""Stop time of epoch, in seconds.""", json_schema_extra={ @@ -173,11 +173,11 @@ class TimeIntervalsTimeseries(VectorData): "linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"} }, ) - idx_start: Optional[np.int32] = Field( + idx_start: Optional[int] = Field( None, description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) - count: Optional[np.int32] = Field( + count: Optional[int] = Field( None, description="""Number of data samples available in this time series, during this epoch.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_file.py index cf1adbd..397abf7 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_file.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_file.py @@ -102,7 +102,7 @@ class NWBFile(NWBContainer): None, description="""File version string. Use semantic versioning, e.g. 1.2.1. This will be the name of the format with trailing major, minor and patch numbers.""", ) - file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = Field( + file_create_date: NDArray[Shape["* num_modifications"], datetime] = Field( ..., description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""", json_schema_extra={ @@ -116,11 +116,11 @@ class NWBFile(NWBContainer): session_description: str = Field( ..., description="""A description of the experimental session and data in the file.""" ) - session_start_time: np.datetime64 = Field( + session_start_time: datetime = Field( ..., description="""Date and time of the experiment/session start. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds.""", ) - timestamps_reference_time: np.datetime64 = Field( + timestamps_reference_time: datetime = Field( ..., description="""Date and time corresponding to time zero of all timestamps. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. All times stored in the file use this time as reference (i.e., time zero).""", ) @@ -335,7 +335,7 @@ class Subject(NWBContainer): age: Optional[str] = Field( None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""" ) - date_of_birth: Optional[np.datetime64] = Field( + date_of_birth: Optional[datetime] = Field( None, description="""Date of birth of subject. Can be supplied instead of 'age'.""" ) description: Optional[str] = Field( @@ -394,7 +394,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): "linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"} }, ) - x: NDArray[Any, np.float32] = Field( + x: NDArray[Any, float] = Field( ..., description="""x coordinate of the channel location in the brain (+x is posterior).""", json_schema_extra={ @@ -403,7 +403,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - y: NDArray[Any, np.float32] = Field( + y: NDArray[Any, float] = Field( ..., description="""y coordinate of the channel location in the brain (+y is inferior).""", json_schema_extra={ @@ -412,7 +412,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - z: NDArray[Any, np.float32] = Field( + z: NDArray[Any, float] = Field( ..., description="""z coordinate of the channel location in the brain (+z is right).""", json_schema_extra={ @@ -421,7 +421,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - imp: NDArray[Any, np.float32] = Field( + imp: NDArray[Any, float] = Field( ..., description="""Impedance of the channel.""", json_schema_extra={ @@ -439,7 +439,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - filtering: NDArray[Any, np.float32] = Field( + filtering: NDArray[Any, float] = Field( ..., description="""Description of hardware filtering.""", json_schema_extra={ @@ -460,7 +460,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_x: Optional[NDArray[Any, np.float32]] = Field( + rel_x: Optional[NDArray[Any, float]] = Field( None, description="""x coordinate in electrode group""", json_schema_extra={ @@ -469,7 +469,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_y: Optional[NDArray[Any, np.float32]] = Field( + rel_y: Optional[NDArray[Any, float]] = Field( None, description="""y coordinate in electrode group""", json_schema_extra={ @@ -478,7 +478,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_z: Optional[NDArray[Any, np.float32]] = Field( + rel_z: Optional[NDArray[Any, float]] = Field( None, description="""z coordinate in electrode group""", json_schema_extra={ diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_icephys.py index 7eb4679..8d6da27 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_icephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_icephys.py @@ -109,11 +109,11 @@ class PatchClampSeries(TimeSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""") - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -126,12 +126,12 @@ class PatchClampSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -164,7 +164,7 @@ class PatchClampSeriesData(ConfiguredBaseModel): None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) - array: Optional[NDArray[Shape["* num_times"], np.number]] = Field( + array: Optional[NDArray[Shape["* num_times"], float]] = Field( None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}} ) @@ -180,18 +180,18 @@ class CurrentClampSeries(PatchClampSeries): name: str = Field(...) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") - bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""") - bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""") - capacitance_compensation: Optional[np.float32] = Field( + bias_current: Optional[float] = Field(None, description="""Bias current, in amps.""") + bridge_balance: Optional[float] = Field(None, description="""Bridge balance, in ohms.""") + capacitance_compensation: Optional[float] = Field( None, description="""Capacitance compensation, in farads.""" ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -204,12 +204,12 @@ class CurrentClampSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -255,21 +255,19 @@ class IZeroClampSeries(CurrentClampSeries): ) name: str = Field(...) - bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""") - bridge_balance: np.float32 = Field( - ..., description="""Bridge balance, in ohms, fixed to 0.0.""" - ) - capacitance_compensation: np.float32 = Field( + bias_current: float = Field(..., description="""Bias current, in amps, fixed to 0.0.""") + bridge_balance: float = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + capacitance_compensation: float = Field( ..., description="""Capacitance compensation, in farads, fixed to 0.0.""" ) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -282,12 +280,12 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -319,10 +317,10 @@ class CurrentClampStimulusSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -335,12 +333,12 @@ class CurrentClampStimulusSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -411,10 +409,10 @@ class VoltageClampSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -427,12 +425,12 @@ class VoltageClampSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -488,7 +486,7 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): @@ -511,7 +509,7 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): @@ -534,7 +532,7 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): @@ -557,7 +555,7 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): @@ -580,7 +578,7 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): @@ -603,7 +601,7 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): @@ -626,7 +624,7 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampStimulusSeries(PatchClampSeries): @@ -643,10 +641,10 @@ class VoltageClampStimulusSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -659,12 +657,12 @@ class VoltageClampStimulusSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -738,7 +736,7 @@ class SweepTable(DynamicTable): ) name: str = Field(...) - sweep_number: NDArray[Any, np.uint32] = Field( + sweep_number: NDArray[Any, int] = Field( ..., description="""Sweep number of the PatchClampSeries in that row.""", json_schema_extra={ diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_image.py index fa26d72..db8401b 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_image.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_image.py @@ -71,15 +71,15 @@ class GrayscaleImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -94,15 +94,15 @@ class RGBImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -117,15 +117,15 @@ class RGBAImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -142,11 +142,11 @@ class ImageSeries(TimeSeries): name: str = Field(...) data: Optional[ Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, * z"], float], ] ] = Field(None, description="""Binary data representing images across frames.""") - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -168,12 +168,12 @@ class ImageSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -204,7 +204,7 @@ class ImageSeriesExternalFile(ConfiguredBaseModel): "linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"} }, ) - starting_frame: Optional[np.int32] = Field( + starting_frame: Optional[int] = Field( None, description="""Each external image may contain one or more consecutive frames of the full ImageSeries. This attribute serves as an index to indicate which frames each file contains, to faciliate random access. The 'starting_frame' attribute, hence, contains a list of frame numbers within the full ImageSeries of the first frame of each file listed in the parent 'external_file' dataset. Zero-based indexing is used (hence, the first element will always be zero). For example, if the 'external_file' dataset has three paths to files and the first file has 5 frames, the second file has 10 frames, and the third file has 20 frames, then this attribute will have values [0, 5, 15]. If there is a single external file that holds all of the frames of the ImageSeries (and so there is a single element in the 'external_file' dataset), then this attribute should have value [0].""", ) @@ -225,11 +225,11 @@ class ImageMaskSeries(ImageSeries): name: str = Field(...) data: Optional[ Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, * z"], float], ] ] = Field(None, description="""Binary data representing images across frames.""") - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -251,12 +251,12 @@ class ImageMaskSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -284,13 +284,12 @@ class OpticalSeries(ImageSeries): ) name: str = Field(...) - distance: Optional[np.float32] = Field( + distance: Optional[float] = Field( None, description="""Distance from camera/monitor to target/eye.""" ) field_of_view: Optional[ Union[ - NDArray[Shape["2 width_height"], np.float32], - NDArray[Shape["3 width_height_depth"], np.float32], + NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height_depth"], float] ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") orientation: Optional[str] = Field( @@ -299,11 +298,11 @@ class OpticalSeries(ImageSeries): ) data: Optional[ Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, * z"], float], ] ] = Field(None, description="""Binary data representing images across frames.""") - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -325,12 +324,12 @@ class OpticalSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -358,7 +357,7 @@ class IndexSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.int32] = Field( + data: NDArray[Shape["* num_times"], int] = Field( ..., description="""Index of the frame in the referenced ImageSeries.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -372,12 +371,12 @@ class IndexSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_misc.py index 58ceb2e..968660d 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_misc.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_misc.py @@ -129,12 +129,12 @@ class AbstractFeatureSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -169,8 +169,8 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_features"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_features"], float], ] ] = Field(None) @@ -199,12 +199,12 @@ class AnnotationSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -232,7 +232,7 @@ class IntervalSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.int8] = Field( + data: NDArray[Shape["* num_times"], int] = Field( ..., description="""Use values >0 if interval started, <0 if interval ended.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -246,12 +246,12 @@ class IntervalSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -296,12 +296,12 @@ class DecompositionSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -334,7 +334,7 @@ class DecompositionSeriesData(ConfiguredBaseModel): None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) - array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], np.number]] = Field( + array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], float]] = Field( None, json_schema_extra={ "linkml_meta": { @@ -370,7 +370,7 @@ class DecompositionSeriesBands(DynamicTable): } }, ) - band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field( + band_limits: NDArray[Shape["* num_bands, 2 low_high"], float] = Field( ..., description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""", json_schema_extra={ @@ -384,12 +384,12 @@ class DecompositionSeriesBands(DynamicTable): } }, ) - band_mean: NDArray[Shape["* num_bands"], np.float32] = Field( + band_mean: NDArray[Shape["* num_bands"], float] = Field( ..., description="""The mean Gaussian filters, in Hz.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_bands"}]}}}, ) - band_stdev: NDArray[Shape["* num_bands"], np.float32] = Field( + band_stdev: NDArray[Shape["* num_bands"], float] = Field( ..., description="""The standard deviation of Gaussian filters, in Hz.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_bands"}]}}}, @@ -441,7 +441,7 @@ class Units(DynamicTable): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field( + obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], float]] = Field( None, description="""Observation intervals for each unit.""", json_schema_extra={ @@ -474,14 +474,14 @@ class Units(DynamicTable): ) waveform_mean: Optional[ Union[ - NDArray[Shape["* num_units, * num_samples"], np.float32], - NDArray[Shape["* num_units, * num_samples, * num_electrodes"], np.float32], + NDArray[Shape["* num_units, * num_samples"], float], + NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float], ] ] = Field(None, description="""Spike waveform mean for each spike unit.""") waveform_sd: Optional[ Union[ - NDArray[Shape["* num_units, * num_samples"], np.float32], - NDArray[Shape["* num_units, * num_samples, * num_electrodes"], np.float32], + NDArray[Shape["* num_units, * num_samples"], float], + NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float], ] ] = Field(None, description="""Spike waveform standard deviation for each spike unit.""") colnames: Optional[str] = Field( @@ -517,7 +517,7 @@ class UnitsSpikeTimes(VectorData): "linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"} }, ) - resolution: Optional[np.float64] = Field( + resolution: Optional[float] = Field( None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ogen.py index cd3c8ac..02043ad 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ogen.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ogen.py @@ -76,7 +76,7 @@ class OptogeneticSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.number] = Field( + data: NDArray[Shape["* num_times"], float] = Field( ..., description="""Applied power for optogenetic stimulus, in watts.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -90,12 +90,12 @@ class OptogeneticSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -124,7 +124,7 @@ class OptogeneticStimulusSite(NWBContainer): name: str = Field(...) description: str = Field(..., description="""Description of stimulation site.""") - excitation_lambda: np.float32 = Field(..., description="""Excitation wavelength, in nm.""") + excitation_lambda: float = Field(..., description="""Excitation wavelength, in nm.""") location: str = Field( ..., description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ophys.py index 9ae5919..44b5845 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ophys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ophys.py @@ -109,24 +109,21 @@ class TwoPhotonSeries(ImageSeries): ) name: str = Field(...) - pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") - scan_line_rate: Optional[np.float32] = Field( + pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""") + scan_line_rate: Optional[float] = Field( None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) field_of_view: Optional[ - Union[ - NDArray[Shape["2 width_height"], np.float32], - NDArray[Shape["3 width_height"], np.float32], - ] + Union[NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height"], float]] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Optional[ Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, * z"], float], ] ] = Field(None, description="""Binary data representing images across frames.""") - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -148,12 +145,12 @@ class TwoPhotonSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -182,8 +179,7 @@ class RoiResponseSeries(TimeSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_rois"], np.number], + NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times, * num_rois"], float] ] = Field(..., description="""Signals from ROIs.""") rois: Named[DynamicTableRegion] = Field( ..., @@ -201,12 +197,12 @@ class RoiResponseSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -280,8 +276,8 @@ class ImagingPlane(NWBContainer): name: str = Field(...) description: Optional[str] = Field(None, description="""Description of the imaging plane.""") - excitation_lambda: np.float32 = Field(..., description="""Excitation wavelength, in nm.""") - imaging_rate: np.float32 = Field(..., description="""Rate that images are acquired, in Hz.""") + excitation_lambda: float = Field(..., description="""Excitation wavelength, in nm.""") + imaging_rate: float = Field(..., description="""Rate that images are acquired, in Hz.""") indicator: str = Field(..., description="""Calcium indicator.""") location: str = Field( ..., @@ -321,7 +317,7 @@ class ImagingPlaneManifold(ConfiguredBaseModel): "linkml_meta": {"equals_string": "manifold", "ifabsent": "string(manifold)"} }, ) - conversion: Optional[np.float32] = Field( + conversion: Optional[float] = Field( None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as pixels from x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then the 'conversion' multiplier to get from raw data acquisition pixel units to meters is 2/1000.""", ) @@ -331,8 +327,8 @@ class ImagingPlaneManifold(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* height, * width, 3 x_y_z"], np.float32], - NDArray[Shape["* height, * width, * depth, 3 x_y_z"], np.float32], + NDArray[Shape["* height, * width, 3 x_y_z"], float], + NDArray[Shape["* height, * width, * depth, 3 x_y_z"], float], ] ] = Field(None) @@ -353,7 +349,7 @@ class ImagingPlaneOriginCoords(ConfiguredBaseModel): unit: Optional[str] = Field( None, description="""Measurement units for origin_coords. The default value is 'meters'.""" ) - array: Optional[NDArray[Shape["2 x_y, 3 x_y_z"], np.float32]] = Field( + array: Optional[NDArray[Shape["2 x_y, 3 x_y_z"], float]] = Field( None, json_schema_extra={ "linkml_meta": { @@ -384,7 +380,7 @@ class ImagingPlaneGridSpacing(ConfiguredBaseModel): unit: Optional[str] = Field( None, description="""Measurement units for grid_spacing. The default value is 'meters'.""" ) - array: Optional[NDArray[Shape["2 x_y, 3 x_y_z"], np.float32]] = Field( + array: Optional[NDArray[Shape["2 x_y, 3 x_y_z"], float]] = Field( None, json_schema_extra={ "linkml_meta": { @@ -408,9 +404,7 @@ class OpticalChannel(NWBContainer): name: str = Field(...) description: str = Field(..., description="""Description or other notes about the channel.""") - emission_lambda: np.float32 = Field( - ..., description="""Emission wavelength for channel, in nm.""" - ) + emission_lambda: float = Field(..., description="""Emission wavelength for channel, in nm.""") class MotionCorrection(NWBDataInterface): diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_retinotopy.py index ee2356f..7155a0fc 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_retinotopy.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_retinotopy.py @@ -96,14 +96,12 @@ class RetinotopyMap(NWBData): ) name: str = Field(...) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -124,19 +122,17 @@ class AxisMap(RetinotopyMap): unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") class RetinotopyImage(GrayscaleImage): @@ -149,29 +145,27 @@ class RetinotopyImage(GrayscaleImage): ) name: str = Field(...) - bits_per_pixel: Optional[np.int32] = Field( + bits_per_pixel: Optional[int] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""", ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") format: Optional[str] = Field( None, description="""Format of image. Right now only 'raw' is supported.""" ) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -262,32 +256,28 @@ class ImagingRetinotopyFocalDepthImage(RetinotopyImage): } }, ) - focal_depth: Optional[np.float32] = Field( - None, description="""Focal depth offset, in meters.""" - ) - bits_per_pixel: Optional[np.int32] = Field( + focal_depth: Optional[float] = Field(None, description="""Focal depth offset, in meters.""") + bits_per_pixel: Optional[int] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""", ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") format: Optional[str] = Field( None, description="""Format of image. Right now only 'raw' is supported.""" ) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_base.py index df1e7e7..c37673c 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_base.py @@ -83,15 +83,15 @@ class Image(NWBData): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -143,12 +143,12 @@ class TimeSeries(NWBDataInterface): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -177,11 +177,11 @@ class TimeSeriesData(ConfiguredBaseModel): "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) - conversion: Optional[np.float32] = Field( + conversion: Optional[float] = Field( None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""", ) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""", ) @@ -212,11 +212,11 @@ class TimeSeriesStartingTime(ConfiguredBaseModel): "linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"} }, ) - rate: Optional[np.float32] = Field(None, description="""Sampling rate, in Hz.""") + rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""") unit: Optional[str] = Field( None, description="""Unit of measurement for time, which is fixed to 'seconds'.""" ) - value: np.float64 = Field(...) + value: float = Field(...) class TimeSeriesSync(ConfiguredBaseModel): diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_behavior.py index 143813d..5020dfe 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_behavior.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_behavior.py @@ -93,12 +93,12 @@ class SpatialSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -133,8 +133,8 @@ class SpatialSeriesData(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_features"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_features"], float], ] ] = Field(None) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ecephys.py index c098784..d8ed535 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ecephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ecephys.py @@ -108,9 +108,9 @@ class ElectricalSeries(TimeSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_channels"], np.number], - NDArray[Shape["* num_times, * num_channels, * num_samples"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_channels"], float], + NDArray[Shape["* num_times, * num_channels, * num_samples"], float], ] = Field(..., description="""Recorded voltage data.""") electrodes: Named[DynamicTableRegion] = Field( ..., @@ -119,7 +119,7 @@ class ElectricalSeries(TimeSeries): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( + channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field( None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}}, @@ -133,12 +133,12 @@ class ElectricalSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -167,10 +167,10 @@ class SpikeEventSeries(ElectricalSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_events, * num_samples"], np.number], - NDArray[Shape["* num_events, * num_channels, * num_samples"], np.number], + NDArray[Shape["* num_events, * num_samples"], float], + NDArray[Shape["* num_events, * num_channels, * num_samples"], float], ] = Field(..., description="""Spike waveforms.""") - timestamps: NDArray[Shape["* num_times"], np.float64] = Field( + timestamps: NDArray[Shape["* num_times"], float] = Field( ..., description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -182,7 +182,7 @@ class SpikeEventSeries(ElectricalSeries): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( + channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field( None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}}, @@ -196,7 +196,7 @@ class SpikeEventSeries(ElectricalSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -232,7 +232,7 @@ class FeatureExtraction(NWBDataInterface): description="""Description of features (eg, ''PC1'') for each of the extracted features.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_features"}]}}}, ) - features: NDArray[Shape["* num_events, * num_channels, * num_features"], np.float32] = Field( + features: NDArray[Shape["* num_events, * num_channels, * num_features"], float] = Field( ..., description="""Multi-dimensional array of features extracted from each event.""", json_schema_extra={ @@ -247,7 +247,7 @@ class FeatureExtraction(NWBDataInterface): } }, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Times of events that features correspond to (can be a link).""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, @@ -277,12 +277,12 @@ class EventDetection(NWBDataInterface): ..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""", ) - source_idx: NDArray[Shape["* num_events"], np.int32] = Field( + source_idx: NDArray[Shape["* num_events"], int] = Field( ..., description="""Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Timestamps of events, in seconds.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, @@ -367,9 +367,9 @@ class ElectrodeGroupPosition(ConfiguredBaseModel): "linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"} }, ) - x: Optional[np.float32] = Field(None, description="""x coordinate""") - y: Optional[np.float32] = Field(None, description="""y coordinate""") - z: Optional[np.float32] = Field(None, description="""z coordinate""") + x: Optional[float] = Field(None, description="""x coordinate""") + y: Optional[float] = Field(None, description="""y coordinate""") + z: Optional[float] = Field(None, description="""z coordinate""") class ClusterWaveforms(NWBDataInterface): @@ -388,7 +388,7 @@ class ClusterWaveforms(NWBDataInterface): waveform_filtering: str = Field( ..., description="""Filtering applied to data before generating mean/sd""" ) - waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( + waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], float] = Field( ..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""", json_schema_extra={ @@ -397,7 +397,7 @@ class ClusterWaveforms(NWBDataInterface): } }, ) - waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( + waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], float] = Field( ..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""", json_schema_extra={ @@ -424,17 +424,17 @@ class Clustering(NWBDataInterface): ..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""", ) - num: NDArray[Shape["* num_events"], np.int32] = Field( + num: NDArray[Shape["* num_events"], int] = Field( ..., description="""Cluster number of each event""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, ) - peak_over_rms: NDArray[Shape["* num_clusters"], np.float32] = Field( + peak_over_rms: NDArray[Shape["* num_clusters"], float] = Field( ..., description="""Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}]}}}, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_epoch.py index ad01523..0113b4d 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_epoch.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_epoch.py @@ -96,7 +96,7 @@ class TimeIntervals(DynamicTable): ) name: str = Field(...) - start_time: NDArray[Any, np.float32] = Field( + start_time: NDArray[Any, float] = Field( ..., description="""Start time of epoch, in seconds.""", json_schema_extra={ @@ -105,7 +105,7 @@ class TimeIntervals(DynamicTable): } }, ) - stop_time: NDArray[Any, np.float32] = Field( + stop_time: NDArray[Any, float] = Field( ..., description="""Stop time of epoch, in seconds.""", json_schema_extra={ @@ -173,11 +173,11 @@ class TimeIntervalsTimeseries(VectorData): "linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"} }, ) - idx_start: Optional[np.int32] = Field( + idx_start: Optional[int] = Field( None, description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) - count: Optional[np.int32] = Field( + count: Optional[int] = Field( None, description="""Number of data samples available in this time series, during this epoch.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_file.py index 3faf47c..c9f7dcd 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_file.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_file.py @@ -102,7 +102,7 @@ class NWBFile(NWBContainer): None, description="""File version string. Use semantic versioning, e.g. 1.2.1. This will be the name of the format with trailing major, minor and patch numbers.""", ) - file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = Field( + file_create_date: NDArray[Shape["* num_modifications"], datetime] = Field( ..., description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""", json_schema_extra={ @@ -116,11 +116,11 @@ class NWBFile(NWBContainer): session_description: str = Field( ..., description="""A description of the experimental session and data in the file.""" ) - session_start_time: np.datetime64 = Field( + session_start_time: datetime = Field( ..., description="""Date and time of the experiment/session start. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds.""", ) - timestamps_reference_time: np.datetime64 = Field( + timestamps_reference_time: datetime = Field( ..., description="""Date and time corresponding to time zero of all timestamps. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. All times stored in the file use this time as reference (i.e., time zero).""", ) @@ -335,7 +335,7 @@ class Subject(NWBContainer): age: Optional[str] = Field( None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""" ) - date_of_birth: Optional[np.datetime64] = Field( + date_of_birth: Optional[datetime] = Field( None, description="""Date of birth of subject. Can be supplied instead of 'age'.""" ) description: Optional[str] = Field( @@ -394,7 +394,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): "linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"} }, ) - x: NDArray[Any, np.float32] = Field( + x: NDArray[Any, float] = Field( ..., description="""x coordinate of the channel location in the brain (+x is posterior).""", json_schema_extra={ @@ -403,7 +403,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - y: NDArray[Any, np.float32] = Field( + y: NDArray[Any, float] = Field( ..., description="""y coordinate of the channel location in the brain (+y is inferior).""", json_schema_extra={ @@ -412,7 +412,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - z: NDArray[Any, np.float32] = Field( + z: NDArray[Any, float] = Field( ..., description="""z coordinate of the channel location in the brain (+z is right).""", json_schema_extra={ @@ -421,7 +421,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - imp: NDArray[Any, np.float32] = Field( + imp: NDArray[Any, float] = Field( ..., description="""Impedance of the channel.""", json_schema_extra={ @@ -439,7 +439,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - filtering: NDArray[Any, np.float32] = Field( + filtering: NDArray[Any, float] = Field( ..., description="""Description of hardware filtering.""", json_schema_extra={ @@ -460,7 +460,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_x: Optional[NDArray[Any, np.float32]] = Field( + rel_x: Optional[NDArray[Any, float]] = Field( None, description="""x coordinate in electrode group""", json_schema_extra={ @@ -469,7 +469,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_y: Optional[NDArray[Any, np.float32]] = Field( + rel_y: Optional[NDArray[Any, float]] = Field( None, description="""y coordinate in electrode group""", json_schema_extra={ @@ -478,7 +478,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_z: Optional[NDArray[Any, np.float32]] = Field( + rel_z: Optional[NDArray[Any, float]] = Field( None, description="""z coordinate in electrode group""", json_schema_extra={ diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_icephys.py index 3b96bf5..3cea17f 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_icephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_icephys.py @@ -109,11 +109,11 @@ class PatchClampSeries(TimeSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""") - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -126,12 +126,12 @@ class PatchClampSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -164,7 +164,7 @@ class PatchClampSeriesData(ConfiguredBaseModel): None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) - array: Optional[NDArray[Shape["* num_times"], np.number]] = Field( + array: Optional[NDArray[Shape["* num_times"], float]] = Field( None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}} ) @@ -180,18 +180,18 @@ class CurrentClampSeries(PatchClampSeries): name: str = Field(...) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") - bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""") - bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""") - capacitance_compensation: Optional[np.float32] = Field( + bias_current: Optional[float] = Field(None, description="""Bias current, in amps.""") + bridge_balance: Optional[float] = Field(None, description="""Bridge balance, in ohms.""") + capacitance_compensation: Optional[float] = Field( None, description="""Capacitance compensation, in farads.""" ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -204,12 +204,12 @@ class CurrentClampSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -255,21 +255,19 @@ class IZeroClampSeries(CurrentClampSeries): ) name: str = Field(...) - bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""") - bridge_balance: np.float32 = Field( - ..., description="""Bridge balance, in ohms, fixed to 0.0.""" - ) - capacitance_compensation: np.float32 = Field( + bias_current: float = Field(..., description="""Bias current, in amps, fixed to 0.0.""") + bridge_balance: float = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + capacitance_compensation: float = Field( ..., description="""Capacitance compensation, in farads, fixed to 0.0.""" ) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -282,12 +280,12 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -319,10 +317,10 @@ class CurrentClampStimulusSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -335,12 +333,12 @@ class CurrentClampStimulusSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -411,10 +409,10 @@ class VoltageClampSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -427,12 +425,12 @@ class VoltageClampSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -488,7 +486,7 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): @@ -511,7 +509,7 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): @@ -534,7 +532,7 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): @@ -557,7 +555,7 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): @@ -580,7 +578,7 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): @@ -603,7 +601,7 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): @@ -626,7 +624,7 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampStimulusSeries(PatchClampSeries): @@ -643,10 +641,10 @@ class VoltageClampStimulusSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -659,12 +657,12 @@ class VoltageClampStimulusSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -738,7 +736,7 @@ class SweepTable(DynamicTable): ) name: str = Field(...) - sweep_number: NDArray[Any, np.uint32] = Field( + sweep_number: NDArray[Any, int] = Field( ..., description="""Sweep number of the PatchClampSeries in that row.""", json_schema_extra={ diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_image.py index f7b0d84..89e4978 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_image.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_image.py @@ -71,15 +71,15 @@ class GrayscaleImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -94,15 +94,15 @@ class RGBImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -117,15 +117,15 @@ class RGBAImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -142,11 +142,11 @@ class ImageSeries(TimeSeries): name: str = Field(...) data: Optional[ Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, * z"], float], ] ] = Field(None, description="""Binary data representing images across frames.""") - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -168,12 +168,12 @@ class ImageSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -204,7 +204,7 @@ class ImageSeriesExternalFile(ConfiguredBaseModel): "linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"} }, ) - starting_frame: Optional[np.int32] = Field( + starting_frame: Optional[int] = Field( None, description="""Each external image may contain one or more consecutive frames of the full ImageSeries. This attribute serves as an index to indicate which frames each file contains, to faciliate random access. The 'starting_frame' attribute, hence, contains a list of frame numbers within the full ImageSeries of the first frame of each file listed in the parent 'external_file' dataset. Zero-based indexing is used (hence, the first element will always be zero). For example, if the 'external_file' dataset has three paths to files and the first file has 5 frames, the second file has 10 frames, and the third file has 20 frames, then this attribute will have values [0, 5, 15]. If there is a single external file that holds all of the frames of the ImageSeries (and so there is a single element in the 'external_file' dataset), then this attribute should have value [0].""", ) @@ -225,11 +225,11 @@ class ImageMaskSeries(ImageSeries): name: str = Field(...) data: Optional[ Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, * z"], float], ] ] = Field(None, description="""Binary data representing images across frames.""") - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -251,12 +251,12 @@ class ImageMaskSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -284,13 +284,12 @@ class OpticalSeries(ImageSeries): ) name: str = Field(...) - distance: Optional[np.float32] = Field( + distance: Optional[float] = Field( None, description="""Distance from camera/monitor to target/eye.""" ) field_of_view: Optional[ Union[ - NDArray[Shape["2 width_height"], np.float32], - NDArray[Shape["3 width_height_depth"], np.float32], + NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height_depth"], float] ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") orientation: Optional[str] = Field( @@ -299,11 +298,11 @@ class OpticalSeries(ImageSeries): ) data: Optional[ Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, * z"], float], ] ] = Field(None, description="""Binary data representing images across frames.""") - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -325,12 +324,12 @@ class OpticalSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -358,7 +357,7 @@ class IndexSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.int32] = Field( + data: NDArray[Shape["* num_times"], int] = Field( ..., description="""Index of the frame in the referenced ImageSeries.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -372,12 +371,12 @@ class IndexSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_misc.py index 16f9bea..5d1881f 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_misc.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_misc.py @@ -129,12 +129,12 @@ class AbstractFeatureSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -169,8 +169,8 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_features"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_features"], float], ] ] = Field(None) @@ -199,12 +199,12 @@ class AnnotationSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -232,7 +232,7 @@ class IntervalSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.int8] = Field( + data: NDArray[Shape["* num_times"], int] = Field( ..., description="""Use values >0 if interval started, <0 if interval ended.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -246,12 +246,12 @@ class IntervalSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -296,12 +296,12 @@ class DecompositionSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -334,7 +334,7 @@ class DecompositionSeriesData(ConfiguredBaseModel): None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) - array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], np.number]] = Field( + array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], float]] = Field( None, json_schema_extra={ "linkml_meta": { @@ -370,7 +370,7 @@ class DecompositionSeriesBands(DynamicTable): } }, ) - band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field( + band_limits: NDArray[Shape["* num_bands, 2 low_high"], float] = Field( ..., description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""", json_schema_extra={ @@ -384,12 +384,12 @@ class DecompositionSeriesBands(DynamicTable): } }, ) - band_mean: NDArray[Shape["* num_bands"], np.float32] = Field( + band_mean: NDArray[Shape["* num_bands"], float] = Field( ..., description="""The mean Gaussian filters, in Hz.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_bands"}]}}}, ) - band_stdev: NDArray[Shape["* num_bands"], np.float32] = Field( + band_stdev: NDArray[Shape["* num_bands"], float] = Field( ..., description="""The standard deviation of Gaussian filters, in Hz.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_bands"}]}}}, @@ -441,7 +441,7 @@ class Units(DynamicTable): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field( + obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], float]] = Field( None, description="""Observation intervals for each unit.""", json_schema_extra={ @@ -474,14 +474,14 @@ class Units(DynamicTable): ) waveform_mean: Optional[ Union[ - NDArray[Shape["* num_units, * num_samples"], np.float32], - NDArray[Shape["* num_units, * num_samples, * num_electrodes"], np.float32], + NDArray[Shape["* num_units, * num_samples"], float], + NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float], ] ] = Field(None, description="""Spike waveform mean for each spike unit.""") waveform_sd: Optional[ Union[ - NDArray[Shape["* num_units, * num_samples"], np.float32], - NDArray[Shape["* num_units, * num_samples, * num_electrodes"], np.float32], + NDArray[Shape["* num_units, * num_samples"], float], + NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float], ] ] = Field(None, description="""Spike waveform standard deviation for each spike unit.""") colnames: Optional[str] = Field( @@ -517,7 +517,7 @@ class UnitsSpikeTimes(VectorData): "linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"} }, ) - resolution: Optional[np.float64] = Field( + resolution: Optional[float] = Field( None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ogen.py index 7a99546..26c3fc8 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ogen.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ogen.py @@ -76,7 +76,7 @@ class OptogeneticSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.number] = Field( + data: NDArray[Shape["* num_times"], float] = Field( ..., description="""Applied power for optogenetic stimulus, in watts.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -90,12 +90,12 @@ class OptogeneticSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -124,7 +124,7 @@ class OptogeneticStimulusSite(NWBContainer): name: str = Field(...) description: str = Field(..., description="""Description of stimulation site.""") - excitation_lambda: np.float32 = Field(..., description="""Excitation wavelength, in nm.""") + excitation_lambda: float = Field(..., description="""Excitation wavelength, in nm.""") location: str = Field( ..., description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ophys.py index 6b4e114..2ed7469 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ophys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ophys.py @@ -109,24 +109,21 @@ class TwoPhotonSeries(ImageSeries): ) name: str = Field(...) - pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") - scan_line_rate: Optional[np.float32] = Field( + pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""") + scan_line_rate: Optional[float] = Field( None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) field_of_view: Optional[ - Union[ - NDArray[Shape["2 width_height"], np.float32], - NDArray[Shape["3 width_height"], np.float32], - ] + Union[NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height"], float]] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Optional[ Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, * z"], float], ] ] = Field(None, description="""Binary data representing images across frames.""") - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -148,12 +145,12 @@ class TwoPhotonSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -182,8 +179,7 @@ class RoiResponseSeries(TimeSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_rois"], np.number], + NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times, * num_rois"], float] ] = Field(..., description="""Signals from ROIs.""") rois: Named[DynamicTableRegion] = Field( ..., @@ -201,12 +197,12 @@ class RoiResponseSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -280,8 +276,8 @@ class ImagingPlane(NWBContainer): name: str = Field(...) description: Optional[str] = Field(None, description="""Description of the imaging plane.""") - excitation_lambda: np.float32 = Field(..., description="""Excitation wavelength, in nm.""") - imaging_rate: np.float32 = Field(..., description="""Rate that images are acquired, in Hz.""") + excitation_lambda: float = Field(..., description="""Excitation wavelength, in nm.""") + imaging_rate: float = Field(..., description="""Rate that images are acquired, in Hz.""") indicator: str = Field(..., description="""Calcium indicator.""") location: str = Field( ..., @@ -321,7 +317,7 @@ class ImagingPlaneManifold(ConfiguredBaseModel): "linkml_meta": {"equals_string": "manifold", "ifabsent": "string(manifold)"} }, ) - conversion: Optional[np.float32] = Field( + conversion: Optional[float] = Field( None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as pixels from x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then the 'conversion' multiplier to get from raw data acquisition pixel units to meters is 2/1000.""", ) @@ -331,8 +327,8 @@ class ImagingPlaneManifold(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* height, * width, 3 x_y_z"], np.float32], - NDArray[Shape["* height, * width, * depth, 3 x_y_z"], np.float32], + NDArray[Shape["* height, * width, 3 x_y_z"], float], + NDArray[Shape["* height, * width, * depth, 3 x_y_z"], float], ] ] = Field(None) @@ -353,7 +349,7 @@ class ImagingPlaneOriginCoords(ConfiguredBaseModel): unit: Optional[str] = Field( None, description="""Measurement units for origin_coords. The default value is 'meters'.""" ) - array: Optional[NDArray[Shape["2 x_y, 3 x_y_z"], np.float32]] = Field( + array: Optional[NDArray[Shape["2 x_y, 3 x_y_z"], float]] = Field( None, json_schema_extra={ "linkml_meta": { @@ -384,7 +380,7 @@ class ImagingPlaneGridSpacing(ConfiguredBaseModel): unit: Optional[str] = Field( None, description="""Measurement units for grid_spacing. The default value is 'meters'.""" ) - array: Optional[NDArray[Shape["2 x_y, 3 x_y_z"], np.float32]] = Field( + array: Optional[NDArray[Shape["2 x_y, 3 x_y_z"], float]] = Field( None, json_schema_extra={ "linkml_meta": { @@ -408,9 +404,7 @@ class OpticalChannel(NWBContainer): name: str = Field(...) description: str = Field(..., description="""Description or other notes about the channel.""") - emission_lambda: np.float32 = Field( - ..., description="""Emission wavelength for channel, in nm.""" - ) + emission_lambda: float = Field(..., description="""Emission wavelength for channel, in nm.""") class MotionCorrection(NWBDataInterface): diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_retinotopy.py index 5fe79a1..7095d7e 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_retinotopy.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_retinotopy.py @@ -96,14 +96,12 @@ class RetinotopyMap(NWBData): ) name: str = Field(...) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -124,19 +122,17 @@ class AxisMap(RetinotopyMap): unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") class RetinotopyImage(GrayscaleImage): @@ -149,29 +145,27 @@ class RetinotopyImage(GrayscaleImage): ) name: str = Field(...) - bits_per_pixel: Optional[np.int32] = Field( + bits_per_pixel: Optional[int] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""", ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") format: Optional[str] = Field( None, description="""Format of image. Right now only 'raw' is supported.""" ) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -262,32 +256,28 @@ class ImagingRetinotopyFocalDepthImage(RetinotopyImage): } }, ) - focal_depth: Optional[np.float32] = Field( - None, description="""Focal depth offset, in meters.""" - ) - bits_per_pixel: Optional[np.int32] = Field( + focal_depth: Optional[float] = Field(None, description="""Focal depth offset, in meters.""") + bits_per_pixel: Optional[int] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""", ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") format: Optional[str] = Field( None, description="""Format of image. Right now only 'raw' is supported.""" ) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_base.py index 556fa21..0b34abd 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_base.py @@ -83,15 +83,15 @@ class Image(NWBData): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -143,12 +143,12 @@ class TimeSeries(NWBDataInterface): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -177,11 +177,11 @@ class TimeSeriesData(ConfiguredBaseModel): "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) - conversion: Optional[np.float32] = Field( + conversion: Optional[float] = Field( None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""", ) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""", ) @@ -212,11 +212,11 @@ class TimeSeriesStartingTime(ConfiguredBaseModel): "linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"} }, ) - rate: Optional[np.float32] = Field(None, description="""Sampling rate, in Hz.""") + rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""") unit: Optional[str] = Field( None, description="""Unit of measurement for time, which is fixed to 'seconds'.""" ) - value: np.float64 = Field(...) + value: float = Field(...) class TimeSeriesSync(ConfiguredBaseModel): diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_behavior.py index 39a00bd..3b1a5fb 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_behavior.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_behavior.py @@ -93,12 +93,12 @@ class SpatialSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -133,8 +133,8 @@ class SpatialSeriesData(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_features"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_features"], float], ] ] = Field(None) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ecephys.py index 08e515f..ac58cf4 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ecephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ecephys.py @@ -108,9 +108,9 @@ class ElectricalSeries(TimeSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_channels"], np.number], - NDArray[Shape["* num_times, * num_channels, * num_samples"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_channels"], float], + NDArray[Shape["* num_times, * num_channels, * num_samples"], float], ] = Field(..., description="""Recorded voltage data.""") electrodes: Named[DynamicTableRegion] = Field( ..., @@ -119,7 +119,7 @@ class ElectricalSeries(TimeSeries): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( + channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field( None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}}, @@ -133,12 +133,12 @@ class ElectricalSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -167,10 +167,10 @@ class SpikeEventSeries(ElectricalSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_events, * num_samples"], np.number], - NDArray[Shape["* num_events, * num_channels, * num_samples"], np.number], + NDArray[Shape["* num_events, * num_samples"], float], + NDArray[Shape["* num_events, * num_channels, * num_samples"], float], ] = Field(..., description="""Spike waveforms.""") - timestamps: NDArray[Shape["* num_times"], np.float64] = Field( + timestamps: NDArray[Shape["* num_times"], float] = Field( ..., description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -182,7 +182,7 @@ class SpikeEventSeries(ElectricalSeries): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( + channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field( None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}}, @@ -196,7 +196,7 @@ class SpikeEventSeries(ElectricalSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -232,7 +232,7 @@ class FeatureExtraction(NWBDataInterface): description="""Description of features (eg, ''PC1'') for each of the extracted features.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_features"}]}}}, ) - features: NDArray[Shape["* num_events, * num_channels, * num_features"], np.float32] = Field( + features: NDArray[Shape["* num_events, * num_channels, * num_features"], float] = Field( ..., description="""Multi-dimensional array of features extracted from each event.""", json_schema_extra={ @@ -247,7 +247,7 @@ class FeatureExtraction(NWBDataInterface): } }, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Times of events that features correspond to (can be a link).""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, @@ -277,12 +277,12 @@ class EventDetection(NWBDataInterface): ..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""", ) - source_idx: NDArray[Shape["* num_events"], np.int32] = Field( + source_idx: NDArray[Shape["* num_events"], int] = Field( ..., description="""Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Timestamps of events, in seconds.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, @@ -367,9 +367,9 @@ class ElectrodeGroupPosition(ConfiguredBaseModel): "linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"} }, ) - x: Optional[np.float32] = Field(None, description="""x coordinate""") - y: Optional[np.float32] = Field(None, description="""y coordinate""") - z: Optional[np.float32] = Field(None, description="""z coordinate""") + x: Optional[float] = Field(None, description="""x coordinate""") + y: Optional[float] = Field(None, description="""y coordinate""") + z: Optional[float] = Field(None, description="""z coordinate""") class ClusterWaveforms(NWBDataInterface): @@ -388,7 +388,7 @@ class ClusterWaveforms(NWBDataInterface): waveform_filtering: str = Field( ..., description="""Filtering applied to data before generating mean/sd""" ) - waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( + waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], float] = Field( ..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""", json_schema_extra={ @@ -397,7 +397,7 @@ class ClusterWaveforms(NWBDataInterface): } }, ) - waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( + waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], float] = Field( ..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""", json_schema_extra={ @@ -424,17 +424,17 @@ class Clustering(NWBDataInterface): ..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""", ) - num: NDArray[Shape["* num_events"], np.int32] = Field( + num: NDArray[Shape["* num_events"], int] = Field( ..., description="""Cluster number of each event""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, ) - peak_over_rms: NDArray[Shape["* num_clusters"], np.float32] = Field( + peak_over_rms: NDArray[Shape["* num_clusters"], float] = Field( ..., description="""Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}]}}}, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_epoch.py index ec6ad30..31d8da0 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_epoch.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_epoch.py @@ -96,7 +96,7 @@ class TimeIntervals(DynamicTable): ) name: str = Field(...) - start_time: NDArray[Any, np.float32] = Field( + start_time: NDArray[Any, float] = Field( ..., description="""Start time of epoch, in seconds.""", json_schema_extra={ @@ -105,7 +105,7 @@ class TimeIntervals(DynamicTable): } }, ) - stop_time: NDArray[Any, np.float32] = Field( + stop_time: NDArray[Any, float] = Field( ..., description="""Stop time of epoch, in seconds.""", json_schema_extra={ @@ -173,11 +173,11 @@ class TimeIntervalsTimeseries(VectorData): "linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"} }, ) - idx_start: Optional[np.int32] = Field( + idx_start: Optional[int] = Field( None, description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) - count: Optional[np.int32] = Field( + count: Optional[int] = Field( None, description="""Number of data samples available in this time series, during this epoch.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_file.py index 32fe49a..fb720cb 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_file.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_file.py @@ -102,7 +102,7 @@ class NWBFile(NWBContainer): None, description="""File version string. Use semantic versioning, e.g. 1.2.1. This will be the name of the format with trailing major, minor and patch numbers.""", ) - file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = Field( + file_create_date: NDArray[Shape["* num_modifications"], datetime] = Field( ..., description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""", json_schema_extra={ @@ -116,11 +116,11 @@ class NWBFile(NWBContainer): session_description: str = Field( ..., description="""A description of the experimental session and data in the file.""" ) - session_start_time: np.datetime64 = Field( + session_start_time: datetime = Field( ..., description="""Date and time of the experiment/session start. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds.""", ) - timestamps_reference_time: np.datetime64 = Field( + timestamps_reference_time: datetime = Field( ..., description="""Date and time corresponding to time zero of all timestamps. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. All times stored in the file use this time as reference (i.e., time zero).""", ) @@ -335,7 +335,7 @@ class Subject(NWBContainer): age: Optional[str] = Field( None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""" ) - date_of_birth: Optional[np.datetime64] = Field( + date_of_birth: Optional[datetime] = Field( None, description="""Date of birth of subject. Can be supplied instead of 'age'.""" ) description: Optional[str] = Field( @@ -394,7 +394,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): "linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"} }, ) - x: NDArray[Any, np.float32] = Field( + x: NDArray[Any, float] = Field( ..., description="""x coordinate of the channel location in the brain (+x is posterior).""", json_schema_extra={ @@ -403,7 +403,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - y: NDArray[Any, np.float32] = Field( + y: NDArray[Any, float] = Field( ..., description="""y coordinate of the channel location in the brain (+y is inferior).""", json_schema_extra={ @@ -412,7 +412,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - z: NDArray[Any, np.float32] = Field( + z: NDArray[Any, float] = Field( ..., description="""z coordinate of the channel location in the brain (+z is right).""", json_schema_extra={ @@ -421,7 +421,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - imp: NDArray[Any, np.float32] = Field( + imp: NDArray[Any, float] = Field( ..., description="""Impedance of the channel.""", json_schema_extra={ @@ -439,7 +439,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - filtering: NDArray[Any, np.float32] = Field( + filtering: NDArray[Any, float] = Field( ..., description="""Description of hardware filtering.""", json_schema_extra={ @@ -460,7 +460,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_x: Optional[NDArray[Any, np.float32]] = Field( + rel_x: Optional[NDArray[Any, float]] = Field( None, description="""x coordinate in electrode group""", json_schema_extra={ @@ -469,7 +469,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_y: Optional[NDArray[Any, np.float32]] = Field( + rel_y: Optional[NDArray[Any, float]] = Field( None, description="""y coordinate in electrode group""", json_schema_extra={ @@ -478,7 +478,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_z: Optional[NDArray[Any, np.float32]] = Field( + rel_z: Optional[NDArray[Any, float]] = Field( None, description="""z coordinate in electrode group""", json_schema_extra={ diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_icephys.py index a7fd4fd..c34073a 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_icephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_icephys.py @@ -109,11 +109,11 @@ class PatchClampSeries(TimeSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""") - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -126,12 +126,12 @@ class PatchClampSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -164,7 +164,7 @@ class PatchClampSeriesData(ConfiguredBaseModel): None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) - array: Optional[NDArray[Shape["* num_times"], np.number]] = Field( + array: Optional[NDArray[Shape["* num_times"], float]] = Field( None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}} ) @@ -180,18 +180,18 @@ class CurrentClampSeries(PatchClampSeries): name: str = Field(...) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") - bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""") - bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""") - capacitance_compensation: Optional[np.float32] = Field( + bias_current: Optional[float] = Field(None, description="""Bias current, in amps.""") + bridge_balance: Optional[float] = Field(None, description="""Bridge balance, in ohms.""") + capacitance_compensation: Optional[float] = Field( None, description="""Capacitance compensation, in farads.""" ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -204,12 +204,12 @@ class CurrentClampSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -255,21 +255,19 @@ class IZeroClampSeries(CurrentClampSeries): ) name: str = Field(...) - bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""") - bridge_balance: np.float32 = Field( - ..., description="""Bridge balance, in ohms, fixed to 0.0.""" - ) - capacitance_compensation: np.float32 = Field( + bias_current: float = Field(..., description="""Bias current, in amps, fixed to 0.0.""") + bridge_balance: float = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + capacitance_compensation: float = Field( ..., description="""Capacitance compensation, in farads, fixed to 0.0.""" ) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -282,12 +280,12 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -319,10 +317,10 @@ class CurrentClampStimulusSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -335,12 +333,12 @@ class CurrentClampStimulusSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -411,10 +409,10 @@ class VoltageClampSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -427,12 +425,12 @@ class VoltageClampSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -488,7 +486,7 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): @@ -511,7 +509,7 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): @@ -534,7 +532,7 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): @@ -557,7 +555,7 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): @@ -580,7 +578,7 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): @@ -603,7 +601,7 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): @@ -626,7 +624,7 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampStimulusSeries(PatchClampSeries): @@ -643,10 +641,10 @@ class VoltageClampStimulusSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -659,12 +657,12 @@ class VoltageClampStimulusSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -738,7 +736,7 @@ class SweepTable(DynamicTable): ) name: str = Field(...) - sweep_number: NDArray[Any, np.uint32] = Field( + sweep_number: NDArray[Any, int] = Field( ..., description="""Sweep number of the PatchClampSeries in that row.""", json_schema_extra={ diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_image.py index 11c8e94..92928c5 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_image.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_image.py @@ -71,15 +71,15 @@ class GrayscaleImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -94,15 +94,15 @@ class RGBImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -117,15 +117,15 @@ class RGBAImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -142,11 +142,11 @@ class ImageSeries(TimeSeries): name: str = Field(...) data: Optional[ Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, * z"], float], ] ] = Field(None, description="""Binary data representing images across frames.""") - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -168,12 +168,12 @@ class ImageSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -204,7 +204,7 @@ class ImageSeriesExternalFile(ConfiguredBaseModel): "linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"} }, ) - starting_frame: Optional[np.int32] = Field( + starting_frame: Optional[int] = Field( None, description="""Each external image may contain one or more consecutive frames of the full ImageSeries. This attribute serves as an index to indicate which frames each file contains, to faciliate random access. The 'starting_frame' attribute, hence, contains a list of frame numbers within the full ImageSeries of the first frame of each file listed in the parent 'external_file' dataset. Zero-based indexing is used (hence, the first element will always be zero). For example, if the 'external_file' dataset has three paths to files and the first file has 5 frames, the second file has 10 frames, and the third file has 20 frames, then this attribute will have values [0, 5, 15]. If there is a single external file that holds all of the frames of the ImageSeries (and so there is a single element in the 'external_file' dataset), then this attribute should have value [0].""", ) @@ -225,11 +225,11 @@ class ImageMaskSeries(ImageSeries): name: str = Field(...) data: Optional[ Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, * z"], float], ] ] = Field(None, description="""Binary data representing images across frames.""") - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -251,12 +251,12 @@ class ImageMaskSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -284,24 +284,23 @@ class OpticalSeries(ImageSeries): ) name: str = Field(...) - distance: Optional[np.float32] = Field( + distance: Optional[float] = Field( None, description="""Distance from camera/monitor to target/eye.""" ) field_of_view: Optional[ Union[ - NDArray[Shape["2 width_height"], np.float32], - NDArray[Shape["3 width_height_depth"], np.float32], + NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height_depth"], float] ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], float], ] = Field(..., description="""Images presented to subject, either grayscale or RGB""") orientation: Optional[str] = Field( None, description="""Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -323,12 +322,12 @@ class OpticalSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -356,7 +355,7 @@ class IndexSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.int32] = Field( + data: NDArray[Shape["* num_times"], int] = Field( ..., description="""Index of the frame in the referenced ImageSeries.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -370,12 +369,12 @@ class IndexSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_misc.py index 7694e0c..5f1e06a 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_misc.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_misc.py @@ -129,12 +129,12 @@ class AbstractFeatureSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -169,8 +169,8 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_features"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_features"], float], ] ] = Field(None) @@ -199,12 +199,12 @@ class AnnotationSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -232,7 +232,7 @@ class IntervalSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.int8] = Field( + data: NDArray[Shape["* num_times"], int] = Field( ..., description="""Use values >0 if interval started, <0 if interval ended.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -246,12 +246,12 @@ class IntervalSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -296,12 +296,12 @@ class DecompositionSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -334,7 +334,7 @@ class DecompositionSeriesData(ConfiguredBaseModel): None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) - array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], np.number]] = Field( + array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], float]] = Field( None, json_schema_extra={ "linkml_meta": { @@ -370,7 +370,7 @@ class DecompositionSeriesBands(DynamicTable): } }, ) - band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field( + band_limits: NDArray[Shape["* num_bands, 2 low_high"], float] = Field( ..., description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""", json_schema_extra={ @@ -384,12 +384,12 @@ class DecompositionSeriesBands(DynamicTable): } }, ) - band_mean: NDArray[Shape["* num_bands"], np.float32] = Field( + band_mean: NDArray[Shape["* num_bands"], float] = Field( ..., description="""The mean Gaussian filters, in Hz.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_bands"}]}}}, ) - band_stdev: NDArray[Shape["* num_bands"], np.float32] = Field( + band_stdev: NDArray[Shape["* num_bands"], float] = Field( ..., description="""The standard deviation of Gaussian filters, in Hz.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_bands"}]}}}, @@ -441,7 +441,7 @@ class Units(DynamicTable): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field( + obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], float]] = Field( None, description="""Observation intervals for each unit.""", json_schema_extra={ @@ -474,14 +474,14 @@ class Units(DynamicTable): ) waveform_mean: Optional[ Union[ - NDArray[Shape["* num_units, * num_samples"], np.float32], - NDArray[Shape["* num_units, * num_samples, * num_electrodes"], np.float32], + NDArray[Shape["* num_units, * num_samples"], float], + NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float], ] ] = Field(None, description="""Spike waveform mean for each spike unit.""") waveform_sd: Optional[ Union[ - NDArray[Shape["* num_units, * num_samples"], np.float32], - NDArray[Shape["* num_units, * num_samples, * num_electrodes"], np.float32], + NDArray[Shape["* num_units, * num_samples"], float], + NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float], ] ] = Field(None, description="""Spike waveform standard deviation for each spike unit.""") colnames: Optional[str] = Field( @@ -517,7 +517,7 @@ class UnitsSpikeTimes(VectorData): "linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"} }, ) - resolution: Optional[np.float64] = Field( + resolution: Optional[float] = Field( None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ogen.py index 9be92dd..b34d130 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ogen.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ogen.py @@ -76,7 +76,7 @@ class OptogeneticSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.number] = Field( + data: NDArray[Shape["* num_times"], float] = Field( ..., description="""Applied power for optogenetic stimulus, in watts.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -90,12 +90,12 @@ class OptogeneticSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -124,7 +124,7 @@ class OptogeneticStimulusSite(NWBContainer): name: str = Field(...) description: str = Field(..., description="""Description of stimulation site.""") - excitation_lambda: np.float32 = Field(..., description="""Excitation wavelength, in nm.""") + excitation_lambda: float = Field(..., description="""Excitation wavelength, in nm.""") location: str = Field( ..., description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ophys.py index 4a1b85f..3fe9760 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ophys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ophys.py @@ -109,24 +109,21 @@ class TwoPhotonSeries(ImageSeries): ) name: str = Field(...) - pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") - scan_line_rate: Optional[np.float32] = Field( + pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""") + scan_line_rate: Optional[float] = Field( None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) field_of_view: Optional[ - Union[ - NDArray[Shape["2 width_height"], np.float32], - NDArray[Shape["3 width_height"], np.float32], - ] + Union[NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height"], float]] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Optional[ Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, * z"], float], ] ] = Field(None, description="""Binary data representing images across frames.""") - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -148,12 +145,12 @@ class TwoPhotonSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -182,8 +179,7 @@ class RoiResponseSeries(TimeSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_rois"], np.number], + NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times, * num_rois"], float] ] = Field(..., description="""Signals from ROIs.""") rois: Named[DynamicTableRegion] = Field( ..., @@ -201,12 +197,12 @@ class RoiResponseSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_retinotopy.py index b1c56d8..8ba1ae3 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_retinotopy.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_retinotopy.py @@ -127,17 +127,15 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -161,17 +159,15 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -195,17 +191,15 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -229,17 +223,15 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -263,24 +255,20 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): } }, ) - bits_per_pixel: Optional[np.int32] = Field( + bits_per_pixel: Optional[int] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""", ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) - focal_depth: Optional[np.float32] = Field( - None, description="""Focal depth offset, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") + focal_depth: Optional[float] = Field(None, description="""Focal depth offset, in meters.""") format: Optional[str] = Field( None, description="""Format of image. Right now only 'raw' is supported.""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -301,14 +289,12 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel): "linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"} }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -332,21 +318,19 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): } }, ) - bits_per_pixel: Optional[np.int32] = Field( + bits_per_pixel: Optional[int] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value""", ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") format: Optional[str] = Field( None, description="""Format of image. Right now only 'raw' is supported.""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_base.py index 0cec2c7..8b60948 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_base.py @@ -83,15 +83,15 @@ class Image(NWBData): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -143,12 +143,12 @@ class TimeSeries(NWBDataInterface): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -177,11 +177,11 @@ class TimeSeriesData(ConfiguredBaseModel): "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) - conversion: Optional[np.float32] = Field( + conversion: Optional[float] = Field( None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""", ) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""", ) @@ -212,11 +212,11 @@ class TimeSeriesStartingTime(ConfiguredBaseModel): "linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"} }, ) - rate: Optional[np.float32] = Field(None, description="""Sampling rate, in Hz.""") + rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""") unit: Optional[str] = Field( None, description="""Unit of measurement for time, which is fixed to 'seconds'.""" ) - value: np.float64 = Field(...) + value: float = Field(...) class TimeSeriesSync(ConfiguredBaseModel): diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_behavior.py index a3f0972..6bd2d26 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_behavior.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_behavior.py @@ -93,12 +93,12 @@ class SpatialSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -133,8 +133,8 @@ class SpatialSeriesData(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_features"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_features"], float], ] ] = Field(None) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ecephys.py index b34ac7d..8e8528b 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ecephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ecephys.py @@ -108,9 +108,9 @@ class ElectricalSeries(TimeSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_channels"], np.number], - NDArray[Shape["* num_times, * num_channels, * num_samples"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_channels"], float], + NDArray[Shape["* num_times, * num_channels, * num_samples"], float], ] = Field(..., description="""Recorded voltage data.""") electrodes: Named[DynamicTableRegion] = Field( ..., @@ -119,7 +119,7 @@ class ElectricalSeries(TimeSeries): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( + channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field( None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}}, @@ -133,12 +133,12 @@ class ElectricalSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -167,10 +167,10 @@ class SpikeEventSeries(ElectricalSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_events, * num_samples"], np.number], - NDArray[Shape["* num_events, * num_channels, * num_samples"], np.number], + NDArray[Shape["* num_events, * num_samples"], float], + NDArray[Shape["* num_events, * num_channels, * num_samples"], float], ] = Field(..., description="""Spike waveforms.""") - timestamps: NDArray[Shape["* num_times"], np.float64] = Field( + timestamps: NDArray[Shape["* num_times"], float] = Field( ..., description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -182,7 +182,7 @@ class SpikeEventSeries(ElectricalSeries): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( + channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field( None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}}, @@ -196,7 +196,7 @@ class SpikeEventSeries(ElectricalSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -232,7 +232,7 @@ class FeatureExtraction(NWBDataInterface): description="""Description of features (eg, ''PC1'') for each of the extracted features.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_features"}]}}}, ) - features: NDArray[Shape["* num_events, * num_channels, * num_features"], np.float32] = Field( + features: NDArray[Shape["* num_events, * num_channels, * num_features"], float] = Field( ..., description="""Multi-dimensional array of features extracted from each event.""", json_schema_extra={ @@ -247,7 +247,7 @@ class FeatureExtraction(NWBDataInterface): } }, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Times of events that features correspond to (can be a link).""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, @@ -277,12 +277,12 @@ class EventDetection(NWBDataInterface): ..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""", ) - source_idx: NDArray[Shape["* num_events"], np.int32] = Field( + source_idx: NDArray[Shape["* num_events"], int] = Field( ..., description="""Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Timestamps of events, in seconds.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, @@ -367,9 +367,9 @@ class ElectrodeGroupPosition(ConfiguredBaseModel): "linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"} }, ) - x: Optional[np.float32] = Field(None, description="""x coordinate""") - y: Optional[np.float32] = Field(None, description="""y coordinate""") - z: Optional[np.float32] = Field(None, description="""z coordinate""") + x: Optional[float] = Field(None, description="""x coordinate""") + y: Optional[float] = Field(None, description="""y coordinate""") + z: Optional[float] = Field(None, description="""z coordinate""") class ClusterWaveforms(NWBDataInterface): @@ -388,7 +388,7 @@ class ClusterWaveforms(NWBDataInterface): waveform_filtering: str = Field( ..., description="""Filtering applied to data before generating mean/sd""" ) - waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( + waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], float] = Field( ..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""", json_schema_extra={ @@ -397,7 +397,7 @@ class ClusterWaveforms(NWBDataInterface): } }, ) - waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( + waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], float] = Field( ..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""", json_schema_extra={ @@ -424,17 +424,17 @@ class Clustering(NWBDataInterface): ..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""", ) - num: NDArray[Shape["* num_events"], np.int32] = Field( + num: NDArray[Shape["* num_events"], int] = Field( ..., description="""Cluster number of each event""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, ) - peak_over_rms: NDArray[Shape["* num_clusters"], np.float32] = Field( + peak_over_rms: NDArray[Shape["* num_clusters"], float] = Field( ..., description="""Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}]}}}, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_epoch.py index 1cb1305..4f1a792 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_epoch.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_epoch.py @@ -96,7 +96,7 @@ class TimeIntervals(DynamicTable): ) name: str = Field(...) - start_time: NDArray[Any, np.float32] = Field( + start_time: NDArray[Any, float] = Field( ..., description="""Start time of epoch, in seconds.""", json_schema_extra={ @@ -105,7 +105,7 @@ class TimeIntervals(DynamicTable): } }, ) - stop_time: NDArray[Any, np.float32] = Field( + stop_time: NDArray[Any, float] = Field( ..., description="""Stop time of epoch, in seconds.""", json_schema_extra={ @@ -173,11 +173,11 @@ class TimeIntervalsTimeseries(VectorData): "linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"} }, ) - idx_start: Optional[np.int32] = Field( + idx_start: Optional[int] = Field( None, description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) - count: Optional[np.int32] = Field( + count: Optional[int] = Field( None, description="""Number of data samples available in this time series, during this epoch.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_file.py index ac4135f..6aba2d7 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_file.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_file.py @@ -118,7 +118,7 @@ class NWBFile(NWBContainer): None, description="""File version string. Use semantic versioning, e.g. 1.2.1. This will be the name of the format with trailing major, minor and patch numbers.""", ) - file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = Field( + file_create_date: NDArray[Shape["* num_modifications"], datetime] = Field( ..., description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""", json_schema_extra={ @@ -132,11 +132,11 @@ class NWBFile(NWBContainer): session_description: str = Field( ..., description="""A description of the experimental session and data in the file.""" ) - session_start_time: np.datetime64 = Field( + session_start_time: datetime = Field( ..., description="""Date and time of the experiment/session start. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds.""", ) - timestamps_reference_time: np.datetime64 = Field( + timestamps_reference_time: datetime = Field( ..., description="""Date and time corresponding to time zero of all timestamps. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. All times stored in the file use this time as reference (i.e., time zero).""", ) @@ -372,7 +372,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): "linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"} }, ) - x: NDArray[Any, np.float32] = Field( + x: NDArray[Any, float] = Field( ..., description="""x coordinate of the channel location in the brain (+x is posterior).""", json_schema_extra={ @@ -381,7 +381,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - y: NDArray[Any, np.float32] = Field( + y: NDArray[Any, float] = Field( ..., description="""y coordinate of the channel location in the brain (+y is inferior).""", json_schema_extra={ @@ -390,7 +390,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - z: NDArray[Any, np.float32] = Field( + z: NDArray[Any, float] = Field( ..., description="""z coordinate of the channel location in the brain (+z is right).""", json_schema_extra={ @@ -399,7 +399,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - imp: NDArray[Any, np.float32] = Field( + imp: NDArray[Any, float] = Field( ..., description="""Impedance of the channel.""", json_schema_extra={ @@ -417,7 +417,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - filtering: NDArray[Any, np.float32] = Field( + filtering: NDArray[Any, float] = Field( ..., description="""Description of hardware filtering.""", json_schema_extra={ @@ -438,7 +438,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_x: Optional[NDArray[Any, np.float32]] = Field( + rel_x: Optional[NDArray[Any, float]] = Field( None, description="""x coordinate in electrode group""", json_schema_extra={ @@ -447,7 +447,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_y: Optional[NDArray[Any, np.float32]] = Field( + rel_y: Optional[NDArray[Any, float]] = Field( None, description="""y coordinate in electrode group""", json_schema_extra={ @@ -456,7 +456,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_z: Optional[NDArray[Any, np.float32]] = Field( + rel_z: Optional[NDArray[Any, float]] = Field( None, description="""z coordinate in electrode group""", json_schema_extra={ @@ -547,7 +547,7 @@ class Subject(NWBContainer): age: Optional[str] = Field( None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""" ) - date_of_birth: Optional[np.datetime64] = Field( + date_of_birth: Optional[datetime] = Field( None, description="""Date of birth of subject. Can be supplied instead of 'age'.""" ) description: Optional[str] = Field( diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_icephys.py index d7e6f39..f0a8769 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_icephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_icephys.py @@ -109,11 +109,11 @@ class PatchClampSeries(TimeSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""") - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -126,12 +126,12 @@ class PatchClampSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -164,7 +164,7 @@ class PatchClampSeriesData(ConfiguredBaseModel): None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) - array: Optional[NDArray[Shape["* num_times"], np.number]] = Field( + array: Optional[NDArray[Shape["* num_times"], float]] = Field( None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}} ) @@ -180,18 +180,18 @@ class CurrentClampSeries(PatchClampSeries): name: str = Field(...) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") - bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""") - bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""") - capacitance_compensation: Optional[np.float32] = Field( + bias_current: Optional[float] = Field(None, description="""Bias current, in amps.""") + bridge_balance: Optional[float] = Field(None, description="""Bridge balance, in ohms.""") + capacitance_compensation: Optional[float] = Field( None, description="""Capacitance compensation, in farads.""" ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -204,12 +204,12 @@ class CurrentClampSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -255,21 +255,19 @@ class IZeroClampSeries(CurrentClampSeries): ) name: str = Field(...) - bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""") - bridge_balance: np.float32 = Field( - ..., description="""Bridge balance, in ohms, fixed to 0.0.""" - ) - capacitance_compensation: np.float32 = Field( + bias_current: float = Field(..., description="""Bias current, in amps, fixed to 0.0.""") + bridge_balance: float = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + capacitance_compensation: float = Field( ..., description="""Capacitance compensation, in farads, fixed to 0.0.""" ) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -282,12 +280,12 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -319,10 +317,10 @@ class CurrentClampStimulusSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -335,12 +333,12 @@ class CurrentClampStimulusSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -411,10 +409,10 @@ class VoltageClampSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -427,12 +425,12 @@ class VoltageClampSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -488,7 +486,7 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): @@ -511,7 +509,7 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): @@ -534,7 +532,7 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): @@ -557,7 +555,7 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): @@ -580,7 +578,7 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): @@ -603,7 +601,7 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): @@ -626,7 +624,7 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampStimulusSeries(PatchClampSeries): @@ -643,10 +641,10 @@ class VoltageClampStimulusSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -659,12 +657,12 @@ class VoltageClampStimulusSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -738,7 +736,7 @@ class SweepTable(DynamicTable): ) name: str = Field(...) - sweep_number: NDArray[Any, np.uint32] = Field( + sweep_number: NDArray[Any, int] = Field( ..., description="""Sweep number of the PatchClampSeries in that row.""", json_schema_extra={ diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_image.py index 4bd8bd5..09f7cf1 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_image.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_image.py @@ -71,15 +71,15 @@ class GrayscaleImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -94,15 +94,15 @@ class RGBImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -117,15 +117,15 @@ class RGBAImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -142,11 +142,11 @@ class ImageSeries(TimeSeries): name: str = Field(...) data: Optional[ Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, * z"], float], ] ] = Field(None, description="""Binary data representing images across frames.""") - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -168,12 +168,12 @@ class ImageSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -204,7 +204,7 @@ class ImageSeriesExternalFile(ConfiguredBaseModel): "linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"} }, ) - starting_frame: Optional[np.int32] = Field( + starting_frame: Optional[int] = Field( None, description="""Each external image may contain one or more consecutive frames of the full ImageSeries. This attribute serves as an index to indicate which frames each file contains, to faciliate random access. The 'starting_frame' attribute, hence, contains a list of frame numbers within the full ImageSeries of the first frame of each file listed in the parent 'external_file' dataset. Zero-based indexing is used (hence, the first element will always be zero). For example, if the 'external_file' dataset has three paths to files and the first file has 5 frames, the second file has 10 frames, and the third file has 20 frames, then this attribute will have values [0, 5, 15]. If there is a single external file that holds all of the frames of the ImageSeries (and so there is a single element in the 'external_file' dataset), then this attribute should have value [0].""", ) @@ -225,11 +225,11 @@ class ImageMaskSeries(ImageSeries): name: str = Field(...) data: Optional[ Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, * z"], float], ] ] = Field(None, description="""Binary data representing images across frames.""") - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -251,12 +251,12 @@ class ImageMaskSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -284,24 +284,23 @@ class OpticalSeries(ImageSeries): ) name: str = Field(...) - distance: Optional[np.float32] = Field( + distance: Optional[float] = Field( None, description="""Distance from camera/monitor to target/eye.""" ) field_of_view: Optional[ Union[ - NDArray[Shape["2 width_height"], np.float32], - NDArray[Shape["3 width_height_depth"], np.float32], + NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height_depth"], float] ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], float], ] = Field(..., description="""Images presented to subject, either grayscale or RGB""") orientation: Optional[str] = Field( None, description="""Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -323,12 +322,12 @@ class OpticalSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -356,7 +355,7 @@ class IndexSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.int32] = Field( + data: NDArray[Shape["* num_times"], int] = Field( ..., description="""Index of the frame in the referenced ImageSeries.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -370,12 +369,12 @@ class IndexSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_misc.py index 4b5b92a..9cd8b01 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_misc.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_misc.py @@ -129,12 +129,12 @@ class AbstractFeatureSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -169,8 +169,8 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_features"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_features"], float], ] ] = Field(None) @@ -199,12 +199,12 @@ class AnnotationSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -232,7 +232,7 @@ class IntervalSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.int8] = Field( + data: NDArray[Shape["* num_times"], int] = Field( ..., description="""Use values >0 if interval started, <0 if interval ended.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -246,12 +246,12 @@ class IntervalSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -296,12 +296,12 @@ class DecompositionSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -334,7 +334,7 @@ class DecompositionSeriesData(ConfiguredBaseModel): None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) - array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], np.number]] = Field( + array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], float]] = Field( None, json_schema_extra={ "linkml_meta": { @@ -370,7 +370,7 @@ class DecompositionSeriesBands(DynamicTable): } }, ) - band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field( + band_limits: NDArray[Shape["* num_bands, 2 low_high"], float] = Field( ..., description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""", json_schema_extra={ @@ -384,12 +384,12 @@ class DecompositionSeriesBands(DynamicTable): } }, ) - band_mean: NDArray[Shape["* num_bands"], np.float32] = Field( + band_mean: NDArray[Shape["* num_bands"], float] = Field( ..., description="""The mean Gaussian filters, in Hz.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_bands"}]}}}, ) - band_stdev: NDArray[Shape["* num_bands"], np.float32] = Field( + band_stdev: NDArray[Shape["* num_bands"], float] = Field( ..., description="""The standard deviation of Gaussian filters, in Hz.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_bands"}]}}}, @@ -441,7 +441,7 @@ class Units(DynamicTable): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field( + obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], float]] = Field( None, description="""Observation intervals for each unit.""", json_schema_extra={ @@ -474,14 +474,14 @@ class Units(DynamicTable): ) waveform_mean: Optional[ Union[ - NDArray[Shape["* num_units, * num_samples"], np.float32], - NDArray[Shape["* num_units, * num_samples, * num_electrodes"], np.float32], + NDArray[Shape["* num_units, * num_samples"], float], + NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float], ] ] = Field(None, description="""Spike waveform mean for each spike unit.""") waveform_sd: Optional[ Union[ - NDArray[Shape["* num_units, * num_samples"], np.float32], - NDArray[Shape["* num_units, * num_samples, * num_electrodes"], np.float32], + NDArray[Shape["* num_units, * num_samples"], float], + NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float], ] ] = Field(None, description="""Spike waveform standard deviation for each spike unit.""") colnames: Optional[str] = Field( @@ -517,7 +517,7 @@ class UnitsSpikeTimes(VectorData): "linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"} }, ) - resolution: Optional[np.float64] = Field( + resolution: Optional[float] = Field( None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ogen.py index 06238c6..6f6995d 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ogen.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ogen.py @@ -76,7 +76,7 @@ class OptogeneticSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.number] = Field( + data: NDArray[Shape["* num_times"], float] = Field( ..., description="""Applied power for optogenetic stimulus, in watts.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -90,12 +90,12 @@ class OptogeneticSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -124,7 +124,7 @@ class OptogeneticStimulusSite(NWBContainer): name: str = Field(...) description: str = Field(..., description="""Description of stimulation site.""") - excitation_lambda: np.float32 = Field(..., description="""Excitation wavelength, in nm.""") + excitation_lambda: float = Field(..., description="""Excitation wavelength, in nm.""") location: str = Field( ..., description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ophys.py index 76d1dae..8506e83 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ophys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ophys.py @@ -114,24 +114,21 @@ class TwoPhotonSeries(ImageSeries): ) name: str = Field(...) - pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") - scan_line_rate: Optional[np.float32] = Field( + pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""") + scan_line_rate: Optional[float] = Field( None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) field_of_view: Optional[ - Union[ - NDArray[Shape["2 width_height"], np.float32], - NDArray[Shape["3 width_height"], np.float32], - ] + Union[NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height"], float]] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Optional[ Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, * z"], float], ] ] = Field(None, description="""Binary data representing images across frames.""") - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -153,12 +150,12 @@ class TwoPhotonSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -187,8 +184,7 @@ class RoiResponseSeries(TimeSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_rois"], np.number], + NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times, * num_rois"], float] ] = Field(..., description="""Signals from ROIs.""") rois: Named[DynamicTableRegion] = Field( ..., @@ -206,12 +202,12 @@ class RoiResponseSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -374,9 +370,9 @@ class PlaneSegmentationPixelMask(VectorData): "linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"} }, ) - x: Optional[np.uint32] = Field(None, description="""Pixel x-coordinate.""") - y: Optional[np.uint32] = Field(None, description="""Pixel y-coordinate.""") - weight: Optional[np.float32] = Field(None, description="""Weight of the pixel.""") + x: Optional[int] = Field(None, description="""Pixel x-coordinate.""") + y: Optional[int] = Field(None, description="""Pixel y-coordinate.""") + weight: Optional[float] = Field(None, description="""Weight of the pixel.""") description: Optional[str] = Field( None, description="""Description of what these vectors represent.""" ) @@ -403,10 +399,10 @@ class PlaneSegmentationVoxelMask(VectorData): "linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"} }, ) - x: Optional[np.uint32] = Field(None, description="""Voxel x-coordinate.""") - y: Optional[np.uint32] = Field(None, description="""Voxel y-coordinate.""") - z: Optional[np.uint32] = Field(None, description="""Voxel z-coordinate.""") - weight: Optional[np.float32] = Field(None, description="""Weight of the voxel.""") + x: Optional[int] = Field(None, description="""Voxel x-coordinate.""") + y: Optional[int] = Field(None, description="""Voxel y-coordinate.""") + z: Optional[int] = Field(None, description="""Voxel z-coordinate.""") + weight: Optional[float] = Field(None, description="""Weight of the voxel.""") description: Optional[str] = Field( None, description="""Description of what these vectors represent.""" ) @@ -446,9 +442,7 @@ class OpticalChannel(NWBContainer): name: str = Field(...) description: str = Field(..., description="""Description or other notes about the channel.""") - emission_lambda: np.float32 = Field( - ..., description="""Emission wavelength for channel, in nm.""" - ) + emission_lambda: float = Field(..., description="""Emission wavelength for channel, in nm.""") class MotionCorrection(NWBDataInterface): diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_retinotopy.py index b204be8..e1dfcb7 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_retinotopy.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_retinotopy.py @@ -127,17 +127,15 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -161,17 +159,15 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -195,17 +191,15 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -229,17 +223,15 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -263,24 +255,20 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): } }, ) - bits_per_pixel: Optional[np.int32] = Field( + bits_per_pixel: Optional[int] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""", ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) - focal_depth: Optional[np.float32] = Field( - None, description="""Focal depth offset, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") + focal_depth: Optional[float] = Field(None, description="""Focal depth offset, in meters.""") format: Optional[str] = Field( None, description="""Format of image. Right now only 'raw' is supported.""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -301,14 +289,12 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel): "linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"} }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -332,21 +318,19 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): } }, ) - bits_per_pixel: Optional[np.int32] = Field( + bits_per_pixel: Optional[int] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value""", ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") format: Optional[str] = Field( None, description="""Format of image. Right now only 'raw' is supported.""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_base.py index defb8e9..4e739b3 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_base.py @@ -83,15 +83,15 @@ class Image(NWBData): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -143,12 +143,12 @@ class TimeSeries(NWBDataInterface): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -177,11 +177,11 @@ class TimeSeriesData(ConfiguredBaseModel): "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) - conversion: Optional[np.float32] = Field( + conversion: Optional[float] = Field( None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""", ) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""", ) @@ -212,11 +212,11 @@ class TimeSeriesStartingTime(ConfiguredBaseModel): "linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"} }, ) - rate: Optional[np.float32] = Field(None, description="""Sampling rate, in Hz.""") + rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""") unit: Optional[str] = Field( None, description="""Unit of measurement for time, which is fixed to 'seconds'.""" ) - value: np.float64 = Field(...) + value: float = Field(...) class TimeSeriesSync(ConfiguredBaseModel): diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_behavior.py index 012e884..01ed338 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_behavior.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_behavior.py @@ -93,12 +93,12 @@ class SpatialSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -133,8 +133,8 @@ class SpatialSeriesData(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_features"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_features"], float], ] ] = Field(None) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ecephys.py index 5f4bd2c..ef56d6a 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ecephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ecephys.py @@ -108,9 +108,9 @@ class ElectricalSeries(TimeSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_channels"], np.number], - NDArray[Shape["* num_times, * num_channels, * num_samples"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_channels"], float], + NDArray[Shape["* num_times, * num_channels, * num_samples"], float], ] = Field(..., description="""Recorded voltage data.""") electrodes: Named[DynamicTableRegion] = Field( ..., @@ -119,7 +119,7 @@ class ElectricalSeries(TimeSeries): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( + channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field( None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}}, @@ -133,12 +133,12 @@ class ElectricalSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -167,10 +167,10 @@ class SpikeEventSeries(ElectricalSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_events, * num_samples"], np.number], - NDArray[Shape["* num_events, * num_channels, * num_samples"], np.number], + NDArray[Shape["* num_events, * num_samples"], float], + NDArray[Shape["* num_events, * num_channels, * num_samples"], float], ] = Field(..., description="""Spike waveforms.""") - timestamps: NDArray[Shape["* num_times"], np.float64] = Field( + timestamps: NDArray[Shape["* num_times"], float] = Field( ..., description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -182,7 +182,7 @@ class SpikeEventSeries(ElectricalSeries): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( + channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field( None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}}, @@ -196,7 +196,7 @@ class SpikeEventSeries(ElectricalSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -232,7 +232,7 @@ class FeatureExtraction(NWBDataInterface): description="""Description of features (eg, ''PC1'') for each of the extracted features.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_features"}]}}}, ) - features: NDArray[Shape["* num_events, * num_channels, * num_features"], np.float32] = Field( + features: NDArray[Shape["* num_events, * num_channels, * num_features"], float] = Field( ..., description="""Multi-dimensional array of features extracted from each event.""", json_schema_extra={ @@ -247,7 +247,7 @@ class FeatureExtraction(NWBDataInterface): } }, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Times of events that features correspond to (can be a link).""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, @@ -277,12 +277,12 @@ class EventDetection(NWBDataInterface): ..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""", ) - source_idx: NDArray[Shape["* num_events"], np.int32] = Field( + source_idx: NDArray[Shape["* num_events"], int] = Field( ..., description="""Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Timestamps of events, in seconds.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, @@ -367,9 +367,9 @@ class ElectrodeGroupPosition(ConfiguredBaseModel): "linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"} }, ) - x: Optional[np.float32] = Field(None, description="""x coordinate""") - y: Optional[np.float32] = Field(None, description="""y coordinate""") - z: Optional[np.float32] = Field(None, description="""z coordinate""") + x: Optional[float] = Field(None, description="""x coordinate""") + y: Optional[float] = Field(None, description="""y coordinate""") + z: Optional[float] = Field(None, description="""z coordinate""") class ClusterWaveforms(NWBDataInterface): @@ -388,7 +388,7 @@ class ClusterWaveforms(NWBDataInterface): waveform_filtering: str = Field( ..., description="""Filtering applied to data before generating mean/sd""" ) - waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( + waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], float] = Field( ..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""", json_schema_extra={ @@ -397,7 +397,7 @@ class ClusterWaveforms(NWBDataInterface): } }, ) - waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( + waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], float] = Field( ..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""", json_schema_extra={ @@ -424,17 +424,17 @@ class Clustering(NWBDataInterface): ..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""", ) - num: NDArray[Shape["* num_events"], np.int32] = Field( + num: NDArray[Shape["* num_events"], int] = Field( ..., description="""Cluster number of each event""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, ) - peak_over_rms: NDArray[Shape["* num_clusters"], np.float32] = Field( + peak_over_rms: NDArray[Shape["* num_clusters"], float] = Field( ..., description="""Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}]}}}, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_epoch.py index e1b3da9..9ce71f4 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_epoch.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_epoch.py @@ -96,7 +96,7 @@ class TimeIntervals(DynamicTable): ) name: str = Field(...) - start_time: NDArray[Any, np.float32] = Field( + start_time: NDArray[Any, float] = Field( ..., description="""Start time of epoch, in seconds.""", json_schema_extra={ @@ -105,7 +105,7 @@ class TimeIntervals(DynamicTable): } }, ) - stop_time: NDArray[Any, np.float32] = Field( + stop_time: NDArray[Any, float] = Field( ..., description="""Stop time of epoch, in seconds.""", json_schema_extra={ @@ -173,11 +173,11 @@ class TimeIntervalsTimeseries(VectorData): "linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"} }, ) - idx_start: Optional[np.int32] = Field( + idx_start: Optional[int] = Field( None, description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) - count: Optional[np.int32] = Field( + count: Optional[int] = Field( None, description="""Number of data samples available in this time series, during this epoch.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_file.py index d2a1e8f..22730c2 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_file.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_file.py @@ -118,7 +118,7 @@ class NWBFile(NWBContainer): None, description="""File version string. Use semantic versioning, e.g. 1.2.1. This will be the name of the format with trailing major, minor and patch numbers.""", ) - file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = Field( + file_create_date: NDArray[Shape["* num_modifications"], datetime] = Field( ..., description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""", json_schema_extra={ @@ -132,11 +132,11 @@ class NWBFile(NWBContainer): session_description: str = Field( ..., description="""A description of the experimental session and data in the file.""" ) - session_start_time: np.datetime64 = Field( + session_start_time: datetime = Field( ..., description="""Date and time of the experiment/session start. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds.""", ) - timestamps_reference_time: np.datetime64 = Field( + timestamps_reference_time: datetime = Field( ..., description="""Date and time corresponding to time zero of all timestamps. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. All times stored in the file use this time as reference (i.e., time zero).""", ) @@ -372,7 +372,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): "linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"} }, ) - x: NDArray[Any, np.float32] = Field( + x: NDArray[Any, float] = Field( ..., description="""x coordinate of the channel location in the brain (+x is posterior).""", json_schema_extra={ @@ -381,7 +381,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - y: NDArray[Any, np.float32] = Field( + y: NDArray[Any, float] = Field( ..., description="""y coordinate of the channel location in the brain (+y is inferior).""", json_schema_extra={ @@ -390,7 +390,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - z: NDArray[Any, np.float32] = Field( + z: NDArray[Any, float] = Field( ..., description="""z coordinate of the channel location in the brain (+z is right).""", json_schema_extra={ @@ -399,7 +399,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - imp: NDArray[Any, np.float32] = Field( + imp: NDArray[Any, float] = Field( ..., description="""Impedance of the channel.""", json_schema_extra={ @@ -417,7 +417,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - filtering: NDArray[Any, np.float32] = Field( + filtering: NDArray[Any, float] = Field( ..., description="""Description of hardware filtering.""", json_schema_extra={ @@ -438,7 +438,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_x: Optional[NDArray[Any, np.float32]] = Field( + rel_x: Optional[NDArray[Any, float]] = Field( None, description="""x coordinate in electrode group""", json_schema_extra={ @@ -447,7 +447,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_y: Optional[NDArray[Any, np.float32]] = Field( + rel_y: Optional[NDArray[Any, float]] = Field( None, description="""y coordinate in electrode group""", json_schema_extra={ @@ -456,7 +456,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_z: Optional[NDArray[Any, np.float32]] = Field( + rel_z: Optional[NDArray[Any, float]] = Field( None, description="""z coordinate in electrode group""", json_schema_extra={ @@ -547,7 +547,7 @@ class Subject(NWBContainer): age: Optional[str] = Field( None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""" ) - date_of_birth: Optional[np.datetime64] = Field( + date_of_birth: Optional[datetime] = Field( None, description="""Date of birth of subject. Can be supplied instead of 'age'.""" ) description: Optional[str] = Field( diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_icephys.py index 166ecb0..795f4b4 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_icephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_icephys.py @@ -109,11 +109,11 @@ class PatchClampSeries(TimeSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""") - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -126,12 +126,12 @@ class PatchClampSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -164,7 +164,7 @@ class PatchClampSeriesData(ConfiguredBaseModel): None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) - array: Optional[NDArray[Shape["* num_times"], np.number]] = Field( + array: Optional[NDArray[Shape["* num_times"], float]] = Field( None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}} ) @@ -180,18 +180,18 @@ class CurrentClampSeries(PatchClampSeries): name: str = Field(...) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") - bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""") - bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""") - capacitance_compensation: Optional[np.float32] = Field( + bias_current: Optional[float] = Field(None, description="""Bias current, in amps.""") + bridge_balance: Optional[float] = Field(None, description="""Bridge balance, in ohms.""") + capacitance_compensation: Optional[float] = Field( None, description="""Capacitance compensation, in farads.""" ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -204,12 +204,12 @@ class CurrentClampSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -255,21 +255,19 @@ class IZeroClampSeries(CurrentClampSeries): ) name: str = Field(...) - bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""") - bridge_balance: np.float32 = Field( - ..., description="""Bridge balance, in ohms, fixed to 0.0.""" - ) - capacitance_compensation: np.float32 = Field( + bias_current: float = Field(..., description="""Bias current, in amps, fixed to 0.0.""") + bridge_balance: float = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + capacitance_compensation: float = Field( ..., description="""Capacitance compensation, in farads, fixed to 0.0.""" ) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -282,12 +280,12 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -319,10 +317,10 @@ class CurrentClampStimulusSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -335,12 +333,12 @@ class CurrentClampStimulusSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -411,10 +409,10 @@ class VoltageClampSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -427,12 +425,12 @@ class VoltageClampSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -488,7 +486,7 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): @@ -511,7 +509,7 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): @@ -534,7 +532,7 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): @@ -557,7 +555,7 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): @@ -580,7 +578,7 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): @@ -603,7 +601,7 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): @@ -626,7 +624,7 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampStimulusSeries(PatchClampSeries): @@ -643,10 +641,10 @@ class VoltageClampStimulusSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -659,12 +657,12 @@ class VoltageClampStimulusSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -738,7 +736,7 @@ class SweepTable(DynamicTable): ) name: str = Field(...) - sweep_number: NDArray[Any, np.uint32] = Field( + sweep_number: NDArray[Any, int] = Field( ..., description="""Sweep number of the PatchClampSeries in that row.""", json_schema_extra={ diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_image.py index b74228e..7b0a102 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_image.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_image.py @@ -71,15 +71,15 @@ class GrayscaleImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -94,15 +94,15 @@ class RGBImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -117,15 +117,15 @@ class RGBAImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -142,11 +142,11 @@ class ImageSeries(TimeSeries): name: str = Field(...) data: Optional[ Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, * z"], float], ] ] = Field(None, description="""Binary data representing images across frames.""") - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -168,12 +168,12 @@ class ImageSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -204,7 +204,7 @@ class ImageSeriesExternalFile(ConfiguredBaseModel): "linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"} }, ) - starting_frame: Optional[np.int32] = Field( + starting_frame: Optional[int] = Field( None, description="""Each external image may contain one or more consecutive frames of the full ImageSeries. This attribute serves as an index to indicate which frames each file contains, to faciliate random access. The 'starting_frame' attribute, hence, contains a list of frame numbers within the full ImageSeries of the first frame of each file listed in the parent 'external_file' dataset. Zero-based indexing is used (hence, the first element will always be zero). For example, if the 'external_file' dataset has three paths to files and the first file has 5 frames, the second file has 10 frames, and the third file has 20 frames, then this attribute will have values [0, 5, 15]. If there is a single external file that holds all of the frames of the ImageSeries (and so there is a single element in the 'external_file' dataset), then this attribute should have value [0].""", ) @@ -225,11 +225,11 @@ class ImageMaskSeries(ImageSeries): name: str = Field(...) data: Optional[ Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, * z"], float], ] ] = Field(None, description="""Binary data representing images across frames.""") - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -251,12 +251,12 @@ class ImageMaskSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -284,24 +284,23 @@ class OpticalSeries(ImageSeries): ) name: str = Field(...) - distance: Optional[np.float32] = Field( + distance: Optional[float] = Field( None, description="""Distance from camera/monitor to target/eye.""" ) field_of_view: Optional[ Union[ - NDArray[Shape["2 width_height"], np.float32], - NDArray[Shape["3 width_height_depth"], np.float32], + NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height_depth"], float] ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], float], ] = Field(..., description="""Images presented to subject, either grayscale or RGB""") orientation: Optional[str] = Field( None, description="""Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -323,12 +322,12 @@ class OpticalSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -356,7 +355,7 @@ class IndexSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.int32] = Field( + data: NDArray[Shape["* num_times"], int] = Field( ..., description="""Index of the frame in the referenced ImageSeries.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -370,12 +369,12 @@ class IndexSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_misc.py index 959d2df..6fff7db 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_misc.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_misc.py @@ -129,12 +129,12 @@ class AbstractFeatureSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -169,8 +169,8 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_features"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_features"], float], ] ] = Field(None) @@ -199,12 +199,12 @@ class AnnotationSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -232,7 +232,7 @@ class IntervalSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.int8] = Field( + data: NDArray[Shape["* num_times"], int] = Field( ..., description="""Use values >0 if interval started, <0 if interval ended.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -246,12 +246,12 @@ class IntervalSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -296,12 +296,12 @@ class DecompositionSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -334,7 +334,7 @@ class DecompositionSeriesData(ConfiguredBaseModel): None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) - array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], np.number]] = Field( + array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], float]] = Field( None, json_schema_extra={ "linkml_meta": { @@ -370,7 +370,7 @@ class DecompositionSeriesBands(DynamicTable): } }, ) - band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field( + band_limits: NDArray[Shape["* num_bands, 2 low_high"], float] = Field( ..., description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""", json_schema_extra={ @@ -384,12 +384,12 @@ class DecompositionSeriesBands(DynamicTable): } }, ) - band_mean: NDArray[Shape["* num_bands"], np.float32] = Field( + band_mean: NDArray[Shape["* num_bands"], float] = Field( ..., description="""The mean Gaussian filters, in Hz.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_bands"}]}}}, ) - band_stdev: NDArray[Shape["* num_bands"], np.float32] = Field( + band_stdev: NDArray[Shape["* num_bands"], float] = Field( ..., description="""The standard deviation of Gaussian filters, in Hz.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_bands"}]}}}, @@ -441,7 +441,7 @@ class Units(DynamicTable): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field( + obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], float]] = Field( None, description="""Observation intervals for each unit.""", json_schema_extra={ @@ -474,14 +474,14 @@ class Units(DynamicTable): ) waveform_mean: Optional[ Union[ - NDArray[Shape["* num_units, * num_samples"], np.float32], - NDArray[Shape["* num_units, * num_samples, * num_electrodes"], np.float32], + NDArray[Shape["* num_units, * num_samples"], float], + NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float], ] ] = Field(None, description="""Spike waveform mean for each spike unit.""") waveform_sd: Optional[ Union[ - NDArray[Shape["* num_units, * num_samples"], np.float32], - NDArray[Shape["* num_units, * num_samples, * num_electrodes"], np.float32], + NDArray[Shape["* num_units, * num_samples"], float], + NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float], ] ] = Field(None, description="""Spike waveform standard deviation for each spike unit.""") colnames: Optional[str] = Field( @@ -517,7 +517,7 @@ class UnitsSpikeTimes(VectorData): "linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"} }, ) - resolution: Optional[np.float64] = Field( + resolution: Optional[float] = Field( None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ogen.py index 5b95cba..d6c46a3 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ogen.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ogen.py @@ -76,7 +76,7 @@ class OptogeneticSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.number] = Field( + data: NDArray[Shape["* num_times"], float] = Field( ..., description="""Applied power for optogenetic stimulus, in watts.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -90,12 +90,12 @@ class OptogeneticSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -124,7 +124,7 @@ class OptogeneticStimulusSite(NWBContainer): name: str = Field(...) description: str = Field(..., description="""Description of stimulation site.""") - excitation_lambda: np.float32 = Field(..., description="""Excitation wavelength, in nm.""") + excitation_lambda: float = Field(..., description="""Excitation wavelength, in nm.""") location: str = Field( ..., description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ophys.py index 4a695c9..32129b6 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ophys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ophys.py @@ -114,24 +114,23 @@ class TwoPhotonSeries(ImageSeries): ) name: str = Field(...) - pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") - scan_line_rate: Optional[np.float32] = Field( + pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""") + scan_line_rate: Optional[float] = Field( None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) field_of_view: Optional[ Union[ - NDArray[Shape["2 width_height"], np.float32], - NDArray[Shape["3 width_height_depth"], np.float32], + NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height_depth"], float] ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Optional[ Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, * z"], float], ] ] = Field(None, description="""Binary data representing images across frames.""") - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -153,12 +152,12 @@ class TwoPhotonSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -187,8 +186,7 @@ class RoiResponseSeries(TimeSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_rois"], np.number], + NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times, * num_rois"], float] ] = Field(..., description="""Signals from ROIs.""") rois: Named[DynamicTableRegion] = Field( ..., @@ -206,12 +204,12 @@ class RoiResponseSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -374,9 +372,9 @@ class PlaneSegmentationPixelMask(VectorData): "linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"} }, ) - x: Optional[np.uint32] = Field(None, description="""Pixel x-coordinate.""") - y: Optional[np.uint32] = Field(None, description="""Pixel y-coordinate.""") - weight: Optional[np.float32] = Field(None, description="""Weight of the pixel.""") + x: Optional[int] = Field(None, description="""Pixel x-coordinate.""") + y: Optional[int] = Field(None, description="""Pixel y-coordinate.""") + weight: Optional[float] = Field(None, description="""Weight of the pixel.""") description: Optional[str] = Field( None, description="""Description of what these vectors represent.""" ) @@ -403,10 +401,10 @@ class PlaneSegmentationVoxelMask(VectorData): "linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"} }, ) - x: Optional[np.uint32] = Field(None, description="""Voxel x-coordinate.""") - y: Optional[np.uint32] = Field(None, description="""Voxel y-coordinate.""") - z: Optional[np.uint32] = Field(None, description="""Voxel z-coordinate.""") - weight: Optional[np.float32] = Field(None, description="""Weight of the voxel.""") + x: Optional[int] = Field(None, description="""Voxel x-coordinate.""") + y: Optional[int] = Field(None, description="""Voxel y-coordinate.""") + z: Optional[int] = Field(None, description="""Voxel z-coordinate.""") + weight: Optional[float] = Field(None, description="""Weight of the voxel.""") description: Optional[str] = Field( None, description="""Description of what these vectors represent.""" ) @@ -446,9 +444,7 @@ class OpticalChannel(NWBContainer): name: str = Field(...) description: str = Field(..., description="""Description or other notes about the channel.""") - emission_lambda: np.float32 = Field( - ..., description="""Emission wavelength for channel, in nm.""" - ) + emission_lambda: float = Field(..., description="""Emission wavelength for channel, in nm.""") class MotionCorrection(NWBDataInterface): diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_retinotopy.py index 4c3f758..fe8df70 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_retinotopy.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_retinotopy.py @@ -127,17 +127,15 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -161,17 +159,15 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -195,17 +191,15 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -229,17 +223,15 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -263,24 +255,20 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): } }, ) - bits_per_pixel: Optional[np.int32] = Field( + bits_per_pixel: Optional[int] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""", ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) - focal_depth: Optional[np.float32] = Field( - None, description="""Focal depth offset, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") + focal_depth: Optional[float] = Field(None, description="""Focal depth offset, in meters.""") format: Optional[str] = Field( None, description="""Format of image. Right now only 'raw' is supported.""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -301,14 +289,12 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel): "linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"} }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -332,21 +318,19 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): } }, ) - bits_per_pixel: Optional[np.int32] = Field( + bits_per_pixel: Optional[int] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value""", ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") format: Optional[str] = Field( None, description="""Format of image. Right now only 'raw' is supported.""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_base.py index d6fc9fa..5d6e07d 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_base.py @@ -88,15 +88,15 @@ class Image(NWBData): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -148,12 +148,12 @@ class TimeSeries(NWBDataInterface): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -182,11 +182,11 @@ class TimeSeriesData(ConfiguredBaseModel): "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) - conversion: Optional[np.float32] = Field( + conversion: Optional[float] = Field( None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""", ) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""", ) @@ -221,11 +221,11 @@ class TimeSeriesStartingTime(ConfiguredBaseModel): "linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"} }, ) - rate: Optional[np.float32] = Field(None, description="""Sampling rate, in Hz.""") + rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""") unit: Optional[str] = Field( None, description="""Unit of measurement for time, which is fixed to 'seconds'.""" ) - value: np.float64 = Field(...) + value: float = Field(...) class TimeSeriesSync(ConfiguredBaseModel): diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_behavior.py index b764c15..94f5843 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_behavior.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_behavior.py @@ -93,12 +93,12 @@ class SpatialSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -133,8 +133,8 @@ class SpatialSeriesData(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_features"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_features"], float], ] ] = Field(None) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ecephys.py index 9cbedd2..c0b9368 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ecephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ecephys.py @@ -112,9 +112,9 @@ class ElectricalSeries(TimeSeries): description="""Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be \"High-pass 4-pole Bessel filter at 500 Hz\". If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be \"Low-pass filter at 300 Hz\". If a non-standard filter type is used, provide as much detail about the filter properties as possible.""", ) data: Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_channels"], np.number], - NDArray[Shape["* num_times, * num_channels, * num_samples"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_channels"], float], + NDArray[Shape["* num_times, * num_channels, * num_samples"], float], ] = Field(..., description="""Recorded voltage data.""") electrodes: Named[DynamicTableRegion] = Field( ..., @@ -123,7 +123,7 @@ class ElectricalSeries(TimeSeries): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( + channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field( None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}}, @@ -137,12 +137,12 @@ class ElectricalSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -171,10 +171,10 @@ class SpikeEventSeries(ElectricalSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_events, * num_samples"], np.number], - NDArray[Shape["* num_events, * num_channels, * num_samples"], np.number], + NDArray[Shape["* num_events, * num_samples"], float], + NDArray[Shape["* num_events, * num_channels, * num_samples"], float], ] = Field(..., description="""Spike waveforms.""") - timestamps: NDArray[Shape["* num_times"], np.float64] = Field( + timestamps: NDArray[Shape["* num_times"], float] = Field( ..., description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -190,7 +190,7 @@ class SpikeEventSeries(ElectricalSeries): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( + channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field( None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}}, @@ -204,7 +204,7 @@ class SpikeEventSeries(ElectricalSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -240,7 +240,7 @@ class FeatureExtraction(NWBDataInterface): description="""Description of features (eg, ''PC1'') for each of the extracted features.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_features"}]}}}, ) - features: NDArray[Shape["* num_events, * num_channels, * num_features"], np.float32] = Field( + features: NDArray[Shape["* num_events, * num_channels, * num_features"], float] = Field( ..., description="""Multi-dimensional array of features extracted from each event.""", json_schema_extra={ @@ -255,7 +255,7 @@ class FeatureExtraction(NWBDataInterface): } }, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Times of events that features correspond to (can be a link).""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, @@ -285,12 +285,12 @@ class EventDetection(NWBDataInterface): ..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""", ) - source_idx: NDArray[Shape["* num_events"], np.int32] = Field( + source_idx: NDArray[Shape["* num_events"], int] = Field( ..., description="""Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Timestamps of events, in seconds.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, @@ -375,9 +375,9 @@ class ElectrodeGroupPosition(ConfiguredBaseModel): "linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"} }, ) - x: Optional[np.float32] = Field(None, description="""x coordinate""") - y: Optional[np.float32] = Field(None, description="""y coordinate""") - z: Optional[np.float32] = Field(None, description="""z coordinate""") + x: Optional[float] = Field(None, description="""x coordinate""") + y: Optional[float] = Field(None, description="""y coordinate""") + z: Optional[float] = Field(None, description="""z coordinate""") class ClusterWaveforms(NWBDataInterface): @@ -396,7 +396,7 @@ class ClusterWaveforms(NWBDataInterface): waveform_filtering: str = Field( ..., description="""Filtering applied to data before generating mean/sd""" ) - waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( + waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], float] = Field( ..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""", json_schema_extra={ @@ -405,7 +405,7 @@ class ClusterWaveforms(NWBDataInterface): } }, ) - waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( + waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], float] = Field( ..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""", json_schema_extra={ @@ -432,17 +432,17 @@ class Clustering(NWBDataInterface): ..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""", ) - num: NDArray[Shape["* num_events"], np.int32] = Field( + num: NDArray[Shape["* num_events"], int] = Field( ..., description="""Cluster number of each event""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, ) - peak_over_rms: NDArray[Shape["* num_clusters"], np.float32] = Field( + peak_over_rms: NDArray[Shape["* num_clusters"], float] = Field( ..., description="""Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}]}}}, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_epoch.py index 6457839..1466993 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_epoch.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_epoch.py @@ -96,7 +96,7 @@ class TimeIntervals(DynamicTable): ) name: str = Field(...) - start_time: NDArray[Any, np.float32] = Field( + start_time: NDArray[Any, float] = Field( ..., description="""Start time of epoch, in seconds.""", json_schema_extra={ @@ -105,7 +105,7 @@ class TimeIntervals(DynamicTable): } }, ) - stop_time: NDArray[Any, np.float32] = Field( + stop_time: NDArray[Any, float] = Field( ..., description="""Stop time of epoch, in seconds.""", json_schema_extra={ @@ -170,11 +170,11 @@ class TimeIntervalsTimeseries(VectorData): "linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"} }, ) - idx_start: Optional[np.int32] = Field( + idx_start: Optional[int] = Field( None, description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) - count: Optional[np.int32] = Field( + count: Optional[int] = Field( None, description="""Number of data samples available in this time series, during this epoch.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_file.py index e4d19ca..cea7fa7 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_file.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_file.py @@ -118,7 +118,7 @@ class NWBFile(NWBContainer): None, description="""File version string. Use semantic versioning, e.g. 1.2.1. This will be the name of the format with trailing major, minor and patch numbers.""", ) - file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = Field( + file_create_date: NDArray[Shape["* num_modifications"], datetime] = Field( ..., description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""", json_schema_extra={ @@ -132,11 +132,11 @@ class NWBFile(NWBContainer): session_description: str = Field( ..., description="""A description of the experimental session and data in the file.""" ) - session_start_time: np.datetime64 = Field( + session_start_time: datetime = Field( ..., description="""Date and time of the experiment/session start. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds.""", ) - timestamps_reference_time: np.datetime64 = Field( + timestamps_reference_time: datetime = Field( ..., description="""Date and time corresponding to time zero of all timestamps. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. All times stored in the file use this time as reference (i.e., time zero).""", ) @@ -372,7 +372,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): "linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"} }, ) - x: NDArray[Any, np.float32] = Field( + x: NDArray[Any, float] = Field( ..., description="""x coordinate of the channel location in the brain (+x is posterior).""", json_schema_extra={ @@ -381,7 +381,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - y: NDArray[Any, np.float32] = Field( + y: NDArray[Any, float] = Field( ..., description="""y coordinate of the channel location in the brain (+y is inferior).""", json_schema_extra={ @@ -390,7 +390,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - z: NDArray[Any, np.float32] = Field( + z: NDArray[Any, float] = Field( ..., description="""z coordinate of the channel location in the brain (+z is right).""", json_schema_extra={ @@ -399,7 +399,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - imp: NDArray[Any, np.float32] = Field( + imp: NDArray[Any, float] = Field( ..., description="""Impedance of the channel, in ohms.""", json_schema_extra={ @@ -417,7 +417,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - filtering: NDArray[Any, np.float32] = Field( + filtering: NDArray[Any, float] = Field( ..., description="""Description of hardware filtering, including the filter name and frequency cutoffs.""", json_schema_extra={ @@ -438,7 +438,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_x: Optional[NDArray[Any, np.float32]] = Field( + rel_x: Optional[NDArray[Any, float]] = Field( None, description="""x coordinate in electrode group""", json_schema_extra={ @@ -447,7 +447,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_y: Optional[NDArray[Any, np.float32]] = Field( + rel_y: Optional[NDArray[Any, float]] = Field( None, description="""y coordinate in electrode group""", json_schema_extra={ @@ -456,7 +456,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_z: Optional[NDArray[Any, np.float32]] = Field( + rel_z: Optional[NDArray[Any, float]] = Field( None, description="""z coordinate in electrode group""", json_schema_extra={ @@ -544,7 +544,7 @@ class Subject(NWBContainer): age: Optional[str] = Field( None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""" ) - date_of_birth: Optional[np.datetime64] = Field( + date_of_birth: Optional[datetime] = Field( None, description="""Date of birth of subject. Can be supplied instead of 'age'.""" ) description: Optional[str] = Field( diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_icephys.py index 48af82c..db95e72 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_icephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_icephys.py @@ -109,11 +109,11 @@ class PatchClampSeries(TimeSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""") - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -126,12 +126,12 @@ class PatchClampSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -164,7 +164,7 @@ class PatchClampSeriesData(ConfiguredBaseModel): None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) - array: Optional[NDArray[Shape["* num_times"], np.number]] = Field( + array: Optional[NDArray[Shape["* num_times"], float]] = Field( None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}} ) @@ -180,18 +180,18 @@ class CurrentClampSeries(PatchClampSeries): name: str = Field(...) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") - bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""") - bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""") - capacitance_compensation: Optional[np.float32] = Field( + bias_current: Optional[float] = Field(None, description="""Bias current, in amps.""") + bridge_balance: Optional[float] = Field(None, description="""Bridge balance, in ohms.""") + capacitance_compensation: Optional[float] = Field( None, description="""Capacitance compensation, in farads.""" ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -204,12 +204,12 @@ class CurrentClampSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -259,18 +259,16 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""", ) - bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""") - bridge_balance: np.float32 = Field( - ..., description="""Bridge balance, in ohms, fixed to 0.0.""" - ) - capacitance_compensation: np.float32 = Field( + bias_current: float = Field(..., description="""Bias current, in amps, fixed to 0.0.""") + bridge_balance: float = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + capacitance_compensation: float = Field( ..., description="""Capacitance compensation, in farads, fixed to 0.0.""" ) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -283,12 +281,12 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -320,10 +318,10 @@ class CurrentClampStimulusSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -336,12 +334,12 @@ class CurrentClampStimulusSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -412,10 +410,10 @@ class VoltageClampSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -428,12 +426,12 @@ class VoltageClampSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -489,7 +487,7 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): @@ -512,7 +510,7 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): @@ -535,7 +533,7 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): @@ -558,7 +556,7 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): @@ -581,7 +579,7 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): @@ -604,7 +602,7 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): @@ -627,7 +625,7 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampStimulusSeries(PatchClampSeries): @@ -644,10 +642,10 @@ class VoltageClampStimulusSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -660,12 +658,12 @@ class VoltageClampStimulusSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -739,7 +737,7 @@ class SweepTable(DynamicTable): ) name: str = Field(...) - sweep_number: NDArray[Any, np.uint32] = Field( + sweep_number: NDArray[Any, int] = Field( ..., description="""Sweep number of the PatchClampSeries in that row.""", json_schema_extra={ diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_image.py index d54abe3..356fc99 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_image.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_image.py @@ -71,15 +71,15 @@ class GrayscaleImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -94,15 +94,15 @@ class RGBImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -117,15 +117,15 @@ class RGBAImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -142,11 +142,11 @@ class ImageSeries(TimeSeries): name: str = Field(...) data: Optional[ Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, * z"], float], ] ] = Field(None, description="""Binary data representing images across frames.""") - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -168,12 +168,12 @@ class ImageSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -204,7 +204,7 @@ class ImageSeriesExternalFile(ConfiguredBaseModel): "linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"} }, ) - starting_frame: Optional[np.int32] = Field( + starting_frame: Optional[int] = Field( None, description="""Each external image may contain one or more consecutive frames of the full ImageSeries. This attribute serves as an index to indicate which frames each file contains, to faciliate random access. The 'starting_frame' attribute, hence, contains a list of frame numbers within the full ImageSeries of the first frame of each file listed in the parent 'external_file' dataset. Zero-based indexing is used (hence, the first element will always be zero). For example, if the 'external_file' dataset has three paths to files and the first file has 5 frames, the second file has 10 frames, and the third file has 20 frames, then this attribute will have values [0, 5, 15]. If there is a single external file that holds all of the frames of the ImageSeries (and so there is a single element in the 'external_file' dataset), then this attribute should have value [0].""", ) @@ -225,11 +225,11 @@ class ImageMaskSeries(ImageSeries): name: str = Field(...) data: Optional[ Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, * z"], float], ] ] = Field(None, description="""Binary data representing images across frames.""") - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -251,12 +251,12 @@ class ImageMaskSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -284,24 +284,23 @@ class OpticalSeries(ImageSeries): ) name: str = Field(...) - distance: Optional[np.float32] = Field( + distance: Optional[float] = Field( None, description="""Distance from camera/monitor to target/eye.""" ) field_of_view: Optional[ Union[ - NDArray[Shape["2 width_height"], np.float32], - NDArray[Shape["3 width_height_depth"], np.float32], + NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height_depth"], float] ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], float], ] = Field(..., description="""Images presented to subject, either grayscale or RGB""") orientation: Optional[str] = Field( None, description="""Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -323,12 +322,12 @@ class OpticalSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -356,7 +355,7 @@ class IndexSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.int32] = Field( + data: NDArray[Shape["* num_times"], int] = Field( ..., description="""Index of the frame in the referenced ImageSeries.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -370,12 +369,12 @@ class IndexSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_misc.py index 45a4d8b..01fcbf8 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_misc.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_misc.py @@ -129,12 +129,12 @@ class AbstractFeatureSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -169,8 +169,8 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_features"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_features"], float], ] ] = Field(None) @@ -199,12 +199,12 @@ class AnnotationSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -232,7 +232,7 @@ class IntervalSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.int8] = Field( + data: NDArray[Shape["* num_times"], int] = Field( ..., description="""Use values >0 if interval started, <0 if interval ended.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -246,12 +246,12 @@ class IntervalSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -303,12 +303,12 @@ class DecompositionSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -341,7 +341,7 @@ class DecompositionSeriesData(ConfiguredBaseModel): None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) - array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], np.number]] = Field( + array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], float]] = Field( None, json_schema_extra={ "linkml_meta": { @@ -377,7 +377,7 @@ class DecompositionSeriesBands(DynamicTable): } }, ) - band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field( + band_limits: NDArray[Shape["* num_bands, 2 low_high"], float] = Field( ..., description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""", json_schema_extra={ @@ -391,12 +391,12 @@ class DecompositionSeriesBands(DynamicTable): } }, ) - band_mean: NDArray[Shape["* num_bands"], np.float32] = Field( + band_mean: NDArray[Shape["* num_bands"], float] = Field( ..., description="""The mean Gaussian filters, in Hz.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_bands"}]}}}, ) - band_stdev: NDArray[Shape["* num_bands"], np.float32] = Field( + band_stdev: NDArray[Shape["* num_bands"], float] = Field( ..., description="""The standard deviation of Gaussian filters, in Hz.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_bands"}]}}}, @@ -445,7 +445,7 @@ class Units(DynamicTable): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field( + obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], float]] = Field( None, description="""Observation intervals for each unit.""", json_schema_extra={ @@ -478,17 +478,17 @@ class Units(DynamicTable): ) waveform_mean: Optional[ Union[ - NDArray[Shape["* num_units, * num_samples"], np.float32], - NDArray[Shape["* num_units, * num_samples, * num_electrodes"], np.float32], + NDArray[Shape["* num_units, * num_samples"], float], + NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float], ] ] = Field(None, description="""Spike waveform mean for each spike unit.""") waveform_sd: Optional[ Union[ - NDArray[Shape["* num_units, * num_samples"], np.float32], - NDArray[Shape["* num_units, * num_samples, * num_electrodes"], np.float32], + NDArray[Shape["* num_units, * num_samples"], float], + NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float], ] ] = Field(None, description="""Spike waveform standard deviation for each spike unit.""") - waveforms: Optional[NDArray[Shape["* num_waveforms, * num_samples"], np.number]] = Field( + waveforms: Optional[NDArray[Shape["* num_waveforms, * num_samples"], float]] = Field( None, description="""Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same.""", json_schema_extra={ @@ -541,7 +541,7 @@ class UnitsSpikeTimes(VectorData): "linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"} }, ) - resolution: Optional[np.float64] = Field( + resolution: Optional[float] = Field( None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ogen.py index 71d202b..aa52534 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ogen.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ogen.py @@ -76,7 +76,7 @@ class OptogeneticSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.number] = Field( + data: NDArray[Shape["* num_times"], float] = Field( ..., description="""Applied power for optogenetic stimulus, in watts.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -90,12 +90,12 @@ class OptogeneticSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -124,7 +124,7 @@ class OptogeneticStimulusSite(NWBContainer): name: str = Field(...) description: str = Field(..., description="""Description of stimulation site.""") - excitation_lambda: np.float32 = Field(..., description="""Excitation wavelength, in nm.""") + excitation_lambda: float = Field(..., description="""Excitation wavelength, in nm.""") location: str = Field( ..., description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ophys.py index a08cfb2..7de8e48 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ophys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ophys.py @@ -114,24 +114,23 @@ class TwoPhotonSeries(ImageSeries): ) name: str = Field(...) - pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") - scan_line_rate: Optional[np.float32] = Field( + pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""") + scan_line_rate: Optional[float] = Field( None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) field_of_view: Optional[ Union[ - NDArray[Shape["2 width_height"], np.float32], - NDArray[Shape["3 width_height_depth"], np.float32], + NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height_depth"], float] ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Optional[ Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, * z"], float], ] ] = Field(None, description="""Binary data representing images across frames.""") - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -153,12 +152,12 @@ class TwoPhotonSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -187,8 +186,7 @@ class RoiResponseSeries(TimeSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_rois"], np.number], + NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times, * num_rois"], float] ] = Field(..., description="""Signals from ROIs.""") rois: Named[DynamicTableRegion] = Field( ..., @@ -206,12 +204,12 @@ class RoiResponseSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -371,9 +369,9 @@ class PlaneSegmentationPixelMask(VectorData): "linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"} }, ) - x: Optional[np.uint32] = Field(None, description="""Pixel x-coordinate.""") - y: Optional[np.uint32] = Field(None, description="""Pixel y-coordinate.""") - weight: Optional[np.float32] = Field(None, description="""Weight of the pixel.""") + x: Optional[int] = Field(None, description="""Pixel x-coordinate.""") + y: Optional[int] = Field(None, description="""Pixel y-coordinate.""") + weight: Optional[float] = Field(None, description="""Weight of the pixel.""") description: Optional[str] = Field( None, description="""Description of what these vectors represent.""" ) @@ -400,10 +398,10 @@ class PlaneSegmentationVoxelMask(VectorData): "linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"} }, ) - x: Optional[np.uint32] = Field(None, description="""Voxel x-coordinate.""") - y: Optional[np.uint32] = Field(None, description="""Voxel y-coordinate.""") - z: Optional[np.uint32] = Field(None, description="""Voxel z-coordinate.""") - weight: Optional[np.float32] = Field(None, description="""Weight of the voxel.""") + x: Optional[int] = Field(None, description="""Voxel x-coordinate.""") + y: Optional[int] = Field(None, description="""Voxel y-coordinate.""") + z: Optional[int] = Field(None, description="""Voxel z-coordinate.""") + weight: Optional[float] = Field(None, description="""Weight of the voxel.""") description: Optional[str] = Field( None, description="""Description of what these vectors represent.""" ) @@ -443,9 +441,7 @@ class OpticalChannel(NWBContainer): name: str = Field(...) description: str = Field(..., description="""Description or other notes about the channel.""") - emission_lambda: np.float32 = Field( - ..., description="""Emission wavelength for channel, in nm.""" - ) + emission_lambda: float = Field(..., description="""Emission wavelength for channel, in nm.""") class MotionCorrection(NWBDataInterface): diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_retinotopy.py index 6af3e96..2f9da18 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_retinotopy.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_retinotopy.py @@ -127,17 +127,15 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -161,17 +159,15 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -195,17 +191,15 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -229,17 +223,15 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -263,24 +255,20 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): } }, ) - bits_per_pixel: Optional[np.int32] = Field( + bits_per_pixel: Optional[int] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""", ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) - focal_depth: Optional[np.float32] = Field( - None, description="""Focal depth offset, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") + focal_depth: Optional[float] = Field(None, description="""Focal depth offset, in meters.""") format: Optional[str] = Field( None, description="""Format of image. Right now only 'raw' is supported.""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -301,14 +289,12 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel): "linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"} }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -332,21 +318,19 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): } }, ) - bits_per_pixel: Optional[np.int32] = Field( + bits_per_pixel: Optional[int] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value""", ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") format: Optional[str] = Field( None, description="""Format of image. Right now only 'raw' is supported.""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_base.py index fe433cd..1dac0d5 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_base.py @@ -90,11 +90,11 @@ class TimeSeriesReferenceVectorData(VectorData): name: str = Field( "timeseries", json_schema_extra={"linkml_meta": {"ifabsent": "string(timeseries)"}} ) - idx_start: np.int32 = Field( + idx_start: int = Field( ..., description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) - count: np.int32 = Field( + count: int = Field( ..., description="""Number of data samples available in this time series, during this epoch""", ) @@ -122,15 +122,15 @@ class Image(NWBData): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -182,12 +182,12 @@ class TimeSeries(NWBDataInterface): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -216,11 +216,11 @@ class TimeSeriesData(ConfiguredBaseModel): "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) - conversion: Optional[np.float32] = Field( + conversion: Optional[float] = Field( None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""", ) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""", ) @@ -255,11 +255,11 @@ class TimeSeriesStartingTime(ConfiguredBaseModel): "linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"} }, ) - rate: Optional[np.float32] = Field(None, description="""Sampling rate, in Hz.""") + rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""") unit: Optional[str] = Field( None, description="""Unit of measurement for time, which is fixed to 'seconds'.""" ) - value: np.float64 = Field(...) + value: float = Field(...) class TimeSeriesSync(ConfiguredBaseModel): diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_behavior.py index 8e859b8..6077059 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_behavior.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_behavior.py @@ -93,12 +93,12 @@ class SpatialSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -133,8 +133,8 @@ class SpatialSeriesData(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_features"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_features"], float], ] ] = Field(None) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ecephys.py index 1a25b07..978abba 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ecephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ecephys.py @@ -112,9 +112,9 @@ class ElectricalSeries(TimeSeries): description="""Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be \"High-pass 4-pole Bessel filter at 500 Hz\". If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be \"Low-pass filter at 300 Hz\". If a non-standard filter type is used, provide as much detail about the filter properties as possible.""", ) data: Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_channels"], np.number], - NDArray[Shape["* num_times, * num_channels, * num_samples"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_channels"], float], + NDArray[Shape["* num_times, * num_channels, * num_samples"], float], ] = Field(..., description="""Recorded voltage data.""") electrodes: Named[DynamicTableRegion] = Field( ..., @@ -123,7 +123,7 @@ class ElectricalSeries(TimeSeries): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( + channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field( None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}}, @@ -137,12 +137,12 @@ class ElectricalSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -171,10 +171,10 @@ class SpikeEventSeries(ElectricalSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_events, * num_samples"], np.number], - NDArray[Shape["* num_events, * num_channels, * num_samples"], np.number], + NDArray[Shape["* num_events, * num_samples"], float], + NDArray[Shape["* num_events, * num_channels, * num_samples"], float], ] = Field(..., description="""Spike waveforms.""") - timestamps: NDArray[Shape["* num_times"], np.float64] = Field( + timestamps: NDArray[Shape["* num_times"], float] = Field( ..., description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -190,7 +190,7 @@ class SpikeEventSeries(ElectricalSeries): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( + channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field( None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}}, @@ -204,7 +204,7 @@ class SpikeEventSeries(ElectricalSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -240,7 +240,7 @@ class FeatureExtraction(NWBDataInterface): description="""Description of features (eg, ''PC1'') for each of the extracted features.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_features"}]}}}, ) - features: NDArray[Shape["* num_events, * num_channels, * num_features"], np.float32] = Field( + features: NDArray[Shape["* num_events, * num_channels, * num_features"], float] = Field( ..., description="""Multi-dimensional array of features extracted from each event.""", json_schema_extra={ @@ -255,7 +255,7 @@ class FeatureExtraction(NWBDataInterface): } }, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Times of events that features correspond to (can be a link).""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, @@ -285,12 +285,12 @@ class EventDetection(NWBDataInterface): ..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""", ) - source_idx: NDArray[Shape["* num_events"], np.int32] = Field( + source_idx: NDArray[Shape["* num_events"], int] = Field( ..., description="""Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Timestamps of events, in seconds.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, @@ -375,9 +375,9 @@ class ElectrodeGroupPosition(ConfiguredBaseModel): "linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"} }, ) - x: Optional[np.float32] = Field(None, description="""x coordinate""") - y: Optional[np.float32] = Field(None, description="""y coordinate""") - z: Optional[np.float32] = Field(None, description="""z coordinate""") + x: Optional[float] = Field(None, description="""x coordinate""") + y: Optional[float] = Field(None, description="""y coordinate""") + z: Optional[float] = Field(None, description="""z coordinate""") class ClusterWaveforms(NWBDataInterface): @@ -396,7 +396,7 @@ class ClusterWaveforms(NWBDataInterface): waveform_filtering: str = Field( ..., description="""Filtering applied to data before generating mean/sd""" ) - waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( + waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], float] = Field( ..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""", json_schema_extra={ @@ -405,7 +405,7 @@ class ClusterWaveforms(NWBDataInterface): } }, ) - waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( + waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], float] = Field( ..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""", json_schema_extra={ @@ -432,17 +432,17 @@ class Clustering(NWBDataInterface): ..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""", ) - num: NDArray[Shape["* num_events"], np.int32] = Field( + num: NDArray[Shape["* num_events"], int] = Field( ..., description="""Cluster number of each event""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, ) - peak_over_rms: NDArray[Shape["* num_clusters"], np.float32] = Field( + peak_over_rms: NDArray[Shape["* num_clusters"], float] = Field( ..., description="""Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}]}}}, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_epoch.py index 99ba895..0cd6107 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_epoch.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_epoch.py @@ -96,7 +96,7 @@ class TimeIntervals(DynamicTable): ) name: str = Field(...) - start_time: NDArray[Any, np.float32] = Field( + start_time: NDArray[Any, float] = Field( ..., description="""Start time of epoch, in seconds.""", json_schema_extra={ @@ -105,7 +105,7 @@ class TimeIntervals(DynamicTable): } }, ) - stop_time: NDArray[Any, np.float32] = Field( + stop_time: NDArray[Any, float] = Field( ..., description="""Stop time of epoch, in seconds.""", json_schema_extra={ @@ -170,11 +170,11 @@ class TimeIntervalsTimeseries(VectorData): "linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"} }, ) - idx_start: Optional[np.int32] = Field( + idx_start: Optional[int] = Field( None, description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) - count: Optional[np.int32] = Field( + count: Optional[int] = Field( None, description="""Number of data samples available in this time series, during this epoch.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_file.py index c2c5d26..211707f 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_file.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_file.py @@ -126,7 +126,7 @@ class NWBFile(NWBContainer): None, description="""File version string. Use semantic versioning, e.g. 1.2.1. This will be the name of the format with trailing major, minor and patch numbers.""", ) - file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = Field( + file_create_date: NDArray[Shape["* num_modifications"], datetime] = Field( ..., description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""", json_schema_extra={ @@ -140,11 +140,11 @@ class NWBFile(NWBContainer): session_description: str = Field( ..., description="""A description of the experimental session and data in the file.""" ) - session_start_time: np.datetime64 = Field( + session_start_time: datetime = Field( ..., description="""Date and time of the experiment/session start. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds.""", ) - timestamps_reference_time: np.datetime64 = Field( + timestamps_reference_time: datetime = Field( ..., description="""Date and time corresponding to time zero of all timestamps. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. All times stored in the file use this time as reference (i.e., time zero).""", ) @@ -380,7 +380,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): "linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"} }, ) - x: NDArray[Any, np.float32] = Field( + x: NDArray[Any, float] = Field( ..., description="""x coordinate of the channel location in the brain (+x is posterior).""", json_schema_extra={ @@ -389,7 +389,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - y: NDArray[Any, np.float32] = Field( + y: NDArray[Any, float] = Field( ..., description="""y coordinate of the channel location in the brain (+y is inferior).""", json_schema_extra={ @@ -398,7 +398,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - z: NDArray[Any, np.float32] = Field( + z: NDArray[Any, float] = Field( ..., description="""z coordinate of the channel location in the brain (+z is right).""", json_schema_extra={ @@ -407,7 +407,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - imp: NDArray[Any, np.float32] = Field( + imp: NDArray[Any, float] = Field( ..., description="""Impedance of the channel, in ohms.""", json_schema_extra={ @@ -446,7 +446,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_x: Optional[NDArray[Any, np.float32]] = Field( + rel_x: Optional[NDArray[Any, float]] = Field( None, description="""x coordinate in electrode group""", json_schema_extra={ @@ -455,7 +455,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_y: Optional[NDArray[Any, np.float32]] = Field( + rel_y: Optional[NDArray[Any, float]] = Field( None, description="""y coordinate in electrode group""", json_schema_extra={ @@ -464,7 +464,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_z: Optional[NDArray[Any, np.float32]] = Field( + rel_z: Optional[NDArray[Any, float]] = Field( None, description="""z coordinate in electrode group""", json_schema_extra={ @@ -573,7 +573,7 @@ class Subject(NWBContainer): age: Optional[str] = Field( None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""" ) - date_of_birth: Optional[np.datetime64] = Field( + date_of_birth: Optional[datetime] = Field( None, description="""Date of birth of subject. Can be supplied instead of 'age'.""" ) description: Optional[str] = Field( diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_icephys.py index b84fea1..760097b 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_icephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_icephys.py @@ -116,11 +116,11 @@ class PatchClampSeries(TimeSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""") - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -133,12 +133,12 @@ class PatchClampSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -171,7 +171,7 @@ class PatchClampSeriesData(ConfiguredBaseModel): None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) - array: Optional[NDArray[Shape["* num_times"], np.number]] = Field( + array: Optional[NDArray[Shape["* num_times"], float]] = Field( None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}} ) @@ -187,18 +187,18 @@ class CurrentClampSeries(PatchClampSeries): name: str = Field(...) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") - bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""") - bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""") - capacitance_compensation: Optional[np.float32] = Field( + bias_current: Optional[float] = Field(None, description="""Bias current, in amps.""") + bridge_balance: Optional[float] = Field(None, description="""Bridge balance, in ohms.""") + capacitance_compensation: Optional[float] = Field( None, description="""Capacitance compensation, in farads.""" ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -211,12 +211,12 @@ class CurrentClampSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -266,18 +266,16 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""", ) - bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""") - bridge_balance: np.float32 = Field( - ..., description="""Bridge balance, in ohms, fixed to 0.0.""" - ) - capacitance_compensation: np.float32 = Field( + bias_current: float = Field(..., description="""Bias current, in amps, fixed to 0.0.""") + bridge_balance: float = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + capacitance_compensation: float = Field( ..., description="""Capacitance compensation, in farads, fixed to 0.0.""" ) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -290,12 +288,12 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -327,10 +325,10 @@ class CurrentClampStimulusSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -343,12 +341,12 @@ class CurrentClampStimulusSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -419,10 +417,10 @@ class VoltageClampSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -435,12 +433,12 @@ class VoltageClampSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -496,7 +494,7 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): @@ -519,7 +517,7 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): @@ -542,7 +540,7 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): @@ -565,7 +563,7 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): @@ -588,7 +586,7 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): @@ -611,7 +609,7 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): @@ -634,7 +632,7 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampStimulusSeries(PatchClampSeries): @@ -651,10 +649,10 @@ class VoltageClampStimulusSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -667,12 +665,12 @@ class VoltageClampStimulusSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -746,7 +744,7 @@ class SweepTable(DynamicTable): ) name: str = Field(...) - sweep_number: NDArray[Any, np.uint32] = Field( + sweep_number: NDArray[Any, int] = Field( ..., description="""Sweep number of the PatchClampSeries in that row.""", json_schema_extra={ diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_image.py index 1209210..e940464 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_image.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_image.py @@ -71,15 +71,15 @@ class GrayscaleImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -94,15 +94,15 @@ class RGBImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -117,15 +117,15 @@ class RGBAImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -141,13 +141,12 @@ class ImageSeries(TimeSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], NDArray[Shape["* frame, * x, * y, * z"], float] ] = Field( ..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -169,12 +168,12 @@ class ImageSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -205,7 +204,7 @@ class ImageSeriesExternalFile(ConfiguredBaseModel): "linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"} }, ) - starting_frame: Optional[np.int32] = Field( + starting_frame: Optional[int] = Field( None, description="""Each external image may contain one or more consecutive frames of the full ImageSeries. This attribute serves as an index to indicate which frames each file contains, to faciliate random access. The 'starting_frame' attribute, hence, contains a list of frame numbers within the full ImageSeries of the first frame of each file listed in the parent 'external_file' dataset. Zero-based indexing is used (hence, the first element will always be zero). For example, if the 'external_file' dataset has three paths to files and the first file has 5 frames, the second file has 10 frames, and the third file has 20 frames, then this attribute will have values [0, 5, 15]. If there is a single external file that holds all of the frames of the ImageSeries (and so there is a single element in the 'external_file' dataset), then this attribute should have value [0].""", ) @@ -225,13 +224,12 @@ class ImageMaskSeries(ImageSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], NDArray[Shape["* frame, * x, * y, * z"], float] ] = Field( ..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -253,12 +251,12 @@ class ImageMaskSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -286,24 +284,23 @@ class OpticalSeries(ImageSeries): ) name: str = Field(...) - distance: Optional[np.float32] = Field( + distance: Optional[float] = Field( None, description="""Distance from camera/monitor to target/eye.""" ) field_of_view: Optional[ Union[ - NDArray[Shape["2 width_height"], np.float32], - NDArray[Shape["3 width_height_depth"], np.float32], + NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height_depth"], float] ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], float], ] = Field(..., description="""Images presented to subject, either grayscale or RGB""") orientation: Optional[str] = Field( None, description="""Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -325,12 +322,12 @@ class OpticalSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -358,7 +355,7 @@ class IndexSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.int32] = Field( + data: NDArray[Shape["* num_times"], int] = Field( ..., description="""Index of the frame in the referenced ImageSeries.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -372,12 +369,12 @@ class IndexSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_misc.py index 941eed4..540d30f 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_misc.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_misc.py @@ -129,12 +129,12 @@ class AbstractFeatureSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -169,8 +169,8 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_features"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_features"], float], ] ] = Field(None) @@ -199,12 +199,12 @@ class AnnotationSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -232,7 +232,7 @@ class IntervalSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.int8] = Field( + data: NDArray[Shape["* num_times"], int] = Field( ..., description="""Use values >0 if interval started, <0 if interval ended.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -246,12 +246,12 @@ class IntervalSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -303,12 +303,12 @@ class DecompositionSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -341,7 +341,7 @@ class DecompositionSeriesData(ConfiguredBaseModel): None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) - array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], np.number]] = Field( + array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], float]] = Field( None, json_schema_extra={ "linkml_meta": { @@ -377,7 +377,7 @@ class DecompositionSeriesBands(DynamicTable): } }, ) - band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field( + band_limits: NDArray[Shape["* num_bands, 2 low_high"], float] = Field( ..., description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""", json_schema_extra={ @@ -391,12 +391,12 @@ class DecompositionSeriesBands(DynamicTable): } }, ) - band_mean: NDArray[Shape["* num_bands"], np.float32] = Field( + band_mean: NDArray[Shape["* num_bands"], float] = Field( ..., description="""The mean Gaussian filters, in Hz.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_bands"}]}}}, ) - band_stdev: NDArray[Shape["* num_bands"], np.float32] = Field( + band_stdev: NDArray[Shape["* num_bands"], float] = Field( ..., description="""The standard deviation of Gaussian filters, in Hz.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_bands"}]}}}, @@ -445,7 +445,7 @@ class Units(DynamicTable): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field( + obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], float]] = Field( None, description="""Observation intervals for each unit.""", json_schema_extra={ @@ -478,17 +478,17 @@ class Units(DynamicTable): ) waveform_mean: Optional[ Union[ - NDArray[Shape["* num_units, * num_samples"], np.float32], - NDArray[Shape["* num_units, * num_samples, * num_electrodes"], np.float32], + NDArray[Shape["* num_units, * num_samples"], float], + NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float], ] ] = Field(None, description="""Spike waveform mean for each spike unit.""") waveform_sd: Optional[ Union[ - NDArray[Shape["* num_units, * num_samples"], np.float32], - NDArray[Shape["* num_units, * num_samples, * num_electrodes"], np.float32], + NDArray[Shape["* num_units, * num_samples"], float], + NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float], ] ] = Field(None, description="""Spike waveform standard deviation for each spike unit.""") - waveforms: Optional[NDArray[Shape["* num_waveforms, * num_samples"], np.number]] = Field( + waveforms: Optional[NDArray[Shape["* num_waveforms, * num_samples"], float]] = Field( None, description="""Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same.""", json_schema_extra={ @@ -541,7 +541,7 @@ class UnitsSpikeTimes(VectorData): "linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"} }, ) - resolution: Optional[np.float64] = Field( + resolution: Optional[float] = Field( None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ogen.py index 2b145ce..8c72013 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ogen.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ogen.py @@ -76,7 +76,7 @@ class OptogeneticSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.number] = Field( + data: NDArray[Shape["* num_times"], float] = Field( ..., description="""Applied power for optogenetic stimulus, in watts.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -90,12 +90,12 @@ class OptogeneticSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -124,7 +124,7 @@ class OptogeneticStimulusSite(NWBContainer): name: str = Field(...) description: str = Field(..., description="""Description of stimulation site.""") - excitation_lambda: np.float32 = Field(..., description="""Excitation wavelength, in nm.""") + excitation_lambda: float = Field(..., description="""Excitation wavelength, in nm.""") location: str = Field( ..., description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ophys.py index 62d96b8..24dd9a9 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ophys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ophys.py @@ -114,25 +114,23 @@ class TwoPhotonSeries(ImageSeries): ) name: str = Field(...) - pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") - scan_line_rate: Optional[np.float32] = Field( + pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""") + scan_line_rate: Optional[float] = Field( None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) field_of_view: Optional[ Union[ - NDArray[Shape["2 width_height"], np.float32], - NDArray[Shape["3 width_height_depth"], np.float32], + NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height_depth"], float] ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], NDArray[Shape["* frame, * x, * y, * z"], float] ] = Field( ..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -154,12 +152,12 @@ class TwoPhotonSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -188,8 +186,7 @@ class RoiResponseSeries(TimeSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_rois"], np.number], + NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times, * num_rois"], float] ] = Field(..., description="""Signals from ROIs.""") rois: Named[DynamicTableRegion] = Field( ..., @@ -207,12 +204,12 @@ class RoiResponseSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -372,9 +369,9 @@ class PlaneSegmentationPixelMask(VectorData): "linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"} }, ) - x: Optional[np.uint32] = Field(None, description="""Pixel x-coordinate.""") - y: Optional[np.uint32] = Field(None, description="""Pixel y-coordinate.""") - weight: Optional[np.float32] = Field(None, description="""Weight of the pixel.""") + x: Optional[int] = Field(None, description="""Pixel x-coordinate.""") + y: Optional[int] = Field(None, description="""Pixel y-coordinate.""") + weight: Optional[float] = Field(None, description="""Weight of the pixel.""") description: Optional[str] = Field( None, description="""Description of what these vectors represent.""" ) @@ -401,10 +398,10 @@ class PlaneSegmentationVoxelMask(VectorData): "linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"} }, ) - x: Optional[np.uint32] = Field(None, description="""Voxel x-coordinate.""") - y: Optional[np.uint32] = Field(None, description="""Voxel y-coordinate.""") - z: Optional[np.uint32] = Field(None, description="""Voxel z-coordinate.""") - weight: Optional[np.float32] = Field(None, description="""Weight of the voxel.""") + x: Optional[int] = Field(None, description="""Voxel x-coordinate.""") + y: Optional[int] = Field(None, description="""Voxel y-coordinate.""") + z: Optional[int] = Field(None, description="""Voxel z-coordinate.""") + weight: Optional[float] = Field(None, description="""Weight of the voxel.""") description: Optional[str] = Field( None, description="""Description of what these vectors represent.""" ) @@ -444,9 +441,7 @@ class OpticalChannel(NWBContainer): name: str = Field(...) description: str = Field(..., description="""Description or other notes about the channel.""") - emission_lambda: np.float32 = Field( - ..., description="""Emission wavelength for channel, in nm.""" - ) + emission_lambda: float = Field(..., description="""Emission wavelength for channel, in nm.""") class MotionCorrection(NWBDataInterface): diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_retinotopy.py index aaad019..501665e 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_retinotopy.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_retinotopy.py @@ -127,17 +127,15 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -161,17 +159,15 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -195,17 +191,15 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -229,17 +223,15 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -263,24 +255,20 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): } }, ) - bits_per_pixel: Optional[np.int32] = Field( + bits_per_pixel: Optional[int] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""", ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) - focal_depth: Optional[np.float32] = Field( - None, description="""Focal depth offset, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") + focal_depth: Optional[float] = Field(None, description="""Focal depth offset, in meters.""") format: Optional[str] = Field( None, description="""Format of image. Right now only 'raw' is supported.""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -301,14 +289,12 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel): "linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"} }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -332,21 +318,19 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): } }, ) - bits_per_pixel: Optional[np.int32] = Field( + bits_per_pixel: Optional[int] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value""", ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") format: Optional[str] = Field( None, description="""Format of image. Right now only 'raw' is supported.""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_base.py index a686488..96da748 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_base.py @@ -114,11 +114,11 @@ class TimeSeriesReferenceVectorData(VectorData): name: str = Field( "timeseries", json_schema_extra={"linkml_meta": {"ifabsent": "string(timeseries)"}} ) - idx_start: np.int32 = Field( + idx_start: int = Field( ..., description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) - count: np.int32 = Field( + count: int = Field( ..., description="""Number of data samples available in this time series, during this epoch""", ) @@ -146,15 +146,15 @@ class Image(NWBData): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -221,12 +221,12 @@ class TimeSeries(NWBDataInterface): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -255,15 +255,15 @@ class TimeSeriesData(ConfiguredBaseModel): "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) - conversion: Optional[np.float32] = Field( + conversion: Optional[float] = Field( None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""", ) - offset: Optional[np.float32] = Field( + offset: Optional[float] = Field( None, description="""Scalar to add to the data after scaling by 'conversion' to finalize its coercion to the specified 'unit'. Two common examples of this include (a) data stored in an unsigned type that requires a shift after scaling to re-center the data, and (b) specialized recording devices that naturally cause a scalar offset with respect to the true units.""", ) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""", ) @@ -298,11 +298,11 @@ class TimeSeriesStartingTime(ConfiguredBaseModel): "linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"} }, ) - rate: Optional[np.float32] = Field(None, description="""Sampling rate, in Hz.""") + rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""") unit: Optional[str] = Field( None, description="""Unit of measurement for time, which is fixed to 'seconds'.""" ) - value: np.float64 = Field(...) + value: float = Field(...) class TimeSeriesSync(ConfiguredBaseModel): diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_behavior.py index 4c8757c..246b481 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_behavior.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_behavior.py @@ -93,12 +93,12 @@ class SpatialSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -133,10 +133,10 @@ class SpatialSeriesData(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, 1 x"], np.number], - NDArray[Shape["* num_times, 2 x_y"], np.number], - NDArray[Shape["* num_times, 3 x_y_z"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, 1 x"], float], + NDArray[Shape["* num_times, 2 x_y"], float], + NDArray[Shape["* num_times, 3 x_y_z"], float], ] ] = Field(None) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ecephys.py index f5f24cd..671682b 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ecephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ecephys.py @@ -112,9 +112,9 @@ class ElectricalSeries(TimeSeries): description="""Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be \"High-pass 4-pole Bessel filter at 500 Hz\". If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be \"Low-pass filter at 300 Hz\". If a non-standard filter type is used, provide as much detail about the filter properties as possible.""", ) data: Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_channels"], np.number], - NDArray[Shape["* num_times, * num_channels, * num_samples"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_channels"], float], + NDArray[Shape["* num_times, * num_channels, * num_samples"], float], ] = Field(..., description="""Recorded voltage data.""") electrodes: Named[DynamicTableRegion] = Field( ..., @@ -123,7 +123,7 @@ class ElectricalSeries(TimeSeries): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( + channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field( None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}}, @@ -137,12 +137,12 @@ class ElectricalSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -171,10 +171,10 @@ class SpikeEventSeries(ElectricalSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_events, * num_samples"], np.number], - NDArray[Shape["* num_events, * num_channels, * num_samples"], np.number], + NDArray[Shape["* num_events, * num_samples"], float], + NDArray[Shape["* num_events, * num_channels, * num_samples"], float], ] = Field(..., description="""Spike waveforms.""") - timestamps: NDArray[Shape["* num_times"], np.float64] = Field( + timestamps: NDArray[Shape["* num_times"], float] = Field( ..., description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -190,7 +190,7 @@ class SpikeEventSeries(ElectricalSeries): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( + channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field( None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}}, @@ -204,7 +204,7 @@ class SpikeEventSeries(ElectricalSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -240,7 +240,7 @@ class FeatureExtraction(NWBDataInterface): description="""Description of features (eg, ''PC1'') for each of the extracted features.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_features"}]}}}, ) - features: NDArray[Shape["* num_events, * num_channels, * num_features"], np.float32] = Field( + features: NDArray[Shape["* num_events, * num_channels, * num_features"], float] = Field( ..., description="""Multi-dimensional array of features extracted from each event.""", json_schema_extra={ @@ -255,7 +255,7 @@ class FeatureExtraction(NWBDataInterface): } }, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Times of events that features correspond to (can be a link).""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, @@ -285,12 +285,12 @@ class EventDetection(NWBDataInterface): ..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""", ) - source_idx: NDArray[Shape["* num_events"], np.int32] = Field( + source_idx: NDArray[Shape["* num_events"], int] = Field( ..., description="""Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Timestamps of events, in seconds.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, @@ -375,9 +375,9 @@ class ElectrodeGroupPosition(ConfiguredBaseModel): "linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"} }, ) - x: Optional[np.float32] = Field(None, description="""x coordinate""") - y: Optional[np.float32] = Field(None, description="""y coordinate""") - z: Optional[np.float32] = Field(None, description="""z coordinate""") + x: Optional[float] = Field(None, description="""x coordinate""") + y: Optional[float] = Field(None, description="""y coordinate""") + z: Optional[float] = Field(None, description="""z coordinate""") class ClusterWaveforms(NWBDataInterface): @@ -396,7 +396,7 @@ class ClusterWaveforms(NWBDataInterface): waveform_filtering: str = Field( ..., description="""Filtering applied to data before generating mean/sd""" ) - waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( + waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], float] = Field( ..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""", json_schema_extra={ @@ -405,7 +405,7 @@ class ClusterWaveforms(NWBDataInterface): } }, ) - waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( + waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], float] = Field( ..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""", json_schema_extra={ @@ -432,17 +432,17 @@ class Clustering(NWBDataInterface): ..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""", ) - num: NDArray[Shape["* num_events"], np.int32] = Field( + num: NDArray[Shape["* num_events"], int] = Field( ..., description="""Cluster number of each event""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, ) - peak_over_rms: NDArray[Shape["* num_clusters"], np.float32] = Field( + peak_over_rms: NDArray[Shape["* num_clusters"], float] = Field( ..., description="""Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}]}}}, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_epoch.py index e55c2ea..e728288 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_epoch.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_epoch.py @@ -96,7 +96,7 @@ class TimeIntervals(DynamicTable): ) name: str = Field(...) - start_time: NDArray[Any, np.float32] = Field( + start_time: NDArray[Any, float] = Field( ..., description="""Start time of epoch, in seconds.""", json_schema_extra={ @@ -105,7 +105,7 @@ class TimeIntervals(DynamicTable): } }, ) - stop_time: NDArray[Any, np.float32] = Field( + stop_time: NDArray[Any, float] = Field( ..., description="""Stop time of epoch, in seconds.""", json_schema_extra={ diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_file.py index fb4442a..f71c621 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_file.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_file.py @@ -127,7 +127,7 @@ class NWBFile(NWBContainer): None, description="""File version string. Use semantic versioning, e.g. 1.2.1. This will be the name of the format with trailing major, minor and patch numbers.""", ) - file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = Field( + file_create_date: NDArray[Shape["* num_modifications"], datetime] = Field( ..., description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""", json_schema_extra={ @@ -141,11 +141,11 @@ class NWBFile(NWBContainer): session_description: str = Field( ..., description="""A description of the experimental session and data in the file.""" ) - session_start_time: np.datetime64 = Field( + session_start_time: datetime = Field( ..., description="""Date and time of the experiment/session start. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds.""", ) - timestamps_reference_time: np.datetime64 = Field( + timestamps_reference_time: datetime = Field( ..., description="""Date and time corresponding to time zero of all timestamps. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. All times stored in the file use this time as reference (i.e., time zero).""", ) @@ -383,7 +383,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): "linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"} }, ) - x: Optional[NDArray[Any, np.float32]] = Field( + x: Optional[NDArray[Any, float]] = Field( None, description="""x coordinate of the channel location in the brain (+x is posterior).""", json_schema_extra={ @@ -392,7 +392,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - y: Optional[NDArray[Any, np.float32]] = Field( + y: Optional[NDArray[Any, float]] = Field( None, description="""y coordinate of the channel location in the brain (+y is inferior).""", json_schema_extra={ @@ -401,7 +401,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - z: Optional[NDArray[Any, np.float32]] = Field( + z: Optional[NDArray[Any, float]] = Field( None, description="""z coordinate of the channel location in the brain (+z is right).""", json_schema_extra={ @@ -410,7 +410,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - imp: Optional[NDArray[Any, np.float32]] = Field( + imp: Optional[NDArray[Any, float]] = Field( None, description="""Impedance of the channel, in ohms.""", json_schema_extra={ @@ -449,7 +449,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_x: Optional[NDArray[Any, np.float32]] = Field( + rel_x: Optional[NDArray[Any, float]] = Field( None, description="""x coordinate in electrode group""", json_schema_extra={ @@ -458,7 +458,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_y: Optional[NDArray[Any, np.float32]] = Field( + rel_y: Optional[NDArray[Any, float]] = Field( None, description="""y coordinate in electrode group""", json_schema_extra={ @@ -467,7 +467,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_z: Optional[NDArray[Any, np.float32]] = Field( + rel_z: Optional[NDArray[Any, float]] = Field( None, description="""z coordinate in electrode group""", json_schema_extra={ @@ -576,7 +576,7 @@ class Subject(NWBContainer): age: Optional[str] = Field( None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""" ) - date_of_birth: Optional[np.datetime64] = Field( + date_of_birth: Optional[datetime] = Field( None, description="""Date of birth of subject. Can be supplied instead of 'age'.""" ) description: Optional[str] = Field( diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_icephys.py index 6dfee22..1b741f1 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_icephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_icephys.py @@ -116,11 +116,11 @@ class PatchClampSeries(TimeSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""") - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -133,12 +133,12 @@ class PatchClampSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -171,7 +171,7 @@ class PatchClampSeriesData(ConfiguredBaseModel): None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""", ) - array: Optional[NDArray[Shape["* num_times"], np.number]] = Field( + array: Optional[NDArray[Shape["* num_times"], float]] = Field( None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}} ) @@ -187,18 +187,18 @@ class CurrentClampSeries(PatchClampSeries): name: str = Field(...) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") - bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""") - bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""") - capacitance_compensation: Optional[np.float32] = Field( + bias_current: Optional[float] = Field(None, description="""Bias current, in amps.""") + bridge_balance: Optional[float] = Field(None, description="""Bridge balance, in ohms.""") + capacitance_compensation: Optional[float] = Field( None, description="""Capacitance compensation, in farads.""" ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -211,12 +211,12 @@ class CurrentClampSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -266,18 +266,16 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""", ) - bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""") - bridge_balance: np.float32 = Field( - ..., description="""Bridge balance, in ohms, fixed to 0.0.""" - ) - capacitance_compensation: np.float32 = Field( + bias_current: float = Field(..., description="""Bias current, in amps, fixed to 0.0.""") + bridge_balance: float = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + capacitance_compensation: float = Field( ..., description="""Capacitance compensation, in farads, fixed to 0.0.""" ) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -290,12 +288,12 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -327,10 +325,10 @@ class CurrentClampStimulusSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -343,12 +341,12 @@ class CurrentClampStimulusSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -419,10 +417,10 @@ class VoltageClampSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -435,12 +433,12 @@ class VoltageClampSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -496,7 +494,7 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): @@ -519,7 +517,7 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): @@ -542,7 +540,7 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): @@ -565,7 +563,7 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): @@ -588,7 +586,7 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): @@ -611,7 +609,7 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): @@ -634,7 +632,7 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampStimulusSeries(PatchClampSeries): @@ -651,10 +649,10 @@ class VoltageClampStimulusSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -667,12 +665,12 @@ class VoltageClampStimulusSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -747,7 +745,7 @@ class SweepTable(DynamicTable): ) name: str = Field(...) - sweep_number: NDArray[Any, np.uint32] = Field( + sweep_number: NDArray[Any, int] = Field( ..., description="""Sweep number of the PatchClampSeries in that row.""", json_schema_extra={ diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_image.py index 52ffddb..209487e 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_image.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_image.py @@ -71,15 +71,15 @@ class GrayscaleImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -94,15 +94,15 @@ class RGBImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -117,15 +117,15 @@ class RGBAImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -141,13 +141,12 @@ class ImageSeries(TimeSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], NDArray[Shape["* frame, * x, * y, * z"], float] ] = Field( ..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -169,12 +168,12 @@ class ImageSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -205,7 +204,7 @@ class ImageSeriesExternalFile(ConfiguredBaseModel): "linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"} }, ) - starting_frame: Optional[np.int32] = Field( + starting_frame: Optional[int] = Field( None, description="""Each external image may contain one or more consecutive frames of the full ImageSeries. This attribute serves as an index to indicate which frames each file contains, to faciliate random access. The 'starting_frame' attribute, hence, contains a list of frame numbers within the full ImageSeries of the first frame of each file listed in the parent 'external_file' dataset. Zero-based indexing is used (hence, the first element will always be zero). For example, if the 'external_file' dataset has three paths to files and the first file has 5 frames, the second file has 10 frames, and the third file has 20 frames, then this attribute will have values [0, 5, 15]. If there is a single external file that holds all of the frames of the ImageSeries (and so there is a single element in the 'external_file' dataset), then this attribute should have value [0].""", ) @@ -225,13 +224,12 @@ class ImageMaskSeries(ImageSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], NDArray[Shape["* frame, * x, * y, * z"], float] ] = Field( ..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -253,12 +251,12 @@ class ImageMaskSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -286,24 +284,23 @@ class OpticalSeries(ImageSeries): ) name: str = Field(...) - distance: Optional[np.float32] = Field( + distance: Optional[float] = Field( None, description="""Distance from camera/monitor to target/eye.""" ) field_of_view: Optional[ Union[ - NDArray[Shape["2 width_height"], np.float32], - NDArray[Shape["3 width_height_depth"], np.float32], + NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height_depth"], float] ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], float], ] = Field(..., description="""Images presented to subject, either grayscale or RGB""") orientation: Optional[str] = Field( None, description="""Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -325,12 +322,12 @@ class OpticalSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -358,7 +355,7 @@ class IndexSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.uint32] = Field( + data: NDArray[Shape["* num_times"], int] = Field( ..., description="""Index of the image (using zero-indexing) in the linked Images object.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -372,12 +369,12 @@ class IndexSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_misc.py index 3d0cd3b..11d9e44 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_misc.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_misc.py @@ -129,12 +129,12 @@ class AbstractFeatureSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -169,8 +169,8 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_features"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_features"], float], ] ] = Field(None) @@ -199,12 +199,12 @@ class AnnotationSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -232,7 +232,7 @@ class IntervalSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.int8] = Field( + data: NDArray[Shape["* num_times"], int] = Field( ..., description="""Use values >0 if interval started, <0 if interval ended.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -246,12 +246,12 @@ class IntervalSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -303,12 +303,12 @@ class DecompositionSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -341,7 +341,7 @@ class DecompositionSeriesData(ConfiguredBaseModel): None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) - array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], np.number]] = Field( + array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], float]] = Field( None, json_schema_extra={ "linkml_meta": { @@ -377,7 +377,7 @@ class DecompositionSeriesBands(DynamicTable): } }, ) - band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field( + band_limits: NDArray[Shape["* num_bands, 2 low_high"], float] = Field( ..., description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""", json_schema_extra={ @@ -391,12 +391,12 @@ class DecompositionSeriesBands(DynamicTable): } }, ) - band_mean: NDArray[Shape["* num_bands"], np.float32] = Field( + band_mean: NDArray[Shape["* num_bands"], float] = Field( ..., description="""The mean Gaussian filters, in Hz.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_bands"}]}}}, ) - band_stdev: NDArray[Shape["* num_bands"], np.float32] = Field( + band_stdev: NDArray[Shape["* num_bands"], float] = Field( ..., description="""The standard deviation of Gaussian filters, in Hz.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_bands"}]}}}, @@ -445,7 +445,7 @@ class Units(DynamicTable): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field( + obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], float]] = Field( None, description="""Observation intervals for each unit.""", json_schema_extra={ @@ -478,17 +478,17 @@ class Units(DynamicTable): ) waveform_mean: Optional[ Union[ - NDArray[Shape["* num_units, * num_samples"], np.float32], - NDArray[Shape["* num_units, * num_samples, * num_electrodes"], np.float32], + NDArray[Shape["* num_units, * num_samples"], float], + NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float], ] ] = Field(None, description="""Spike waveform mean for each spike unit.""") waveform_sd: Optional[ Union[ - NDArray[Shape["* num_units, * num_samples"], np.float32], - NDArray[Shape["* num_units, * num_samples, * num_electrodes"], np.float32], + NDArray[Shape["* num_units, * num_samples"], float], + NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float], ] ] = Field(None, description="""Spike waveform standard deviation for each spike unit.""") - waveforms: Optional[NDArray[Shape["* num_waveforms, * num_samples"], np.number]] = Field( + waveforms: Optional[NDArray[Shape["* num_waveforms, * num_samples"], float]] = Field( None, description="""Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same.""", json_schema_extra={ @@ -541,7 +541,7 @@ class UnitsSpikeTimes(VectorData): "linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"} }, ) - resolution: Optional[np.float64] = Field( + resolution: Optional[float] = Field( None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ogen.py index 618462b..88958c0 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ogen.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ogen.py @@ -76,7 +76,7 @@ class OptogeneticSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.number] = Field( + data: NDArray[Shape["* num_times"], float] = Field( ..., description="""Applied power for optogenetic stimulus, in watts.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -90,12 +90,12 @@ class OptogeneticSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -124,7 +124,7 @@ class OptogeneticStimulusSite(NWBContainer): name: str = Field(...) description: str = Field(..., description="""Description of stimulation site.""") - excitation_lambda: np.float32 = Field(..., description="""Excitation wavelength, in nm.""") + excitation_lambda: float = Field(..., description="""Excitation wavelength, in nm.""") location: str = Field( ..., description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ophys.py index 518c841..41b48f1 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ophys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ophys.py @@ -114,25 +114,23 @@ class TwoPhotonSeries(ImageSeries): ) name: str = Field(...) - pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") - scan_line_rate: Optional[np.float32] = Field( + pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""") + scan_line_rate: Optional[float] = Field( None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) field_of_view: Optional[ Union[ - NDArray[Shape["2 width_height"], np.float32], - NDArray[Shape["3 width_height_depth"], np.float32], + NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height_depth"], float] ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], NDArray[Shape["* frame, * x, * y, * z"], float] ] = Field( ..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -154,12 +152,12 @@ class TwoPhotonSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -188,8 +186,7 @@ class RoiResponseSeries(TimeSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_rois"], np.number], + NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times, * num_rois"], float] ] = Field(..., description="""Signals from ROIs.""") rois: Named[DynamicTableRegion] = Field( ..., @@ -207,12 +204,12 @@ class RoiResponseSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -372,9 +369,9 @@ class PlaneSegmentationPixelMask(VectorData): "linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"} }, ) - x: Optional[np.uint32] = Field(None, description="""Pixel x-coordinate.""") - y: Optional[np.uint32] = Field(None, description="""Pixel y-coordinate.""") - weight: Optional[np.float32] = Field(None, description="""Weight of the pixel.""") + x: Optional[int] = Field(None, description="""Pixel x-coordinate.""") + y: Optional[int] = Field(None, description="""Pixel y-coordinate.""") + weight: Optional[float] = Field(None, description="""Weight of the pixel.""") description: Optional[str] = Field( None, description="""Description of what these vectors represent.""" ) @@ -401,10 +398,10 @@ class PlaneSegmentationVoxelMask(VectorData): "linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"} }, ) - x: Optional[np.uint32] = Field(None, description="""Voxel x-coordinate.""") - y: Optional[np.uint32] = Field(None, description="""Voxel y-coordinate.""") - z: Optional[np.uint32] = Field(None, description="""Voxel z-coordinate.""") - weight: Optional[np.float32] = Field(None, description="""Weight of the voxel.""") + x: Optional[int] = Field(None, description="""Voxel x-coordinate.""") + y: Optional[int] = Field(None, description="""Voxel y-coordinate.""") + z: Optional[int] = Field(None, description="""Voxel z-coordinate.""") + weight: Optional[float] = Field(None, description="""Weight of the voxel.""") description: Optional[str] = Field( None, description="""Description of what these vectors represent.""" ) @@ -444,9 +441,7 @@ class OpticalChannel(NWBContainer): name: str = Field(...) description: str = Field(..., description="""Description or other notes about the channel.""") - emission_lambda: np.float32 = Field( - ..., description="""Emission wavelength for channel, in nm.""" - ) + emission_lambda: float = Field(..., description="""Emission wavelength for channel, in nm.""") class MotionCorrection(NWBDataInterface): diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_retinotopy.py index c8b182e..167c50f 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_retinotopy.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_retinotopy.py @@ -127,17 +127,15 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -161,17 +159,15 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -195,17 +191,15 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -229,17 +223,15 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -263,24 +255,20 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): } }, ) - bits_per_pixel: Optional[np.int32] = Field( + bits_per_pixel: Optional[int] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""", ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) - focal_depth: Optional[np.float32] = Field( - None, description="""Focal depth offset, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") + focal_depth: Optional[float] = Field(None, description="""Focal depth offset, in meters.""") format: Optional[str] = Field( None, description="""Format of image. Right now only 'raw' is supported.""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -301,14 +289,12 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel): "linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"} }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -332,21 +318,19 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): } }, ) - bits_per_pixel: Optional[np.int32] = Field( + bits_per_pixel: Optional[int] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value""", ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") format: Optional[str] = Field( None, description="""Format of image. Right now only 'raw' is supported.""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_base.py index d890d13..13a1dcf 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_base.py @@ -114,11 +114,11 @@ class TimeSeriesReferenceVectorData(VectorData): name: str = Field( "timeseries", json_schema_extra={"linkml_meta": {"ifabsent": "string(timeseries)"}} ) - idx_start: np.int32 = Field( + idx_start: int = Field( ..., description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) - count: np.int32 = Field( + count: int = Field( ..., description="""Number of data samples available in this time series, during this epoch""", ) @@ -146,15 +146,15 @@ class Image(NWBData): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -221,12 +221,12 @@ class TimeSeries(NWBDataInterface): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -255,15 +255,15 @@ class TimeSeriesData(ConfiguredBaseModel): "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) - conversion: Optional[np.float32] = Field( + conversion: Optional[float] = Field( None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""", ) - offset: Optional[np.float32] = Field( + offset: Optional[float] = Field( None, description="""Scalar to add to the data after scaling by 'conversion' to finalize its coercion to the specified 'unit'. Two common examples of this include (a) data stored in an unsigned type that requires a shift after scaling to re-center the data, and (b) specialized recording devices that naturally cause a scalar offset with respect to the true units.""", ) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""", ) @@ -298,11 +298,11 @@ class TimeSeriesStartingTime(ConfiguredBaseModel): "linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"} }, ) - rate: Optional[np.float32] = Field(None, description="""Sampling rate, in Hz.""") + rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""") unit: Optional[str] = Field( None, description="""Unit of measurement for time, which is fixed to 'seconds'.""" ) - value: np.float64 = Field(...) + value: float = Field(...) class TimeSeriesSync(ConfiguredBaseModel): diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_behavior.py index bc29452..d2321dd 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_behavior.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_behavior.py @@ -93,12 +93,12 @@ class SpatialSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -133,10 +133,10 @@ class SpatialSeriesData(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, 1 x"], np.number], - NDArray[Shape["* num_times, 2 x_y"], np.number], - NDArray[Shape["* num_times, 3 x_y_z"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, 1 x"], float], + NDArray[Shape["* num_times, 2 x_y"], float], + NDArray[Shape["* num_times, 3 x_y_z"], float], ] ] = Field(None) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ecephys.py index 6dd5f69..694a64f 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ecephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ecephys.py @@ -112,9 +112,9 @@ class ElectricalSeries(TimeSeries): description="""Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be \"High-pass 4-pole Bessel filter at 500 Hz\". If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be \"Low-pass filter at 300 Hz\". If a non-standard filter type is used, provide as much detail about the filter properties as possible.""", ) data: Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_channels"], np.number], - NDArray[Shape["* num_times, * num_channels, * num_samples"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_channels"], float], + NDArray[Shape["* num_times, * num_channels, * num_samples"], float], ] = Field(..., description="""Recorded voltage data.""") electrodes: Named[DynamicTableRegion] = Field( ..., @@ -123,7 +123,7 @@ class ElectricalSeries(TimeSeries): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( + channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field( None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}}, @@ -137,12 +137,12 @@ class ElectricalSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -171,10 +171,10 @@ class SpikeEventSeries(ElectricalSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_events, * num_samples"], np.number], - NDArray[Shape["* num_events, * num_channels, * num_samples"], np.number], + NDArray[Shape["* num_events, * num_samples"], float], + NDArray[Shape["* num_events, * num_channels, * num_samples"], float], ] = Field(..., description="""Spike waveforms.""") - timestamps: NDArray[Shape["* num_times"], np.float64] = Field( + timestamps: NDArray[Shape["* num_times"], float] = Field( ..., description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -190,7 +190,7 @@ class SpikeEventSeries(ElectricalSeries): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( + channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field( None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}}, @@ -204,7 +204,7 @@ class SpikeEventSeries(ElectricalSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -240,7 +240,7 @@ class FeatureExtraction(NWBDataInterface): description="""Description of features (eg, ''PC1'') for each of the extracted features.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_features"}]}}}, ) - features: NDArray[Shape["* num_events, * num_channels, * num_features"], np.float32] = Field( + features: NDArray[Shape["* num_events, * num_channels, * num_features"], float] = Field( ..., description="""Multi-dimensional array of features extracted from each event.""", json_schema_extra={ @@ -255,7 +255,7 @@ class FeatureExtraction(NWBDataInterface): } }, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Times of events that features correspond to (can be a link).""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, @@ -285,12 +285,12 @@ class EventDetection(NWBDataInterface): ..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""", ) - source_idx: NDArray[Shape["* num_events"], np.int32] = Field( + source_idx: NDArray[Shape["* num_events"], int] = Field( ..., description="""Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Timestamps of events, in seconds.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, @@ -375,9 +375,9 @@ class ElectrodeGroupPosition(ConfiguredBaseModel): "linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"} }, ) - x: Optional[np.float32] = Field(None, description="""x coordinate""") - y: Optional[np.float32] = Field(None, description="""y coordinate""") - z: Optional[np.float32] = Field(None, description="""z coordinate""") + x: Optional[float] = Field(None, description="""x coordinate""") + y: Optional[float] = Field(None, description="""y coordinate""") + z: Optional[float] = Field(None, description="""z coordinate""") class ClusterWaveforms(NWBDataInterface): @@ -396,7 +396,7 @@ class ClusterWaveforms(NWBDataInterface): waveform_filtering: str = Field( ..., description="""Filtering applied to data before generating mean/sd""" ) - waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( + waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], float] = Field( ..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""", json_schema_extra={ @@ -405,7 +405,7 @@ class ClusterWaveforms(NWBDataInterface): } }, ) - waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( + waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], float] = Field( ..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""", json_schema_extra={ @@ -432,17 +432,17 @@ class Clustering(NWBDataInterface): ..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""", ) - num: NDArray[Shape["* num_events"], np.int32] = Field( + num: NDArray[Shape["* num_events"], int] = Field( ..., description="""Cluster number of each event""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, ) - peak_over_rms: NDArray[Shape["* num_clusters"], np.float32] = Field( + peak_over_rms: NDArray[Shape["* num_clusters"], float] = Field( ..., description="""Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}]}}}, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_epoch.py index 635e417..0073a74 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_epoch.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_epoch.py @@ -96,7 +96,7 @@ class TimeIntervals(DynamicTable): ) name: str = Field(...) - start_time: NDArray[Any, np.float32] = Field( + start_time: NDArray[Any, float] = Field( ..., description="""Start time of epoch, in seconds.""", json_schema_extra={ @@ -105,7 +105,7 @@ class TimeIntervals(DynamicTable): } }, ) - stop_time: NDArray[Any, np.float32] = Field( + stop_time: NDArray[Any, float] = Field( ..., description="""Stop time of epoch, in seconds.""", json_schema_extra={ diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_file.py index f1e2354..453e761 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_file.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_file.py @@ -127,7 +127,7 @@ class NWBFile(NWBContainer): None, description="""File version string. Use semantic versioning, e.g. 1.2.1. This will be the name of the format with trailing major, minor and patch numbers.""", ) - file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = Field( + file_create_date: NDArray[Shape["* num_modifications"], datetime] = Field( ..., description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""", json_schema_extra={ @@ -141,11 +141,11 @@ class NWBFile(NWBContainer): session_description: str = Field( ..., description="""A description of the experimental session and data in the file.""" ) - session_start_time: np.datetime64 = Field( + session_start_time: datetime = Field( ..., description="""Date and time of the experiment/session start. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds.""", ) - timestamps_reference_time: np.datetime64 = Field( + timestamps_reference_time: datetime = Field( ..., description="""Date and time corresponding to time zero of all timestamps. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. All times stored in the file use this time as reference (i.e., time zero).""", ) @@ -383,7 +383,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): "linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"} }, ) - x: Optional[NDArray[Any, np.float32]] = Field( + x: Optional[NDArray[Any, float]] = Field( None, description="""x coordinate of the channel location in the brain (+x is posterior).""", json_schema_extra={ @@ -392,7 +392,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - y: Optional[NDArray[Any, np.float32]] = Field( + y: Optional[NDArray[Any, float]] = Field( None, description="""y coordinate of the channel location in the brain (+y is inferior).""", json_schema_extra={ @@ -401,7 +401,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - z: Optional[NDArray[Any, np.float32]] = Field( + z: Optional[NDArray[Any, float]] = Field( None, description="""z coordinate of the channel location in the brain (+z is right).""", json_schema_extra={ @@ -410,7 +410,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - imp: Optional[NDArray[Any, np.float32]] = Field( + imp: Optional[NDArray[Any, float]] = Field( None, description="""Impedance of the channel, in ohms.""", json_schema_extra={ @@ -449,7 +449,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_x: Optional[NDArray[Any, np.float32]] = Field( + rel_x: Optional[NDArray[Any, float]] = Field( None, description="""x coordinate in electrode group""", json_schema_extra={ @@ -458,7 +458,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_y: Optional[NDArray[Any, np.float32]] = Field( + rel_y: Optional[NDArray[Any, float]] = Field( None, description="""y coordinate in electrode group""", json_schema_extra={ @@ -467,7 +467,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_z: Optional[NDArray[Any, np.float32]] = Field( + rel_z: Optional[NDArray[Any, float]] = Field( None, description="""z coordinate in electrode group""", json_schema_extra={ @@ -576,7 +576,7 @@ class Subject(NWBContainer): age: Optional[SubjectAge] = Field( None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""" ) - date_of_birth: Optional[np.datetime64] = Field( + date_of_birth: Optional[datetime] = Field( None, description="""Date of birth of subject. Can be supplied instead of 'age'.""" ) description: Optional[str] = Field( diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_icephys.py index c1feffe..c903549 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_icephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_icephys.py @@ -116,11 +116,11 @@ class PatchClampSeries(TimeSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""") - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -133,12 +133,12 @@ class PatchClampSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -171,7 +171,7 @@ class PatchClampSeriesData(ConfiguredBaseModel): None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""", ) - array: Optional[NDArray[Shape["* num_times"], np.number]] = Field( + array: Optional[NDArray[Shape["* num_times"], float]] = Field( None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}} ) @@ -187,18 +187,18 @@ class CurrentClampSeries(PatchClampSeries): name: str = Field(...) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") - bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""") - bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""") - capacitance_compensation: Optional[np.float32] = Field( + bias_current: Optional[float] = Field(None, description="""Bias current, in amps.""") + bridge_balance: Optional[float] = Field(None, description="""Bridge balance, in ohms.""") + capacitance_compensation: Optional[float] = Field( None, description="""Capacitance compensation, in farads.""" ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -211,12 +211,12 @@ class CurrentClampSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -266,18 +266,16 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""", ) - bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""") - bridge_balance: np.float32 = Field( - ..., description="""Bridge balance, in ohms, fixed to 0.0.""" - ) - capacitance_compensation: np.float32 = Field( + bias_current: float = Field(..., description="""Bias current, in amps, fixed to 0.0.""") + bridge_balance: float = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + capacitance_compensation: float = Field( ..., description="""Capacitance compensation, in farads, fixed to 0.0.""" ) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -290,12 +288,12 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -327,10 +325,10 @@ class CurrentClampStimulusSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -343,12 +341,12 @@ class CurrentClampStimulusSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -419,10 +417,10 @@ class VoltageClampSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -435,12 +433,12 @@ class VoltageClampSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -496,7 +494,7 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): @@ -519,7 +517,7 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): @@ -542,7 +540,7 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): @@ -565,7 +563,7 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): @@ -588,7 +586,7 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): @@ -611,7 +609,7 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): @@ -634,7 +632,7 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampStimulusSeries(PatchClampSeries): @@ -651,10 +649,10 @@ class VoltageClampStimulusSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -667,12 +665,12 @@ class VoltageClampStimulusSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -747,7 +745,7 @@ class SweepTable(DynamicTable): ) name: str = Field(...) - sweep_number: NDArray[Any, np.uint32] = Field( + sweep_number: NDArray[Any, int] = Field( ..., description="""Sweep number of the PatchClampSeries in that row.""", json_schema_extra={ diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_image.py index e1ee620..e69ff14 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_image.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_image.py @@ -76,15 +76,15 @@ class GrayscaleImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -99,15 +99,15 @@ class RGBImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -122,15 +122,15 @@ class RGBAImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -146,13 +146,12 @@ class ImageSeries(TimeSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], NDArray[Shape["* frame, * x, * y, * z"], float] ] = Field( ..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -174,12 +173,12 @@ class ImageSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -210,7 +209,7 @@ class ImageSeriesExternalFile(ConfiguredBaseModel): "linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"} }, ) - starting_frame: Optional[np.int32] = Field( + starting_frame: Optional[int] = Field( None, description="""Each external image may contain one or more consecutive frames of the full ImageSeries. This attribute serves as an index to indicate which frames each file contains, to faciliate random access. The 'starting_frame' attribute, hence, contains a list of frame numbers within the full ImageSeries of the first frame of each file listed in the parent 'external_file' dataset. Zero-based indexing is used (hence, the first element will always be zero). For example, if the 'external_file' dataset has three paths to files and the first file has 5 frames, the second file has 10 frames, and the third file has 20 frames, then this attribute will have values [0, 5, 15]. If there is a single external file that holds all of the frames of the ImageSeries (and so there is a single element in the 'external_file' dataset), then this attribute should have value [0].""", ) @@ -230,13 +229,12 @@ class ImageMaskSeries(ImageSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], NDArray[Shape["* frame, * x, * y, * z"], float] ] = Field( ..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -258,12 +256,12 @@ class ImageMaskSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -291,24 +289,23 @@ class OpticalSeries(ImageSeries): ) name: str = Field(...) - distance: Optional[np.float32] = Field( + distance: Optional[float] = Field( None, description="""Distance from camera/monitor to target/eye.""" ) field_of_view: Optional[ Union[ - NDArray[Shape["2 width_height"], np.float32], - NDArray[Shape["3 width_height_depth"], np.float32], + NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height_depth"], float] ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], float], ] = Field(..., description="""Images presented to subject, either grayscale or RGB""") orientation: Optional[str] = Field( None, description="""Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -330,12 +327,12 @@ class OpticalSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -363,7 +360,7 @@ class IndexSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.uint32] = Field( + data: NDArray[Shape["* num_times"], int] = Field( ..., description="""Index of the image (using zero-indexing) in the linked Images object.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -377,12 +374,12 @@ class IndexSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_misc.py index a3861c2..428c0b1 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_misc.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_misc.py @@ -129,12 +129,12 @@ class AbstractFeatureSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -169,8 +169,8 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_features"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_features"], float], ] ] = Field(None) @@ -199,12 +199,12 @@ class AnnotationSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -232,7 +232,7 @@ class IntervalSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.int8] = Field( + data: NDArray[Shape["* num_times"], int] = Field( ..., description="""Use values >0 if interval started, <0 if interval ended.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -246,12 +246,12 @@ class IntervalSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -303,12 +303,12 @@ class DecompositionSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -341,7 +341,7 @@ class DecompositionSeriesData(ConfiguredBaseModel): None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) - array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], np.number]] = Field( + array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], float]] = Field( None, json_schema_extra={ "linkml_meta": { @@ -377,7 +377,7 @@ class DecompositionSeriesBands(DynamicTable): } }, ) - band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field( + band_limits: NDArray[Shape["* num_bands, 2 low_high"], float] = Field( ..., description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""", json_schema_extra={ @@ -391,12 +391,12 @@ class DecompositionSeriesBands(DynamicTable): } }, ) - band_mean: NDArray[Shape["* num_bands"], np.float32] = Field( + band_mean: NDArray[Shape["* num_bands"], float] = Field( ..., description="""The mean Gaussian filters, in Hz.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_bands"}]}}}, ) - band_stdev: NDArray[Shape["* num_bands"], np.float32] = Field( + band_stdev: NDArray[Shape["* num_bands"], float] = Field( ..., description="""The standard deviation of Gaussian filters, in Hz.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_bands"}]}}}, @@ -445,7 +445,7 @@ class Units(DynamicTable): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field( + obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], float]] = Field( None, description="""Observation intervals for each unit.""", json_schema_extra={ @@ -478,17 +478,17 @@ class Units(DynamicTable): ) waveform_mean: Optional[ Union[ - NDArray[Shape["* num_units, * num_samples"], np.float32], - NDArray[Shape["* num_units, * num_samples, * num_electrodes"], np.float32], + NDArray[Shape["* num_units, * num_samples"], float], + NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float], ] ] = Field(None, description="""Spike waveform mean for each spike unit.""") waveform_sd: Optional[ Union[ - NDArray[Shape["* num_units, * num_samples"], np.float32], - NDArray[Shape["* num_units, * num_samples, * num_electrodes"], np.float32], + NDArray[Shape["* num_units, * num_samples"], float], + NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float], ] ] = Field(None, description="""Spike waveform standard deviation for each spike unit.""") - waveforms: Optional[NDArray[Shape["* num_waveforms, * num_samples"], np.number]] = Field( + waveforms: Optional[NDArray[Shape["* num_waveforms, * num_samples"], float]] = Field( None, description="""Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same.""", json_schema_extra={ @@ -541,7 +541,7 @@ class UnitsSpikeTimes(VectorData): "linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"} }, ) - resolution: Optional[np.float64] = Field( + resolution: Optional[float] = Field( None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ogen.py index 8b0a950..419b1d0 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ogen.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ogen.py @@ -76,7 +76,7 @@ class OptogeneticSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.number] = Field( + data: NDArray[Shape["* num_times"], float] = Field( ..., description="""Applied power for optogenetic stimulus, in watts.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -90,12 +90,12 @@ class OptogeneticSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -124,7 +124,7 @@ class OptogeneticStimulusSite(NWBContainer): name: str = Field(...) description: str = Field(..., description="""Description of stimulation site.""") - excitation_lambda: np.float32 = Field(..., description="""Excitation wavelength, in nm.""") + excitation_lambda: float = Field(..., description="""Excitation wavelength, in nm.""") location: str = Field( ..., description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ophys.py index de696cd..7693cc6 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ophys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ophys.py @@ -114,31 +114,28 @@ class OnePhotonSeries(ImageSeries): ) name: str = Field(...) - pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") - scan_line_rate: Optional[np.float32] = Field( + pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""") + scan_line_rate: Optional[float] = Field( None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) - exposure_time: Optional[np.float32] = Field( + exposure_time: Optional[float] = Field( None, description="""Exposure time of the sample; often the inverse of the frequency.""" ) - binning: Optional[np.uint8] = Field( + binning: Optional[int] = Field( None, description="""Amount of pixels combined into 'bins'; could be 1, 2, 4, 8, etc.""" ) - power: Optional[np.float32] = Field( - None, description="""Power of the excitation in mW, if known.""" - ) - intensity: Optional[np.float32] = Field( + power: Optional[float] = Field(None, description="""Power of the excitation in mW, if known.""") + intensity: Optional[float] = Field( None, description="""Intensity of the excitation in mW/mm^2, if known.""" ) data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], NDArray[Shape["* frame, * x, * y, * z"], float] ] = Field( ..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -160,12 +157,12 @@ class OnePhotonSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -193,25 +190,23 @@ class TwoPhotonSeries(ImageSeries): ) name: str = Field(...) - pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") - scan_line_rate: Optional[np.float32] = Field( + pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""") + scan_line_rate: Optional[float] = Field( None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) field_of_view: Optional[ Union[ - NDArray[Shape["2 width_height"], np.float32], - NDArray[Shape["3 width_height_depth"], np.float32], + NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height_depth"], float] ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], NDArray[Shape["* frame, * x, * y, * z"], float] ] = Field( ..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -233,12 +228,12 @@ class TwoPhotonSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -267,8 +262,7 @@ class RoiResponseSeries(TimeSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_rois"], np.number], + NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times, * num_rois"], float] ] = Field(..., description="""Signals from ROIs.""") rois: Named[DynamicTableRegion] = Field( ..., @@ -286,12 +280,12 @@ class RoiResponseSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -451,9 +445,9 @@ class PlaneSegmentationPixelMask(VectorData): "linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"} }, ) - x: Optional[np.uint32] = Field(None, description="""Pixel x-coordinate.""") - y: Optional[np.uint32] = Field(None, description="""Pixel y-coordinate.""") - weight: Optional[np.float32] = Field(None, description="""Weight of the pixel.""") + x: Optional[int] = Field(None, description="""Pixel x-coordinate.""") + y: Optional[int] = Field(None, description="""Pixel y-coordinate.""") + weight: Optional[float] = Field(None, description="""Weight of the pixel.""") description: Optional[str] = Field( None, description="""Description of what these vectors represent.""" ) @@ -480,10 +474,10 @@ class PlaneSegmentationVoxelMask(VectorData): "linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"} }, ) - x: Optional[np.uint32] = Field(None, description="""Voxel x-coordinate.""") - y: Optional[np.uint32] = Field(None, description="""Voxel y-coordinate.""") - z: Optional[np.uint32] = Field(None, description="""Voxel z-coordinate.""") - weight: Optional[np.float32] = Field(None, description="""Weight of the voxel.""") + x: Optional[int] = Field(None, description="""Voxel x-coordinate.""") + y: Optional[int] = Field(None, description="""Voxel y-coordinate.""") + z: Optional[int] = Field(None, description="""Voxel z-coordinate.""") + weight: Optional[float] = Field(None, description="""Weight of the voxel.""") description: Optional[str] = Field( None, description="""Description of what these vectors represent.""" ) @@ -523,9 +517,7 @@ class OpticalChannel(NWBContainer): name: str = Field(...) description: str = Field(..., description="""Description or other notes about the channel.""") - emission_lambda: np.float32 = Field( - ..., description="""Emission wavelength for channel, in nm.""" - ) + emission_lambda: float = Field(..., description="""Emission wavelength for channel, in nm.""") class MotionCorrection(NWBDataInterface): diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_retinotopy.py index fd2509b..ce3ae04 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_retinotopy.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_retinotopy.py @@ -127,17 +127,15 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -161,17 +159,15 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -195,17 +191,15 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -229,17 +223,15 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -263,24 +255,20 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): } }, ) - bits_per_pixel: Optional[np.int32] = Field( + bits_per_pixel: Optional[int] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""", ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) - focal_depth: Optional[np.float32] = Field( - None, description="""Focal depth offset, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") + focal_depth: Optional[float] = Field(None, description="""Focal depth offset, in meters.""") format: Optional[str] = Field( None, description="""Format of image. Right now only 'raw' is supported.""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -301,14 +289,12 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel): "linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"} }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -332,21 +318,19 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): } }, ) - bits_per_pixel: Optional[np.int32] = Field( + bits_per_pixel: Optional[int] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value""", ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") format: Optional[str] = Field( None, description="""Format of image. Right now only 'raw' is supported.""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_base.py index b76ba30..745ac40 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_base.py @@ -114,11 +114,11 @@ class TimeSeriesReferenceVectorData(VectorData): name: str = Field( "timeseries", json_schema_extra={"linkml_meta": {"ifabsent": "string(timeseries)"}} ) - idx_start: np.int32 = Field( + idx_start: int = Field( ..., description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""", ) - count: np.int32 = Field( + count: int = Field( ..., description="""Number of data samples available in this time series, during this epoch""", ) @@ -146,15 +146,15 @@ class Image(NWBData): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -221,12 +221,12 @@ class TimeSeries(NWBDataInterface): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -255,15 +255,15 @@ class TimeSeriesData(ConfiguredBaseModel): "data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, ) - conversion: Optional[np.float32] = Field( + conversion: Optional[float] = Field( None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""", ) - offset: Optional[np.float32] = Field( + offset: Optional[float] = Field( None, description="""Scalar to add to the data after scaling by 'conversion' to finalize its coercion to the specified 'unit'. Two common examples of this include (a) data stored in an unsigned type that requires a shift after scaling to re-center the data, and (b) specialized recording devices that naturally cause a scalar offset with respect to the true units.""", ) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""", ) @@ -298,11 +298,11 @@ class TimeSeriesStartingTime(ConfiguredBaseModel): "linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"} }, ) - rate: Optional[np.float32] = Field(None, description="""Sampling rate, in Hz.""") + rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""") unit: Optional[str] = Field( None, description="""Unit of measurement for time, which is fixed to 'seconds'.""" ) - value: np.float64 = Field(...) + value: float = Field(...) class TimeSeriesSync(ConfiguredBaseModel): diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_behavior.py index 991d017..304d675 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_behavior.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_behavior.py @@ -93,12 +93,12 @@ class SpatialSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -133,10 +133,10 @@ class SpatialSeriesData(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, 1 x"], np.number], - NDArray[Shape["* num_times, 2 x_y"], np.number], - NDArray[Shape["* num_times, 3 x_y_z"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, 1 x"], float], + NDArray[Shape["* num_times, 2 x_y"], float], + NDArray[Shape["* num_times, 3 x_y_z"], float], ] ] = Field(None) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ecephys.py index e11eaad..4b32f60 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ecephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ecephys.py @@ -112,9 +112,9 @@ class ElectricalSeries(TimeSeries): description="""Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be \"High-pass 4-pole Bessel filter at 500 Hz\". If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be \"Low-pass filter at 300 Hz\". If a non-standard filter type is used, provide as much detail about the filter properties as possible.""", ) data: Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_channels"], np.number], - NDArray[Shape["* num_times, * num_channels, * num_samples"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_channels"], float], + NDArray[Shape["* num_times, * num_channels, * num_samples"], float], ] = Field(..., description="""Recorded voltage data.""") electrodes: Named[DynamicTableRegion] = Field( ..., @@ -123,7 +123,7 @@ class ElectricalSeries(TimeSeries): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( + channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field( None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}}, @@ -137,12 +137,12 @@ class ElectricalSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -171,10 +171,10 @@ class SpikeEventSeries(ElectricalSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_events, * num_samples"], np.number], - NDArray[Shape["* num_events, * num_channels, * num_samples"], np.number], + NDArray[Shape["* num_events, * num_samples"], float], + NDArray[Shape["* num_events, * num_channels, * num_samples"], float], ] = Field(..., description="""Spike waveforms.""") - timestamps: NDArray[Shape["* num_times"], np.float64] = Field( + timestamps: NDArray[Shape["* num_times"], float] = Field( ..., description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -190,7 +190,7 @@ class SpikeEventSeries(ElectricalSeries): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field( + channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field( None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}}, @@ -204,7 +204,7 @@ class SpikeEventSeries(ElectricalSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -240,7 +240,7 @@ class FeatureExtraction(NWBDataInterface): description="""Description of features (eg, ''PC1'') for each of the extracted features.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_features"}]}}}, ) - features: NDArray[Shape["* num_events, * num_channels, * num_features"], np.float32] = Field( + features: NDArray[Shape["* num_events, * num_channels, * num_features"], float] = Field( ..., description="""Multi-dimensional array of features extracted from each event.""", json_schema_extra={ @@ -255,7 +255,7 @@ class FeatureExtraction(NWBDataInterface): } }, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Times of events that features correspond to (can be a link).""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, @@ -285,12 +285,12 @@ class EventDetection(NWBDataInterface): ..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""", ) - source_idx: NDArray[Shape["* num_events"], np.int32] = Field( + source_idx: NDArray[Shape["* num_events"], int] = Field( ..., description="""Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Timestamps of events, in seconds.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, @@ -375,9 +375,9 @@ class ElectrodeGroupPosition(ConfiguredBaseModel): "linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"} }, ) - x: Optional[np.float32] = Field(None, description="""x coordinate""") - y: Optional[np.float32] = Field(None, description="""y coordinate""") - z: Optional[np.float32] = Field(None, description="""z coordinate""") + x: Optional[float] = Field(None, description="""x coordinate""") + y: Optional[float] = Field(None, description="""y coordinate""") + z: Optional[float] = Field(None, description="""z coordinate""") class ClusterWaveforms(NWBDataInterface): @@ -396,7 +396,7 @@ class ClusterWaveforms(NWBDataInterface): waveform_filtering: str = Field( ..., description="""Filtering applied to data before generating mean/sd""" ) - waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( + waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], float] = Field( ..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""", json_schema_extra={ @@ -405,7 +405,7 @@ class ClusterWaveforms(NWBDataInterface): } }, ) - waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field( + waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], float] = Field( ..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""", json_schema_extra={ @@ -432,17 +432,17 @@ class Clustering(NWBDataInterface): ..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""", ) - num: NDArray[Shape["* num_events"], np.int32] = Field( + num: NDArray[Shape["* num_events"], int] = Field( ..., description="""Cluster number of each event""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, ) - peak_over_rms: NDArray[Shape["* num_clusters"], np.float32] = Field( + peak_over_rms: NDArray[Shape["* num_clusters"], float] = Field( ..., description="""Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}]}}}, ) - times: NDArray[Shape["* num_events"], np.float64] = Field( + times: NDArray[Shape["* num_events"], float] = Field( ..., description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_events"}]}}}, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_epoch.py index 2d844c9..a715324 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_epoch.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_epoch.py @@ -96,7 +96,7 @@ class TimeIntervals(DynamicTable): ) name: str = Field(...) - start_time: NDArray[Any, np.float32] = Field( + start_time: NDArray[Any, float] = Field( ..., description="""Start time of epoch, in seconds.""", json_schema_extra={ @@ -105,7 +105,7 @@ class TimeIntervals(DynamicTable): } }, ) - stop_time: NDArray[Any, np.float32] = Field( + stop_time: NDArray[Any, float] = Field( ..., description="""Stop time of epoch, in seconds.""", json_schema_extra={ diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_file.py index 47cb4ad..3ccc777 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_file.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_file.py @@ -127,7 +127,7 @@ class NWBFile(NWBContainer): None, description="""File version string. Use semantic versioning, e.g. 1.2.1. This will be the name of the format with trailing major, minor and patch numbers.""", ) - file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = Field( + file_create_date: NDArray[Shape["* num_modifications"], datetime] = Field( ..., description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""", json_schema_extra={ @@ -141,11 +141,11 @@ class NWBFile(NWBContainer): session_description: str = Field( ..., description="""A description of the experimental session and data in the file.""" ) - session_start_time: np.datetime64 = Field( + session_start_time: datetime = Field( ..., description="""Date and time of the experiment/session start. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds.""", ) - timestamps_reference_time: np.datetime64 = Field( + timestamps_reference_time: datetime = Field( ..., description="""Date and time corresponding to time zero of all timestamps. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. All times stored in the file use this time as reference (i.e., time zero).""", ) @@ -391,7 +391,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): "linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"} }, ) - x: Optional[NDArray[Any, np.float32]] = Field( + x: Optional[NDArray[Any, float]] = Field( None, description="""x coordinate of the channel location in the brain (+x is posterior).""", json_schema_extra={ @@ -400,7 +400,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - y: Optional[NDArray[Any, np.float32]] = Field( + y: Optional[NDArray[Any, float]] = Field( None, description="""y coordinate of the channel location in the brain (+y is inferior).""", json_schema_extra={ @@ -409,7 +409,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - z: Optional[NDArray[Any, np.float32]] = Field( + z: Optional[NDArray[Any, float]] = Field( None, description="""z coordinate of the channel location in the brain (+z is right).""", json_schema_extra={ @@ -418,7 +418,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - imp: Optional[NDArray[Any, np.float32]] = Field( + imp: Optional[NDArray[Any, float]] = Field( None, description="""Impedance of the channel, in ohms.""", json_schema_extra={ @@ -457,7 +457,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_x: Optional[NDArray[Any, np.float32]] = Field( + rel_x: Optional[NDArray[Any, float]] = Field( None, description="""x coordinate in electrode group""", json_schema_extra={ @@ -466,7 +466,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_y: Optional[NDArray[Any, np.float32]] = Field( + rel_y: Optional[NDArray[Any, float]] = Field( None, description="""y coordinate in electrode group""", json_schema_extra={ @@ -475,7 +475,7 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): } }, ) - rel_z: Optional[NDArray[Any, np.float32]] = Field( + rel_z: Optional[NDArray[Any, float]] = Field( None, description="""z coordinate in electrode group""", json_schema_extra={ @@ -584,7 +584,7 @@ class Subject(NWBContainer): age: Optional[SubjectAge] = Field( None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""" ) - date_of_birth: Optional[np.datetime64] = Field( + date_of_birth: Optional[datetime] = Field( None, description="""Date of birth of subject. Can be supplied instead of 'age'.""" ) description: Optional[str] = Field( diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_icephys.py index b651db2..b84a7f0 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_icephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_icephys.py @@ -116,11 +116,11 @@ class PatchClampSeries(TimeSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""") - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -133,12 +133,12 @@ class PatchClampSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -171,7 +171,7 @@ class PatchClampSeriesData(ConfiguredBaseModel): None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""", ) - array: Optional[NDArray[Shape["* num_times"], np.number]] = Field( + array: Optional[NDArray[Shape["* num_times"], float]] = Field( None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}} ) @@ -187,18 +187,18 @@ class CurrentClampSeries(PatchClampSeries): name: str = Field(...) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") - bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""") - bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""") - capacitance_compensation: Optional[np.float32] = Field( + bias_current: Optional[float] = Field(None, description="""Bias current, in amps.""") + bridge_balance: Optional[float] = Field(None, description="""Bridge balance, in ohms.""") + capacitance_compensation: Optional[float] = Field( None, description="""Capacitance compensation, in farads.""" ) stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -211,12 +211,12 @@ class CurrentClampSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -266,18 +266,16 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""", ) - bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""") - bridge_balance: np.float32 = Field( - ..., description="""Bridge balance, in ohms, fixed to 0.0.""" - ) - capacitance_compensation: np.float32 = Field( + bias_current: float = Field(..., description="""Bias current, in amps, fixed to 0.0.""") + bridge_balance: float = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + capacitance_compensation: float = Field( ..., description="""Capacitance compensation, in farads, fixed to 0.0.""" ) data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -290,12 +288,12 @@ class IZeroClampSeries(CurrentClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -327,10 +325,10 @@ class CurrentClampStimulusSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -343,12 +341,12 @@ class CurrentClampStimulusSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -419,10 +417,10 @@ class VoltageClampSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -435,12 +433,12 @@ class VoltageClampSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -496,7 +494,7 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): @@ -519,7 +517,7 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): @@ -542,7 +540,7 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): @@ -565,7 +563,7 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): @@ -588,7 +586,7 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): @@ -611,7 +609,7 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): @@ -634,7 +632,7 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""", ) - value: np.float32 = Field(...) + value: float = Field(...) class VoltageClampStimulusSeries(PatchClampSeries): @@ -651,10 +649,10 @@ class VoltageClampStimulusSeries(PatchClampSeries): stimulus_description: Optional[str] = Field( None, description="""Protocol/stimulus name for this patch-clamp dataset.""" ) - sweep_number: Optional[np.uint32] = Field( + sweep_number: Optional[int] = Field( None, description="""Sweep number, allows to group different PatchClampSeries together.""" ) - gain: Optional[np.float32] = Field( + gain: Optional[float] = Field( None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""", ) @@ -667,12 +665,12 @@ class VoltageClampStimulusSeries(PatchClampSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -747,7 +745,7 @@ class SweepTable(DynamicTable): ) name: str = Field(...) - sweep_number: NDArray[Any, np.uint32] = Field( + sweep_number: NDArray[Any, int] = Field( ..., description="""Sweep number of the PatchClampSeries in that row.""", json_schema_extra={ diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_image.py index 7377214..9fff36e 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_image.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_image.py @@ -71,15 +71,15 @@ class GrayscaleImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -94,15 +94,15 @@ class RGBImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -117,15 +117,15 @@ class RGBAImage(Image): ) name: str = Field(...) - resolution: Optional[np.float32] = Field( + resolution: Optional[float] = Field( None, description="""Pixel resolution of the image, in pixels per centimeter.""" ) description: Optional[str] = Field(None, description="""Description of the image.""") array: Optional[ Union[ - NDArray[Shape["* x, * y"], np.number], - NDArray[Shape["* x, * y, 3 r_g_b"], np.number], - NDArray[Shape["* x, * y, 4 r_g_b_a"], np.number], + NDArray[Shape["* x, * y"], float], + NDArray[Shape["* x, * y, 3 r_g_b"], float], + NDArray[Shape["* x, * y, 4 r_g_b_a"], float], ] ] = Field(None) @@ -141,13 +141,12 @@ class ImageSeries(TimeSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], NDArray[Shape["* frame, * x, * y, * z"], float] ] = Field( ..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -169,12 +168,12 @@ class ImageSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -205,7 +204,7 @@ class ImageSeriesExternalFile(ConfiguredBaseModel): "linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"} }, ) - starting_frame: Optional[np.int32] = Field( + starting_frame: Optional[int] = Field( None, description="""Each external image may contain one or more consecutive frames of the full ImageSeries. This attribute serves as an index to indicate which frames each file contains, to facilitate random access. The 'starting_frame' attribute, hence, contains a list of frame numbers within the full ImageSeries of the first frame of each file listed in the parent 'external_file' dataset. Zero-based indexing is used (hence, the first element will always be zero). For example, if the 'external_file' dataset has three paths to files and the first file has 5 frames, the second file has 10 frames, and the third file has 20 frames, then this attribute will have values [0, 5, 15]. If there is a single external file that holds all of the frames of the ImageSeries (and so there is a single element in the 'external_file' dataset), then this attribute should have value [0].""", ) @@ -225,13 +224,12 @@ class ImageMaskSeries(ImageSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], NDArray[Shape["* frame, * x, * y, * z"], float] ] = Field( ..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -253,12 +251,12 @@ class ImageMaskSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -286,24 +284,23 @@ class OpticalSeries(ImageSeries): ) name: str = Field(...) - distance: Optional[np.float32] = Field( + distance: Optional[float] = Field( None, description="""Distance from camera/monitor to target/eye.""" ) field_of_view: Optional[ Union[ - NDArray[Shape["2 width_height"], np.float32], - NDArray[Shape["3 width_height_depth"], np.float32], + NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height_depth"], float] ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number], + NDArray[Shape["* frame, * x, * y"], float], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], float], ] = Field(..., description="""Images presented to subject, either grayscale or RGB""") orientation: Optional[str] = Field( None, description="""Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -325,12 +322,12 @@ class OpticalSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -358,7 +355,7 @@ class IndexSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.uint32] = Field( + data: NDArray[Shape["* num_times"], int] = Field( ..., description="""Index of the image (using zero-indexing) in the linked Images object.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -372,12 +369,12 @@ class IndexSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_misc.py index 0cfd65b..7d8bcb2 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_misc.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_misc.py @@ -129,12 +129,12 @@ class AbstractFeatureSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -169,8 +169,8 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel): ) array: Optional[ Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_features"], np.number], + NDArray[Shape["* num_times"], float], + NDArray[Shape["* num_times, * num_features"], float], ] ] = Field(None) @@ -199,12 +199,12 @@ class AnnotationSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -232,7 +232,7 @@ class IntervalSeries(TimeSeries): ) name: str = Field(...) - data: NDArray[Shape["* num_times"], np.int8] = Field( + data: NDArray[Shape["* num_times"], int] = Field( ..., description="""Use values >0 if interval started, <0 if interval ended.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -246,12 +246,12 @@ class IntervalSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -303,12 +303,12 @@ class DecompositionSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -341,7 +341,7 @@ class DecompositionSeriesData(ConfiguredBaseModel): None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""", ) - array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], np.number]] = Field( + array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], float]] = Field( None, json_schema_extra={ "linkml_meta": { @@ -377,7 +377,7 @@ class DecompositionSeriesBands(DynamicTable): } }, ) - band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field( + band_limits: NDArray[Shape["* num_bands, 2 low_high"], float] = Field( ..., description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""", json_schema_extra={ @@ -391,12 +391,12 @@ class DecompositionSeriesBands(DynamicTable): } }, ) - band_mean: NDArray[Shape["* num_bands"], np.float32] = Field( + band_mean: NDArray[Shape["* num_bands"], float] = Field( ..., description="""The mean Gaussian filters, in Hz.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_bands"}]}}}, ) - band_stdev: NDArray[Shape["* num_bands"], np.float32] = Field( + band_stdev: NDArray[Shape["* num_bands"], float] = Field( ..., description="""The standard deviation of Gaussian filters, in Hz.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_bands"}]}}}, @@ -445,7 +445,7 @@ class Units(DynamicTable): "linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}} }, ) - obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field( + obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], float]] = Field( None, description="""Observation intervals for each unit.""", json_schema_extra={ @@ -478,17 +478,17 @@ class Units(DynamicTable): ) waveform_mean: Optional[ Union[ - NDArray[Shape["* num_units, * num_samples"], np.float32], - NDArray[Shape["* num_units, * num_samples, * num_electrodes"], np.float32], + NDArray[Shape["* num_units, * num_samples"], float], + NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float], ] ] = Field(None, description="""Spike waveform mean for each spike unit.""") waveform_sd: Optional[ Union[ - NDArray[Shape["* num_units, * num_samples"], np.float32], - NDArray[Shape["* num_units, * num_samples, * num_electrodes"], np.float32], + NDArray[Shape["* num_units, * num_samples"], float], + NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float], ] ] = Field(None, description="""Spike waveform standard deviation for each spike unit.""") - waveforms: Optional[NDArray[Shape["* num_waveforms, * num_samples"], np.number]] = Field( + waveforms: Optional[NDArray[Shape["* num_waveforms, * num_samples"], float]] = Field( None, description="""Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same.""", json_schema_extra={ @@ -541,7 +541,7 @@ class UnitsSpikeTimes(VectorData): "linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"} }, ) - resolution: Optional[np.float64] = Field( + resolution: Optional[float] = Field( None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""", ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ogen.py index 46d16a7..4e0da1a 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ogen.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ogen.py @@ -77,8 +77,7 @@ class OptogeneticSeries(TimeSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_rois"], np.number], + NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times, * num_rois"], float] ] = Field( ..., description="""Applied power for optogenetic stimulus, in watts. Shape can be 1D or 2D. 2D data is meant to be used in an extension of OptogeneticSeries that defines what the second dimension represents.""", @@ -92,12 +91,12 @@ class OptogeneticSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -126,7 +125,7 @@ class OptogeneticStimulusSite(NWBContainer): name: str = Field(...) description: str = Field(..., description="""Description of stimulation site.""") - excitation_lambda: np.float32 = Field(..., description="""Excitation wavelength, in nm.""") + excitation_lambda: float = Field(..., description="""Excitation wavelength, in nm.""") location: str = Field( ..., description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""", diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ophys.py index bfd5c4e..789a327 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ophys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_ophys.py @@ -114,31 +114,28 @@ class OnePhotonSeries(ImageSeries): ) name: str = Field(...) - pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") - scan_line_rate: Optional[np.float32] = Field( + pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""") + scan_line_rate: Optional[float] = Field( None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) - exposure_time: Optional[np.float32] = Field( + exposure_time: Optional[float] = Field( None, description="""Exposure time of the sample; often the inverse of the frequency.""" ) - binning: Optional[np.uint8] = Field( + binning: Optional[int] = Field( None, description="""Amount of pixels combined into 'bins'; could be 1, 2, 4, 8, etc.""" ) - power: Optional[np.float32] = Field( - None, description="""Power of the excitation in mW, if known.""" - ) - intensity: Optional[np.float32] = Field( + power: Optional[float] = Field(None, description="""Power of the excitation in mW, if known.""") + intensity: Optional[float] = Field( None, description="""Intensity of the excitation in mW/mm^2, if known.""" ) data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], NDArray[Shape["* frame, * x, * y, * z"], float] ] = Field( ..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -160,12 +157,12 @@ class OnePhotonSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -193,25 +190,23 @@ class TwoPhotonSeries(ImageSeries): ) name: str = Field(...) - pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""") - scan_line_rate: Optional[np.float32] = Field( + pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""") + scan_line_rate: Optional[float] = Field( None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""", ) field_of_view: Optional[ Union[ - NDArray[Shape["2 width_height"], np.float32], - NDArray[Shape["3 width_height_depth"], np.float32], + NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height_depth"], float] ] ] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") data: Union[ - NDArray[Shape["* frame, * x, * y"], np.number], - NDArray[Shape["* frame, * x, * y, * z"], np.number], + NDArray[Shape["* frame, * x, * y"], float], NDArray[Shape["* frame, * x, * y, * z"], float] ] = Field( ..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""", ) - dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field( + dimension: Optional[NDArray[Shape["* rank"], int]] = Field( None, description="""Number of pixels on x, y, (and z) axes.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "rank"}]}}}, @@ -233,12 +228,12 @@ class TwoPhotonSeries(ImageSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -267,8 +262,7 @@ class RoiResponseSeries(TimeSeries): name: str = Field(...) data: Union[ - NDArray[Shape["* num_times"], np.number], - NDArray[Shape["* num_times, * num_rois"], np.number], + NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times, * num_rois"], float] ] = Field(..., description="""Signals from ROIs.""") rois: Named[DynamicTableRegion] = Field( ..., @@ -286,12 +280,12 @@ class RoiResponseSeries(TimeSeries): None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""", ) - timestamps: Optional[NDArray[Shape["* num_times"], np.float64]] = Field( + timestamps: Optional[NDArray[Shape["* num_times"], float]] = Field( None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, ) - control: Optional[NDArray[Shape["* num_times"], np.uint8]] = Field( + control: Optional[NDArray[Shape["* num_times"], int]] = Field( None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""", json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}, @@ -451,9 +445,9 @@ class PlaneSegmentationPixelMask(VectorData): "linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"} }, ) - x: Optional[np.uint32] = Field(None, description="""Pixel x-coordinate.""") - y: Optional[np.uint32] = Field(None, description="""Pixel y-coordinate.""") - weight: Optional[np.float32] = Field(None, description="""Weight of the pixel.""") + x: Optional[int] = Field(None, description="""Pixel x-coordinate.""") + y: Optional[int] = Field(None, description="""Pixel y-coordinate.""") + weight: Optional[float] = Field(None, description="""Weight of the pixel.""") description: Optional[str] = Field( None, description="""Description of what these vectors represent.""" ) @@ -480,10 +474,10 @@ class PlaneSegmentationVoxelMask(VectorData): "linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"} }, ) - x: Optional[np.uint32] = Field(None, description="""Voxel x-coordinate.""") - y: Optional[np.uint32] = Field(None, description="""Voxel y-coordinate.""") - z: Optional[np.uint32] = Field(None, description="""Voxel z-coordinate.""") - weight: Optional[np.float32] = Field(None, description="""Weight of the voxel.""") + x: Optional[int] = Field(None, description="""Voxel x-coordinate.""") + y: Optional[int] = Field(None, description="""Voxel y-coordinate.""") + z: Optional[int] = Field(None, description="""Voxel z-coordinate.""") + weight: Optional[float] = Field(None, description="""Weight of the voxel.""") description: Optional[str] = Field( None, description="""Description of what these vectors represent.""" ) @@ -523,9 +517,7 @@ class OpticalChannel(NWBContainer): name: str = Field(...) description: str = Field(..., description="""Description or other notes about the channel.""") - emission_lambda: np.float32 = Field( - ..., description="""Emission wavelength for channel, in nm.""" - ) + emission_lambda: float = Field(..., description="""Emission wavelength for channel, in nm.""") class MotionCorrection(NWBDataInterface): diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_retinotopy.py index f65ed6c..402cc40 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_retinotopy.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_7_0/core_nwb_retinotopy.py @@ -127,17 +127,15 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -161,17 +159,15 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -195,17 +191,15 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -229,17 +223,15 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): } }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") unit: Optional[str] = Field( None, description="""Unit that axis data is stored in (e.g., degrees).""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -263,24 +255,20 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): } }, ) - bits_per_pixel: Optional[np.int32] = Field( + bits_per_pixel: Optional[int] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""", ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) - focal_depth: Optional[np.float32] = Field( - None, description="""Focal depth offset, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") + focal_depth: Optional[float] = Field(None, description="""Focal depth offset, in meters.""") format: Optional[str] = Field( None, description="""Format of image. Right now only 'raw' is supported.""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -301,14 +289,12 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel): "linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"} }, ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field( + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") + array: Optional[NDArray[Shape["* num_rows, * num_cols"], float]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} @@ -332,21 +318,19 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): } }, ) - bits_per_pixel: Optional[np.int32] = Field( + bits_per_pixel: Optional[int] = Field( None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value""", ) - dimension: Optional[np.int32] = Field( + dimension: Optional[int] = Field( None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""", ) - field_of_view: Optional[np.float32] = Field( - None, description="""Size of viewing area, in meters.""" - ) + field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") format: Optional[str] = Field( None, description="""Format of image. Right now only 'raw' is supported.""" ) - array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field( + array: Optional[NDArray[Shape["* num_rows, * num_cols"], int]] = Field( None, json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}} diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/hdmf_common_table.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/hdmf_common_table.py index c6e8f35..b212cef 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/hdmf_common_table.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/hdmf_common_table.py @@ -66,7 +66,7 @@ class VectorDataMixin(BaseModel): else: return self.array[item] - def __setitem__(self, key, value) -> None: + def __setitem__(self, key: Union[int, str, slice], value: Any) -> None: if self._index: # Following hdmf, VectorIndex is the thing that knows how to do the slicing self._index[key] = value @@ -83,7 +83,7 @@ class VectorIndexMixin(BaseModel): array: Optional[NDArray] = None target: Optional["VectorData"] = None - def _getitem_helper(self, arg: int): + def _getitem_helper(self, arg: int) -> Union[list, NDArray]: """ Mimicking :func:`hdmf.common.table.VectorIndex.__getitem_helper` """ @@ -104,7 +104,7 @@ class VectorIndexMixin(BaseModel): else: raise NotImplementedError("DynamicTableRange not supported yet") - def __setitem__(self, key, value) -> None: + def __setitem__(self, key: Union[int, slice], value: Any) -> None: if self._index: # VectorIndex is the thing that knows how to do the slicing self._index[key] = value @@ -121,7 +121,7 @@ class DynamicTableMixin(BaseModel): """ model_config = ConfigDict(extra="allow") - __pydantic_extra__: Dict[str, Union[list, "NDArray", "VectorData"]] + __pydantic_extra__: Dict[str, Union[list, "NDArray", "VectorDataMixin"]] NON_COLUMN_FIELDS: ClassVar[tuple[str]] = ( "name", "colnames", @@ -132,15 +132,15 @@ class DynamicTableMixin(BaseModel): colnames: List[str] = Field(default_factory=list) @property - def _columns(self) -> Dict[str, Union[list, "NDArray", "VectorData"]]: + def _columns(self) -> Dict[str, Union[list, "NDArray", "VectorDataMixin"]]: return {k: getattr(self, k) for i, k in enumerate(self.colnames)} @property - def _columns_list(self) -> List[Union[list, "NDArray", "VectorData"]]: + def _columns_list(self) -> List[Union[list, "NDArray", "VectorDataMixin"]]: return [getattr(self, k) for i, k in enumerate(self.colnames)] @overload - def __getitem__(self, item: str) -> Union[list, "NDArray", "VectorData"]: ... + def __getitem__(self, item: str) -> Union[list, "NDArray", "VectorDataMixin"]: ... @overload def __getitem__(self, item: int) -> DataFrame: ... @@ -153,7 +153,7 @@ class DynamicTableMixin(BaseModel): DataFrame, list, "NDArray", - "VectorData", + "VectorDataMixin", ]: ... @overload @@ -231,7 +231,7 @@ class DynamicTableMixin(BaseModel): @model_validator(mode="before") @classmethod - def create_colnames(cls, model: Dict[str, Any]): + def create_colnames(cls, model: Dict[str, Any]) -> None: """ Construct colnames from arguments. @@ -240,19 +240,17 @@ class DynamicTableMixin(BaseModel): """ if "colnames" not in model: colnames = [ - k - for k in model.keys() - if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") + k for k in model if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") ] model["colnames"] = colnames else: # add any columns not explicitly given an order at the end colnames = [ k - for k in model.keys() + for k in model if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") - and k not in model["colnames"].keys() + and k not in model["colnames"] ] model["colnames"].extend(colnames) return model @@ -269,13 +267,11 @@ class DynamicTableMixin(BaseModel): for field_name in self.model_fields_set: # implicit name-based index field = getattr(self, field_name) - if isinstance(field, VectorIndex): - if field_name == f"{key}_index": - idx = field - break - elif field.target is col: - idx = field - break + if isinstance(field, VectorIndex) and ( + field_name == f"{key}_index" or field.target is col + ): + idx = field + break if idx is not None: col._index = idx idx.target = col diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/hdmf_common_table.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/hdmf_common_table.py index 44209ba..9d1bdb6 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/hdmf_common_table.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/hdmf_common_table.py @@ -66,7 +66,7 @@ class VectorDataMixin(BaseModel): else: return self.array[item] - def __setitem__(self, key, value) -> None: + def __setitem__(self, key: Union[int, str, slice], value: Any) -> None: if self._index: # Following hdmf, VectorIndex is the thing that knows how to do the slicing self._index[key] = value @@ -83,7 +83,7 @@ class VectorIndexMixin(BaseModel): array: Optional[NDArray] = None target: Optional["VectorData"] = None - def _getitem_helper(self, arg: int): + def _getitem_helper(self, arg: int) -> Union[list, NDArray]: """ Mimicking :func:`hdmf.common.table.VectorIndex.__getitem_helper` """ @@ -104,7 +104,7 @@ class VectorIndexMixin(BaseModel): else: raise NotImplementedError("DynamicTableRange not supported yet") - def __setitem__(self, key, value) -> None: + def __setitem__(self, key: Union[int, slice], value: Any) -> None: if self._index: # VectorIndex is the thing that knows how to do the slicing self._index[key] = value @@ -121,7 +121,7 @@ class DynamicTableMixin(BaseModel): """ model_config = ConfigDict(extra="allow") - __pydantic_extra__: Dict[str, Union[list, "NDArray", "VectorData"]] + __pydantic_extra__: Dict[str, Union[list, "NDArray", "VectorDataMixin"]] NON_COLUMN_FIELDS: ClassVar[tuple[str]] = ( "name", "colnames", @@ -132,15 +132,15 @@ class DynamicTableMixin(BaseModel): colnames: List[str] = Field(default_factory=list) @property - def _columns(self) -> Dict[str, Union[list, "NDArray", "VectorData"]]: + def _columns(self) -> Dict[str, Union[list, "NDArray", "VectorDataMixin"]]: return {k: getattr(self, k) for i, k in enumerate(self.colnames)} @property - def _columns_list(self) -> List[Union[list, "NDArray", "VectorData"]]: + def _columns_list(self) -> List[Union[list, "NDArray", "VectorDataMixin"]]: return [getattr(self, k) for i, k in enumerate(self.colnames)] @overload - def __getitem__(self, item: str) -> Union[list, "NDArray", "VectorData"]: ... + def __getitem__(self, item: str) -> Union[list, "NDArray", "VectorDataMixin"]: ... @overload def __getitem__(self, item: int) -> DataFrame: ... @@ -153,7 +153,7 @@ class DynamicTableMixin(BaseModel): DataFrame, list, "NDArray", - "VectorData", + "VectorDataMixin", ]: ... @overload @@ -231,7 +231,7 @@ class DynamicTableMixin(BaseModel): @model_validator(mode="before") @classmethod - def create_colnames(cls, model: Dict[str, Any]): + def create_colnames(cls, model: Dict[str, Any]) -> None: """ Construct colnames from arguments. @@ -240,19 +240,17 @@ class DynamicTableMixin(BaseModel): """ if "colnames" not in model: colnames = [ - k - for k in model.keys() - if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") + k for k in model if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") ] model["colnames"] = colnames else: # add any columns not explicitly given an order at the end colnames = [ k - for k in model.keys() + for k in model if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") - and k not in model["colnames"].keys() + and k not in model["colnames"] ] model["colnames"].extend(colnames) return model @@ -269,13 +267,11 @@ class DynamicTableMixin(BaseModel): for field_name in self.model_fields_set: # implicit name-based index field = getattr(self, field_name) - if isinstance(field, VectorIndex): - if field_name == f"{key}_index": - idx = field - break - elif field.target is col: - idx = field - break + if isinstance(field, VectorIndex) and ( + field_name == f"{key}_index" or field.target is col + ): + idx = field + break if idx is not None: col._index = idx idx.target = col diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/hdmf_common_table.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/hdmf_common_table.py index 703ff6c..dbca48c 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/hdmf_common_table.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/hdmf_common_table.py @@ -66,7 +66,7 @@ class VectorDataMixin(BaseModel): else: return self.array[item] - def __setitem__(self, key, value) -> None: + def __setitem__(self, key: Union[int, str, slice], value: Any) -> None: if self._index: # Following hdmf, VectorIndex is the thing that knows how to do the slicing self._index[key] = value @@ -83,7 +83,7 @@ class VectorIndexMixin(BaseModel): array: Optional[NDArray] = None target: Optional["VectorData"] = None - def _getitem_helper(self, arg: int): + def _getitem_helper(self, arg: int) -> Union[list, NDArray]: """ Mimicking :func:`hdmf.common.table.VectorIndex.__getitem_helper` """ @@ -104,7 +104,7 @@ class VectorIndexMixin(BaseModel): else: raise NotImplementedError("DynamicTableRange not supported yet") - def __setitem__(self, key, value) -> None: + def __setitem__(self, key: Union[int, slice], value: Any) -> None: if self._index: # VectorIndex is the thing that knows how to do the slicing self._index[key] = value @@ -121,7 +121,7 @@ class DynamicTableMixin(BaseModel): """ model_config = ConfigDict(extra="allow") - __pydantic_extra__: Dict[str, Union[list, "NDArray", "VectorData"]] + __pydantic_extra__: Dict[str, Union[list, "NDArray", "VectorDataMixin"]] NON_COLUMN_FIELDS: ClassVar[tuple[str]] = ( "name", "colnames", @@ -132,15 +132,15 @@ class DynamicTableMixin(BaseModel): colnames: List[str] = Field(default_factory=list) @property - def _columns(self) -> Dict[str, Union[list, "NDArray", "VectorData"]]: + def _columns(self) -> Dict[str, Union[list, "NDArray", "VectorDataMixin"]]: return {k: getattr(self, k) for i, k in enumerate(self.colnames)} @property - def _columns_list(self) -> List[Union[list, "NDArray", "VectorData"]]: + def _columns_list(self) -> List[Union[list, "NDArray", "VectorDataMixin"]]: return [getattr(self, k) for i, k in enumerate(self.colnames)] @overload - def __getitem__(self, item: str) -> Union[list, "NDArray", "VectorData"]: ... + def __getitem__(self, item: str) -> Union[list, "NDArray", "VectorDataMixin"]: ... @overload def __getitem__(self, item: int) -> DataFrame: ... @@ -153,7 +153,7 @@ class DynamicTableMixin(BaseModel): DataFrame, list, "NDArray", - "VectorData", + "VectorDataMixin", ]: ... @overload @@ -231,7 +231,7 @@ class DynamicTableMixin(BaseModel): @model_validator(mode="before") @classmethod - def create_colnames(cls, model: Dict[str, Any]): + def create_colnames(cls, model: Dict[str, Any]) -> None: """ Construct colnames from arguments. @@ -240,19 +240,17 @@ class DynamicTableMixin(BaseModel): """ if "colnames" not in model: colnames = [ - k - for k in model.keys() - if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") + k for k in model if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") ] model["colnames"] = colnames else: # add any columns not explicitly given an order at the end colnames = [ k - for k in model.keys() + for k in model if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") - and k not in model["colnames"].keys() + and k not in model["colnames"] ] model["colnames"].extend(colnames) return model @@ -269,13 +267,11 @@ class DynamicTableMixin(BaseModel): for field_name in self.model_fields_set: # implicit name-based index field = getattr(self, field_name) - if isinstance(field, VectorIndex): - if field_name == f"{key}_index": - idx = field - break - elif field.target is col: - idx = field - break + if isinstance(field, VectorIndex) and ( + field_name == f"{key}_index" or field.target is col + ): + idx = field + break if idx is not None: col._index = idx idx.target = col diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_0/__init__.py deleted file mode 100644 index 8b13789..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_0/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_0/hdmf_common_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_0/hdmf_common_base.py deleted file mode 100644 index 1d657d9..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_0/hdmf_common_base.py +++ /dev/null @@ -1,88 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np - -metamodel_version = "None" -version = "1.2.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.base/", - "id": "hdmf-common.base", - "imports": ["hdmf-common.nwb.language"], - "name": "hdmf-common.base", - } -) - - -class Data(ConfiguredBaseModel): - """ - An abstract data type for a dataset. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.base", "tree_root": True} - ) - - name: str = Field(...) - - -class Container(ConfiguredBaseModel): - """ - An abstract data type for a group storing collections of data and metadata. Base type for all data and metadata containers. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.base", "tree_root": True} - ) - - name: str = Field(...) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -Data.model_rebuild() -Container.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_0/hdmf_common_sparse.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_0/hdmf_common_sparse.py deleted file mode 100644 index 31afdb0..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_0/hdmf_common_sparse.py +++ /dev/null @@ -1,125 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np - -metamodel_version = "None" -version = "1.2.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.sparse/", - "id": "hdmf-common.sparse", - "imports": ["hdmf-common.nwb.language"], - "name": "hdmf-common.sparse", - } -) - - -class CSRMatrix(ConfiguredBaseModel): - """ - a compressed sparse row matrix - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.sparse", "tree_root": True} - ) - - name: str = Field(...) - shape: Optional[int] = Field(None, description="""the shape of this sparse matrix""") - indices: CSRMatrixIndices = Field(..., description="""column indices""") - indptr: CSRMatrixIndptr = Field(..., description="""index pointer""") - data: CSRMatrixData = Field(..., description="""values in the matrix""") - - -class CSRMatrixIndices(ConfiguredBaseModel): - """ - column indices - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) - - name: Literal["indices"] = Field( - "indices", - json_schema_extra={ - "linkml_meta": {"equals_string": "indices", "ifabsent": "string(indices)"} - }, - ) - - -class CSRMatrixIndptr(ConfiguredBaseModel): - """ - index pointer - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) - - name: Literal["indptr"] = Field( - "indptr", - json_schema_extra={ - "linkml_meta": {"equals_string": "indptr", "ifabsent": "string(indptr)"} - }, - ) - - -class CSRMatrixData(ConfiguredBaseModel): - """ - values in the matrix - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) - - name: Literal["data"] = Field( - "data", - json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, - ) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -CSRMatrix.model_rebuild() -CSRMatrixIndices.model_rebuild() -CSRMatrixIndptr.model_rebuild() -CSRMatrixData.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_0/hdmf_common_table.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_0/hdmf_common_table.py deleted file mode 100644 index 6ded400..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_0/hdmf_common_table.py +++ /dev/null @@ -1,449 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -import numpy as np -from ...hdmf_common.v1_2_0.hdmf_common_base import Data, Container -from pandas import DataFrame -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, overload, Tuple -from numpydantic import NDArray, Shape -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, model_validator - -metamodel_version = "None" -version = "1.2.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -NUMPYDANTIC_VERSION = "1.2.1" - - -class VectorDataMixin(BaseModel): - """ - Mixin class to give VectorData indexing abilities - """ - - _index: Optional["VectorIndex"] = None - - # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None - - def __getitem__(self, item: Union[str, int, slice, Tuple[Union[str, int, slice], ...]]) -> Any: - if self._index: - # Following hdmf, VectorIndex is the thing that knows how to do the slicing - return self._index[item] - else: - return self.array[item] - - def __setitem__(self, key, value) -> None: - if self._index: - # Following hdmf, VectorIndex is the thing that knows how to do the slicing - self._index[key] = value - else: - self.array[key] = value - - -class VectorIndexMixin(BaseModel): - """ - Mixin class to give VectorIndex indexing abilities - """ - - # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None - target: Optional["VectorData"] = None - - def _getitem_helper(self, arg: int): - """ - Mimicking :func:`hdmf.common.table.VectorIndex.__getitem_helper` - """ - - start = 0 if arg == 0 else self.array[arg - 1] - end = self.array[arg] - return self.target.array[slice(start, end)] - - def __getitem__(self, item: Union[int, slice]) -> Any: - if self.target is None: - return self.array[item] - elif type(self.target).__name__ == "VectorData": - if isinstance(item, int): - return self._getitem_helper(item) - else: - idx = range(*item.indices(len(self.array))) - return [self._getitem_helper(i) for i in idx] - else: - raise NotImplementedError("DynamicTableRange not supported yet") - - def __setitem__(self, key, value) -> None: - if self._index: - # VectorIndex is the thing that knows how to do the slicing - self._index[key] = value - else: - self.array[key] = value - - -class DynamicTableMixin(BaseModel): - """ - Mixin to make DynamicTable subclasses behave like tables/dataframes - - Mimicking some of the behavior from :class:`hdmf.common.table.DynamicTable` - but simplifying along the way :) - """ - - model_config = ConfigDict(extra="allow") - __pydantic_extra__: Dict[str, Union[list, "NDArray", "VectorData"]] - NON_COLUMN_FIELDS: ClassVar[tuple[str]] = ( - "name", - "colnames", - "description", - ) - - # overridden by subclass but implemented here for testing and typechecking purposes :) - colnames: List[str] = Field(default_factory=list) - - @property - def _columns(self) -> Dict[str, Union[list, "NDArray", "VectorData"]]: - return {k: getattr(self, k) for i, k in enumerate(self.colnames)} - - @property - def _columns_list(self) -> List[Union[list, "NDArray", "VectorData"]]: - return [getattr(self, k) for i, k in enumerate(self.colnames)] - - @overload - def __getitem__(self, item: str) -> Union[list, "NDArray", "VectorData"]: ... - - @overload - def __getitem__(self, item: int) -> DataFrame: ... - - @overload - def __getitem__(self, item: Tuple[int, Union[int, str]]) -> Any: ... - - @overload - def __getitem__(self, item: Tuple[Union[int, slice], ...]) -> Union[ - DataFrame, - list, - "NDArray", - "VectorData", - ]: ... - - @overload - def __getitem__(self, item: slice) -> DataFrame: ... - - def __getitem__( - self, - item: Union[ - str, - int, - slice, - Tuple[int, Union[int, str]], - Tuple[Union[int, slice], ...], - ], - ) -> Any: - """ - Get an item from the table - - If item is... - - - ``str`` : get the column with this name - - ``int`` : get the row at this index - - ``tuple[int, int]`` : get a specific cell value eg. (0,1) gets the 0th row and 1st column - - ``tuple[int, str]`` : get a specific cell value eg. (0, 'colname') - gets the 0th row from ``colname`` - - ``tuple[int | slice, int | slice]`` : get a range of cells from a range of columns. - returns as a :class:`pandas.DataFrame` - """ - if isinstance(item, str): - return self._columns[item] - if isinstance(item, (int, slice)): - return DataFrame.from_dict(self._slice_range(item)) - elif isinstance(item, tuple): - if len(item) != 2: - raise ValueError( - "DynamicTables are 2-dimensional, can't index with more than 2 indices like" - f" {item}" - ) - - # all other cases are tuples of (rows, cols) - rows, cols = item - if isinstance(cols, (int, slice)): - cols = self.colnames[cols] - data = self._slice_range(rows, cols) - return DataFrame.from_dict(data) - else: - raise ValueError(f"Unsure how to get item with key {item}") - - def _slice_range( - self, rows: Union[int, slice], cols: Optional[Union[str, List[str]]] = None - ) -> Dict[str, Union[list, "NDArray", "VectorData"]]: - if cols is None: - cols = self.colnames - elif isinstance(cols, str): - cols = [cols] - - data = {k: self._columns[k][rows] for k in cols} - return data - - def __setitem__(self, key: str, value: Any) -> None: - raise NotImplementedError("TODO") - - def __setattr__(self, key: str, value: Union[list, "NDArray", "VectorData"]): - """ - Add a column, appending it to ``colnames`` - """ - # don't use this while building the model - if not getattr(self, "__pydantic_complete__", False): - return super().__setattr__(key, value) - - if key not in self.model_fields_set and not key.endswith("_index"): - self.colnames.append(key) - - return super().__setattr__(key, value) - - @model_validator(mode="before") - @classmethod - def create_colnames(cls, model: Dict[str, Any]): - """ - Construct colnames from arguments. - - the model dict is ordered after python3.6, so we can use that minus - anything in :attr:`.NON_COLUMN_FIELDS` to determine order implied from passage order - """ - if "colnames" not in model: - colnames = [ - k - for k in model.keys() - if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") - ] - model["colnames"] = colnames - else: - # add any columns not explicitly given an order at the end - colnames = [ - k - for k in model.keys() - if k not in cls.NON_COLUMN_FIELDS - and not k.endswith("_index") - and k not in model["colnames"].keys() - ] - model["colnames"].extend(colnames) - return model - - @model_validator(mode="after") - def resolve_targets(self) -> "DynamicTableMixin": - """ - Ensure that any implicitly indexed columns are linked, and create backlinks - """ - for key, col in self._columns.items(): - if isinstance(col, VectorData): - # find an index - idx = None - for field_name in self.model_fields_set: - # implicit name-based index - field = getattr(self, field_name) - if isinstance(field, VectorIndex): - if field_name == f"{key}_index": - idx = field - break - elif field.target is col: - idx = field - break - if idx is not None: - col._index = idx - idx.target = col - return self - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.table/", - "id": "hdmf-common.table", - "imports": ["hdmf-common.base", "hdmf-common.nwb.language"], - "name": "hdmf-common.table", - } -) - - -class VectorData(VectorDataMixin): - """ - An n-dimensional dataset representing a column of a DynamicTable. If used without an accompanying VectorIndex, first dimension is along the rows of the DynamicTable and each step along the first dimension is a cell of the larger table. VectorData can also be used to represent a ragged array if paired with a VectorIndex. This allows for storing arrays of varying length in a single cell of the DynamicTable by indexing into this VectorData. The first vector is at VectorData[0:VectorIndex[0]]. The second vector is at VectorData[VectorIndex[0]:VectorIndex[1]], and so on. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - description: Optional[str] = Field( - None, description="""Description of what these vectors represent.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class VectorIndex(VectorIndexMixin): - """ - Used with VectorData to encode a ragged array. An array of indices into the first dimension of the target VectorData, and forming a map between the rows of a DynamicTable and the indices of the VectorData. The name of the VectorIndex is expected to be the name of the target VectorData object followed by \"_index\". - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - target: Optional[VectorData] = Field( - None, description="""Reference to the target dataset that this index applies to.""" - ) - description: Optional[str] = Field( - None, description="""Description of what these vectors represent.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class ElementIdentifiers(Data): - """ - A list of unique identifiers for values within a dataset, e.g. rows of a DynamicTable. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field( - "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} - ) - - -class DynamicTableRegion(VectorData): - """ - DynamicTableRegion provides a link from one table to an index or region of another. The `table` attribute is a link to another `DynamicTable`, indicating which table is referenced, and the data is int(s) indicating the row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to associate rows with repeated meta-data without data duplication. They can also be used to create hierarchical relationships between multiple `DynamicTable`s. `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create ragged references, so a single cell of a `DynamicTable` can reference many rows of another `DynamicTable`. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - table: Optional[DynamicTable] = Field( - None, description="""Reference to the DynamicTable object that this region applies to.""" - ) - description: Optional[str] = Field( - None, description="""Description of what this table region points to.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class VocabData(VectorData): - """ - Data that come from a controlled vocabulary of text values. A data value of i corresponds to the i-th element in the 'vocabulary' array attribute. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - vocabulary: Optional[str] = Field( - None, description="""The available items in the controlled vocabulary.""" - ) - description: Optional[str] = Field( - None, description="""Description of what these vectors represent.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class DynamicTable(DynamicTableMixin): - """ - A group containing multiple datasets that are aligned on the first dimension (Currently, this requirement if left up to APIs to check and enforce). These datasets represent different columns in the table. Apart from a column that contains unique identifiers for each row, there are no other required datasets. Users are free to add any number of custom VectorData objects (columns) here. DynamicTable also supports ragged array columns, where each element can be of a different size. To add a ragged array column, use a VectorIndex type to index the corresponding VectorData type. See documentation for VectorData and VectorIndex for more details. Unlike a compound data type, which is analogous to storing an array-of-structs, a DynamicTable can be thought of as a struct-of-arrays. This provides an alternative structure to choose from when optimizing storage for anticipated access patterns. Additionally, this type provides a way of creating a table without having to define a compound type up front. Although this convenience may be attractive, users should think carefully about how data will be accessed. DynamicTable is more appropriate for column-centric access, whereas a dataset with a compound type would be more appropriate for row-centric access. Finally, data size should also be taken into account. For small tables, performance loss may be an acceptable trade-off for the flexibility of a DynamicTable. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - colnames: Optional[str] = Field( - None, - description="""The names of the columns in this table. This should be used to specify an order to the columns.""", - ) - description: Optional[str] = Field( - None, description="""Description of what is in this dynamic table.""" - ) - id: NDArray[Shape["* num_rows"], int] = Field( - ..., - description="""Array of unique identifiers for the rows of this dynamic table.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, - ) - vector_data: Optional[List[VectorData]] = Field( - None, description="""Vector columns, including index columns, of this dynamic table.""" - ) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -VectorData.model_rebuild() -VectorIndex.model_rebuild() -ElementIdentifiers.model_rebuild() -DynamicTableRegion.model_rebuild() -VocabData.model_rebuild() -DynamicTable.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_0/namespace.py deleted file mode 100644 index 62d22cb..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_0/namespace.py +++ /dev/null @@ -1,83 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_common.v1_2_0.hdmf_common_sparse import ( - CSRMatrix, - CSRMatrixIndices, - CSRMatrixIndptr, - CSRMatrixData, -) -from ...hdmf_common.v1_2_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - VocabData, - DynamicTable, -) -from ...hdmf_common.v1_2_0.hdmf_common_base import Data, Container - -metamodel_version = "None" -version = "1.2.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": True}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common/", - "description": "Common data structures provided by HDMF", - "id": "hdmf-common", - "imports": [ - "hdmf-common.base", - "hdmf-common.table", - "hdmf-common.sparse", - "hdmf-common.nwb.language", - ], - "name": "hdmf-common", - } -) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_1/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_1/__init__.py deleted file mode 100644 index 8b13789..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_1/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_1/hdmf_common_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_1/hdmf_common_base.py deleted file mode 100644 index c891ed8..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_1/hdmf_common_base.py +++ /dev/null @@ -1,104 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np - -metamodel_version = "None" -version = "1.2.1" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.base/", - "id": "hdmf-common.base", - "imports": ["hdmf-common.nwb.language"], - "name": "hdmf-common.base", - } -) - - -class Data(ConfiguredBaseModel): - """ - An abstract data type for a dataset. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.base", "tree_root": True} - ) - - name: str = Field(...) - - -class Container(ConfiguredBaseModel): - """ - An abstract data type for a group storing collections of data and metadata. Base type for all data and metadata containers. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.base", "tree_root": True} - ) - - name: str = Field(...) - - -class SimpleMultiContainer(Container): - """ - A simple Container for holding onto multiple containers - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.base", "tree_root": True} - ) - - children: Optional[List[Container]] = Field( - None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "Container"}]}} - ) - name: str = Field(...) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -Data.model_rebuild() -Container.model_rebuild() -SimpleMultiContainer.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_1/hdmf_common_sparse.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_1/hdmf_common_sparse.py deleted file mode 100644 index 9e2e7ce..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_1/hdmf_common_sparse.py +++ /dev/null @@ -1,126 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_common.v1_2_1.hdmf_common_base import Container - -metamodel_version = "None" -version = "1.2.1" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.sparse/", - "id": "hdmf-common.sparse", - "imports": ["hdmf-common.base", "hdmf-common.nwb.language"], - "name": "hdmf-common.sparse", - } -) - - -class CSRMatrix(Container): - """ - a compressed sparse row matrix - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.sparse", "tree_root": True} - ) - - name: str = Field(...) - shape: Optional[int] = Field(None, description="""the shape of this sparse matrix""") - indices: CSRMatrixIndices = Field(..., description="""column indices""") - indptr: CSRMatrixIndptr = Field(..., description="""index pointer""") - data: CSRMatrixData = Field(..., description="""values in the matrix""") - - -class CSRMatrixIndices(ConfiguredBaseModel): - """ - column indices - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) - - name: Literal["indices"] = Field( - "indices", - json_schema_extra={ - "linkml_meta": {"equals_string": "indices", "ifabsent": "string(indices)"} - }, - ) - - -class CSRMatrixIndptr(ConfiguredBaseModel): - """ - index pointer - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) - - name: Literal["indptr"] = Field( - "indptr", - json_schema_extra={ - "linkml_meta": {"equals_string": "indptr", "ifabsent": "string(indptr)"} - }, - ) - - -class CSRMatrixData(ConfiguredBaseModel): - """ - values in the matrix - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) - - name: Literal["data"] = Field( - "data", - json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, - ) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -CSRMatrix.model_rebuild() -CSRMatrixIndices.model_rebuild() -CSRMatrixIndptr.model_rebuild() -CSRMatrixData.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_1/hdmf_common_table.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_1/hdmf_common_table.py deleted file mode 100644 index fd4377f..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_1/hdmf_common_table.py +++ /dev/null @@ -1,449 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -import numpy as np -from ...hdmf_common.v1_2_1.hdmf_common_base import Data, Container -from pandas import DataFrame -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, overload, Tuple -from numpydantic import NDArray, Shape -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, model_validator - -metamodel_version = "None" -version = "1.2.1" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -NUMPYDANTIC_VERSION = "1.2.1" - - -class VectorDataMixin(BaseModel): - """ - Mixin class to give VectorData indexing abilities - """ - - _index: Optional["VectorIndex"] = None - - # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None - - def __getitem__(self, item: Union[str, int, slice, Tuple[Union[str, int, slice], ...]]) -> Any: - if self._index: - # Following hdmf, VectorIndex is the thing that knows how to do the slicing - return self._index[item] - else: - return self.array[item] - - def __setitem__(self, key, value) -> None: - if self._index: - # Following hdmf, VectorIndex is the thing that knows how to do the slicing - self._index[key] = value - else: - self.array[key] = value - - -class VectorIndexMixin(BaseModel): - """ - Mixin class to give VectorIndex indexing abilities - """ - - # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None - target: Optional["VectorData"] = None - - def _getitem_helper(self, arg: int): - """ - Mimicking :func:`hdmf.common.table.VectorIndex.__getitem_helper` - """ - - start = 0 if arg == 0 else self.array[arg - 1] - end = self.array[arg] - return self.target.array[slice(start, end)] - - def __getitem__(self, item: Union[int, slice]) -> Any: - if self.target is None: - return self.array[item] - elif type(self.target).__name__ == "VectorData": - if isinstance(item, int): - return self._getitem_helper(item) - else: - idx = range(*item.indices(len(self.array))) - return [self._getitem_helper(i) for i in idx] - else: - raise NotImplementedError("DynamicTableRange not supported yet") - - def __setitem__(self, key, value) -> None: - if self._index: - # VectorIndex is the thing that knows how to do the slicing - self._index[key] = value - else: - self.array[key] = value - - -class DynamicTableMixin(BaseModel): - """ - Mixin to make DynamicTable subclasses behave like tables/dataframes - - Mimicking some of the behavior from :class:`hdmf.common.table.DynamicTable` - but simplifying along the way :) - """ - - model_config = ConfigDict(extra="allow") - __pydantic_extra__: Dict[str, Union[list, "NDArray", "VectorData"]] - NON_COLUMN_FIELDS: ClassVar[tuple[str]] = ( - "name", - "colnames", - "description", - ) - - # overridden by subclass but implemented here for testing and typechecking purposes :) - colnames: List[str] = Field(default_factory=list) - - @property - def _columns(self) -> Dict[str, Union[list, "NDArray", "VectorData"]]: - return {k: getattr(self, k) for i, k in enumerate(self.colnames)} - - @property - def _columns_list(self) -> List[Union[list, "NDArray", "VectorData"]]: - return [getattr(self, k) for i, k in enumerate(self.colnames)] - - @overload - def __getitem__(self, item: str) -> Union[list, "NDArray", "VectorData"]: ... - - @overload - def __getitem__(self, item: int) -> DataFrame: ... - - @overload - def __getitem__(self, item: Tuple[int, Union[int, str]]) -> Any: ... - - @overload - def __getitem__(self, item: Tuple[Union[int, slice], ...]) -> Union[ - DataFrame, - list, - "NDArray", - "VectorData", - ]: ... - - @overload - def __getitem__(self, item: slice) -> DataFrame: ... - - def __getitem__( - self, - item: Union[ - str, - int, - slice, - Tuple[int, Union[int, str]], - Tuple[Union[int, slice], ...], - ], - ) -> Any: - """ - Get an item from the table - - If item is... - - - ``str`` : get the column with this name - - ``int`` : get the row at this index - - ``tuple[int, int]`` : get a specific cell value eg. (0,1) gets the 0th row and 1st column - - ``tuple[int, str]`` : get a specific cell value eg. (0, 'colname') - gets the 0th row from ``colname`` - - ``tuple[int | slice, int | slice]`` : get a range of cells from a range of columns. - returns as a :class:`pandas.DataFrame` - """ - if isinstance(item, str): - return self._columns[item] - if isinstance(item, (int, slice)): - return DataFrame.from_dict(self._slice_range(item)) - elif isinstance(item, tuple): - if len(item) != 2: - raise ValueError( - "DynamicTables are 2-dimensional, can't index with more than 2 indices like" - f" {item}" - ) - - # all other cases are tuples of (rows, cols) - rows, cols = item - if isinstance(cols, (int, slice)): - cols = self.colnames[cols] - data = self._slice_range(rows, cols) - return DataFrame.from_dict(data) - else: - raise ValueError(f"Unsure how to get item with key {item}") - - def _slice_range( - self, rows: Union[int, slice], cols: Optional[Union[str, List[str]]] = None - ) -> Dict[str, Union[list, "NDArray", "VectorData"]]: - if cols is None: - cols = self.colnames - elif isinstance(cols, str): - cols = [cols] - - data = {k: self._columns[k][rows] for k in cols} - return data - - def __setitem__(self, key: str, value: Any) -> None: - raise NotImplementedError("TODO") - - def __setattr__(self, key: str, value: Union[list, "NDArray", "VectorData"]): - """ - Add a column, appending it to ``colnames`` - """ - # don't use this while building the model - if not getattr(self, "__pydantic_complete__", False): - return super().__setattr__(key, value) - - if key not in self.model_fields_set and not key.endswith("_index"): - self.colnames.append(key) - - return super().__setattr__(key, value) - - @model_validator(mode="before") - @classmethod - def create_colnames(cls, model: Dict[str, Any]): - """ - Construct colnames from arguments. - - the model dict is ordered after python3.6, so we can use that minus - anything in :attr:`.NON_COLUMN_FIELDS` to determine order implied from passage order - """ - if "colnames" not in model: - colnames = [ - k - for k in model.keys() - if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") - ] - model["colnames"] = colnames - else: - # add any columns not explicitly given an order at the end - colnames = [ - k - for k in model.keys() - if k not in cls.NON_COLUMN_FIELDS - and not k.endswith("_index") - and k not in model["colnames"].keys() - ] - model["colnames"].extend(colnames) - return model - - @model_validator(mode="after") - def resolve_targets(self) -> "DynamicTableMixin": - """ - Ensure that any implicitly indexed columns are linked, and create backlinks - """ - for key, col in self._columns.items(): - if isinstance(col, VectorData): - # find an index - idx = None - for field_name in self.model_fields_set: - # implicit name-based index - field = getattr(self, field_name) - if isinstance(field, VectorIndex): - if field_name == f"{key}_index": - idx = field - break - elif field.target is col: - idx = field - break - if idx is not None: - col._index = idx - idx.target = col - return self - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.table/", - "id": "hdmf-common.table", - "imports": ["hdmf-common.base", "hdmf-common.nwb.language"], - "name": "hdmf-common.table", - } -) - - -class VectorData(VectorDataMixin): - """ - An n-dimensional dataset representing a column of a DynamicTable. If used without an accompanying VectorIndex, first dimension is along the rows of the DynamicTable and each step along the first dimension is a cell of the larger table. VectorData can also be used to represent a ragged array if paired with a VectorIndex. This allows for storing arrays of varying length in a single cell of the DynamicTable by indexing into this VectorData. The first vector is at VectorData[0:VectorIndex[0]]. The second vector is at VectorData[VectorIndex[0]:VectorIndex[1]], and so on. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - description: Optional[str] = Field( - None, description="""Description of what these vectors represent.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class VectorIndex(VectorIndexMixin): - """ - Used with VectorData to encode a ragged array. An array of indices into the first dimension of the target VectorData, and forming a map between the rows of a DynamicTable and the indices of the VectorData. The name of the VectorIndex is expected to be the name of the target VectorData object followed by \"_index\". - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - target: Optional[VectorData] = Field( - None, description="""Reference to the target dataset that this index applies to.""" - ) - description: Optional[str] = Field( - None, description="""Description of what these vectors represent.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class ElementIdentifiers(Data): - """ - A list of unique identifiers for values within a dataset, e.g. rows of a DynamicTable. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field( - "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} - ) - - -class DynamicTableRegion(VectorData): - """ - DynamicTableRegion provides a link from one table to an index or region of another. The `table` attribute is a link to another `DynamicTable`, indicating which table is referenced, and the data is int(s) indicating the row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to associate rows with repeated meta-data without data duplication. They can also be used to create hierarchical relationships between multiple `DynamicTable`s. `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create ragged references, so a single cell of a `DynamicTable` can reference many rows of another `DynamicTable`. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - table: Optional[DynamicTable] = Field( - None, description="""Reference to the DynamicTable object that this region applies to.""" - ) - description: Optional[str] = Field( - None, description="""Description of what this table region points to.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class VocabData(VectorData): - """ - Data that come from a controlled vocabulary of text values. A data value of i corresponds to the i-th element in the 'vocabulary' array attribute. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - vocabulary: Optional[str] = Field( - None, description="""The available items in the controlled vocabulary.""" - ) - description: Optional[str] = Field( - None, description="""Description of what these vectors represent.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class DynamicTable(DynamicTableMixin): - """ - A group containing multiple datasets that are aligned on the first dimension (Currently, this requirement if left up to APIs to check and enforce). These datasets represent different columns in the table. Apart from a column that contains unique identifiers for each row, there are no other required datasets. Users are free to add any number of custom VectorData objects (columns) here. DynamicTable also supports ragged array columns, where each element can be of a different size. To add a ragged array column, use a VectorIndex type to index the corresponding VectorData type. See documentation for VectorData and VectorIndex for more details. Unlike a compound data type, which is analogous to storing an array-of-structs, a DynamicTable can be thought of as a struct-of-arrays. This provides an alternative structure to choose from when optimizing storage for anticipated access patterns. Additionally, this type provides a way of creating a table without having to define a compound type up front. Although this convenience may be attractive, users should think carefully about how data will be accessed. DynamicTable is more appropriate for column-centric access, whereas a dataset with a compound type would be more appropriate for row-centric access. Finally, data size should also be taken into account. For small tables, performance loss may be an acceptable trade-off for the flexibility of a DynamicTable. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - colnames: Optional[str] = Field( - None, - description="""The names of the columns in this table. This should be used to specify an order to the columns.""", - ) - description: Optional[str] = Field( - None, description="""Description of what is in this dynamic table.""" - ) - id: NDArray[Shape["* num_rows"], int] = Field( - ..., - description="""Array of unique identifiers for the rows of this dynamic table.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, - ) - vector_data: Optional[List[VectorData]] = Field( - None, description="""Vector columns, including index columns, of this dynamic table.""" - ) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -VectorData.model_rebuild() -VectorIndex.model_rebuild() -ElementIdentifiers.model_rebuild() -DynamicTableRegion.model_rebuild() -VocabData.model_rebuild() -DynamicTable.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_1/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_1/namespace.py deleted file mode 100644 index 55f5dc6..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_2_1/namespace.py +++ /dev/null @@ -1,83 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_common.v1_2_1.hdmf_common_sparse import ( - CSRMatrix, - CSRMatrixIndices, - CSRMatrixIndptr, - CSRMatrixData, -) -from ...hdmf_common.v1_2_1.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_2_1.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - VocabData, - DynamicTable, -) - -metamodel_version = "None" -version = "1.2.1" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": True}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common/", - "description": "Common data structures provided by HDMF", - "id": "hdmf-common", - "imports": [ - "hdmf-common.base", - "hdmf-common.table", - "hdmf-common.sparse", - "hdmf-common.nwb.language", - ], - "name": "hdmf-common", - } -) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_3_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_3_0/__init__.py deleted file mode 100644 index 8b13789..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_3_0/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_3_0/hdmf_common_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_3_0/hdmf_common_base.py deleted file mode 100644 index 63bbcf2..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_3_0/hdmf_common_base.py +++ /dev/null @@ -1,104 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np - -metamodel_version = "None" -version = "1.3.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.base/", - "id": "hdmf-common.base", - "imports": ["hdmf-common.nwb.language"], - "name": "hdmf-common.base", - } -) - - -class Data(ConfiguredBaseModel): - """ - An abstract data type for a dataset. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.base", "tree_root": True} - ) - - name: str = Field(...) - - -class Container(ConfiguredBaseModel): - """ - An abstract data type for a group storing collections of data and metadata. Base type for all data and metadata containers. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.base", "tree_root": True} - ) - - name: str = Field(...) - - -class SimpleMultiContainer(Container): - """ - A simple Container for holding onto multiple containers. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.base", "tree_root": True} - ) - - children: Optional[List[Container]] = Field( - None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "Container"}]}} - ) - name: str = Field(...) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -Data.model_rebuild() -Container.model_rebuild() -SimpleMultiContainer.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_3_0/hdmf_common_resources.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_3_0/hdmf_common_resources.py deleted file mode 100644 index 81f3031..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_3_0/hdmf_common_resources.py +++ /dev/null @@ -1,181 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_common.v1_3_0.hdmf_common_base import Container, Data - -metamodel_version = "None" -version = "1.3.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.resources/", - "id": "hdmf-common.resources", - "imports": ["hdmf-common.base", "hdmf-common.nwb.language"], - "name": "hdmf-common.resources", - } -) - - -class ExternalResources(Container): - """ - A set of four tables for tracking external resource references in a file. NOTE: this data type is in beta testing and is subject to change in a later version. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.resources", "tree_root": True} - ) - - name: str = Field(...) - keys: ExternalResourcesKeys = Field( - ..., - description="""A table for storing user terms that are used to refer to external resources.""", - ) - resources: ExternalResourcesResources = Field( - ..., description="""A table for mapping user terms (i.e., keys) to resource entities.""" - ) - objects: ExternalResourcesObjects = Field( - ..., - description="""A table for identifying which objects in a file contain references to external resources.""", - ) - object_keys: ExternalResourcesObjectKeys = Field( - ..., description="""A table for identifying which objects use which keys.""" - ) - - -class ExternalResourcesKeys(Data): - """ - A table for storing user terms that are used to refer to external resources. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.resources"}) - - name: Literal["keys"] = Field( - "keys", - json_schema_extra={"linkml_meta": {"equals_string": "keys", "ifabsent": "string(keys)"}}, - ) - key_name: str = Field( - ..., - description="""The user term that maps to one or more resources in the 'resources' table.""", - ) - - -class ExternalResourcesResources(Data): - """ - A table for mapping user terms (i.e., keys) to resource entities. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.resources"}) - - name: Literal["resources"] = Field( - "resources", - json_schema_extra={ - "linkml_meta": {"equals_string": "resources", "ifabsent": "string(resources)"} - }, - ) - keytable_idx: np.uint64 = Field( - ..., description="""The index to the key in the 'keys' table.""" - ) - resource_name: str = Field( - ..., - description="""The name of the online resource (e.g., website, database) that has the entity.""", - ) - resource_id: str = Field( - ..., description="""The unique identifier for the resource entity at the resource.""" - ) - uri: str = Field( - ..., - description="""The URI for the resource entity this reference applies to. This can be an empty string.""", - ) - - -class ExternalResourcesObjects(Data): - """ - A table for identifying which objects in a file contain references to external resources. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.resources"}) - - name: Literal["objects"] = Field( - "objects", - json_schema_extra={ - "linkml_meta": {"equals_string": "objects", "ifabsent": "string(objects)"} - }, - ) - object_id: str = Field(..., description="""The UUID for the object.""") - field: str = Field( - ..., - description="""The field of the object. This can be an empty string if the object is a dataset and the field is the dataset values.""", - ) - - -class ExternalResourcesObjectKeys(Data): - """ - A table for identifying which objects use which keys. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.resources"}) - - name: Literal["object_keys"] = Field( - "object_keys", - json_schema_extra={ - "linkml_meta": {"equals_string": "object_keys", "ifabsent": "string(object_keys)"} - }, - ) - objecttable_idx: np.uint64 = Field( - ..., description="""The index to the 'objects' table for the object that holds the key.""" - ) - keytable_idx: np.uint64 = Field( - ..., description="""The index to the 'keys' table for the key.""" - ) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -ExternalResources.model_rebuild() -ExternalResourcesKeys.model_rebuild() -ExternalResourcesResources.model_rebuild() -ExternalResourcesObjects.model_rebuild() -ExternalResourcesObjectKeys.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_3_0/hdmf_common_sparse.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_3_0/hdmf_common_sparse.py deleted file mode 100644 index fe3047c..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_3_0/hdmf_common_sparse.py +++ /dev/null @@ -1,110 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_common.v1_3_0.hdmf_common_base import Container -from numpydantic import NDArray, Shape - -metamodel_version = "None" -version = "1.3.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -NUMPYDANTIC_VERSION = "1.2.1" -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.sparse/", - "id": "hdmf-common.sparse", - "imports": ["hdmf-common.base", "hdmf-common.nwb.language"], - "name": "hdmf-common.sparse", - } -) - - -class CSRMatrix(Container): - """ - A compressed sparse row matrix. Data are stored in the standard CSR format, where column indices for row i are stored in indices[indptr[i]:indptr[i+1]] and their corresponding values are stored in data[indptr[i]:indptr[i+1]]. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.sparse", "tree_root": True} - ) - - name: str = Field(...) - shape: Optional[np.uint64] = Field( - None, description="""The shape (number of rows, number of columns) of this sparse matrix.""" - ) - indices: NDArray[Shape["* number_of_non_zero_values"], np.uint64] = Field( - ..., - description="""The column indices.""", - json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "number_of_non_zero_values"}]}} - }, - ) - indptr: NDArray[Shape["* number_of_rows_in_the_matrix_1"], np.uint64] = Field( - ..., - description="""The row index pointer.""", - json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "number_of_rows_in_the_matrix_1"}]}} - }, - ) - data: CSRMatrixData = Field(..., description="""The non-zero values in the matrix.""") - - -class CSRMatrixData(ConfiguredBaseModel): - """ - The non-zero values in the matrix. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) - - name: Literal["data"] = Field( - "data", - json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, - ) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -CSRMatrix.model_rebuild() -CSRMatrixData.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_3_0/hdmf_common_table.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_3_0/hdmf_common_table.py deleted file mode 100644 index 7f3f848..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_3_0/hdmf_common_table.py +++ /dev/null @@ -1,449 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -import numpy as np -from ...hdmf_common.v1_3_0.hdmf_common_base import Data, Container -from pandas import DataFrame -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, overload, Tuple -from numpydantic import NDArray, Shape -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, model_validator - -metamodel_version = "None" -version = "1.3.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -NUMPYDANTIC_VERSION = "1.2.1" - - -class VectorDataMixin(BaseModel): - """ - Mixin class to give VectorData indexing abilities - """ - - _index: Optional["VectorIndex"] = None - - # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None - - def __getitem__(self, item: Union[str, int, slice, Tuple[Union[str, int, slice], ...]]) -> Any: - if self._index: - # Following hdmf, VectorIndex is the thing that knows how to do the slicing - return self._index[item] - else: - return self.array[item] - - def __setitem__(self, key, value) -> None: - if self._index: - # Following hdmf, VectorIndex is the thing that knows how to do the slicing - self._index[key] = value - else: - self.array[key] = value - - -class VectorIndexMixin(BaseModel): - """ - Mixin class to give VectorIndex indexing abilities - """ - - # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None - target: Optional["VectorData"] = None - - def _getitem_helper(self, arg: int): - """ - Mimicking :func:`hdmf.common.table.VectorIndex.__getitem_helper` - """ - - start = 0 if arg == 0 else self.array[arg - 1] - end = self.array[arg] - return self.target.array[slice(start, end)] - - def __getitem__(self, item: Union[int, slice]) -> Any: - if self.target is None: - return self.array[item] - elif type(self.target).__name__ == "VectorData": - if isinstance(item, int): - return self._getitem_helper(item) - else: - idx = range(*item.indices(len(self.array))) - return [self._getitem_helper(i) for i in idx] - else: - raise NotImplementedError("DynamicTableRange not supported yet") - - def __setitem__(self, key, value) -> None: - if self._index: - # VectorIndex is the thing that knows how to do the slicing - self._index[key] = value - else: - self.array[key] = value - - -class DynamicTableMixin(BaseModel): - """ - Mixin to make DynamicTable subclasses behave like tables/dataframes - - Mimicking some of the behavior from :class:`hdmf.common.table.DynamicTable` - but simplifying along the way :) - """ - - model_config = ConfigDict(extra="allow") - __pydantic_extra__: Dict[str, Union[list, "NDArray", "VectorData"]] - NON_COLUMN_FIELDS: ClassVar[tuple[str]] = ( - "name", - "colnames", - "description", - ) - - # overridden by subclass but implemented here for testing and typechecking purposes :) - colnames: List[str] = Field(default_factory=list) - - @property - def _columns(self) -> Dict[str, Union[list, "NDArray", "VectorData"]]: - return {k: getattr(self, k) for i, k in enumerate(self.colnames)} - - @property - def _columns_list(self) -> List[Union[list, "NDArray", "VectorData"]]: - return [getattr(self, k) for i, k in enumerate(self.colnames)] - - @overload - def __getitem__(self, item: str) -> Union[list, "NDArray", "VectorData"]: ... - - @overload - def __getitem__(self, item: int) -> DataFrame: ... - - @overload - def __getitem__(self, item: Tuple[int, Union[int, str]]) -> Any: ... - - @overload - def __getitem__(self, item: Tuple[Union[int, slice], ...]) -> Union[ - DataFrame, - list, - "NDArray", - "VectorData", - ]: ... - - @overload - def __getitem__(self, item: slice) -> DataFrame: ... - - def __getitem__( - self, - item: Union[ - str, - int, - slice, - Tuple[int, Union[int, str]], - Tuple[Union[int, slice], ...], - ], - ) -> Any: - """ - Get an item from the table - - If item is... - - - ``str`` : get the column with this name - - ``int`` : get the row at this index - - ``tuple[int, int]`` : get a specific cell value eg. (0,1) gets the 0th row and 1st column - - ``tuple[int, str]`` : get a specific cell value eg. (0, 'colname') - gets the 0th row from ``colname`` - - ``tuple[int | slice, int | slice]`` : get a range of cells from a range of columns. - returns as a :class:`pandas.DataFrame` - """ - if isinstance(item, str): - return self._columns[item] - if isinstance(item, (int, slice)): - return DataFrame.from_dict(self._slice_range(item)) - elif isinstance(item, tuple): - if len(item) != 2: - raise ValueError( - "DynamicTables are 2-dimensional, can't index with more than 2 indices like" - f" {item}" - ) - - # all other cases are tuples of (rows, cols) - rows, cols = item - if isinstance(cols, (int, slice)): - cols = self.colnames[cols] - data = self._slice_range(rows, cols) - return DataFrame.from_dict(data) - else: - raise ValueError(f"Unsure how to get item with key {item}") - - def _slice_range( - self, rows: Union[int, slice], cols: Optional[Union[str, List[str]]] = None - ) -> Dict[str, Union[list, "NDArray", "VectorData"]]: - if cols is None: - cols = self.colnames - elif isinstance(cols, str): - cols = [cols] - - data = {k: self._columns[k][rows] for k in cols} - return data - - def __setitem__(self, key: str, value: Any) -> None: - raise NotImplementedError("TODO") - - def __setattr__(self, key: str, value: Union[list, "NDArray", "VectorData"]): - """ - Add a column, appending it to ``colnames`` - """ - # don't use this while building the model - if not getattr(self, "__pydantic_complete__", False): - return super().__setattr__(key, value) - - if key not in self.model_fields_set and not key.endswith("_index"): - self.colnames.append(key) - - return super().__setattr__(key, value) - - @model_validator(mode="before") - @classmethod - def create_colnames(cls, model: Dict[str, Any]): - """ - Construct colnames from arguments. - - the model dict is ordered after python3.6, so we can use that minus - anything in :attr:`.NON_COLUMN_FIELDS` to determine order implied from passage order - """ - if "colnames" not in model: - colnames = [ - k - for k in model.keys() - if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") - ] - model["colnames"] = colnames - else: - # add any columns not explicitly given an order at the end - colnames = [ - k - for k in model.keys() - if k not in cls.NON_COLUMN_FIELDS - and not k.endswith("_index") - and k not in model["colnames"].keys() - ] - model["colnames"].extend(colnames) - return model - - @model_validator(mode="after") - def resolve_targets(self) -> "DynamicTableMixin": - """ - Ensure that any implicitly indexed columns are linked, and create backlinks - """ - for key, col in self._columns.items(): - if isinstance(col, VectorData): - # find an index - idx = None - for field_name in self.model_fields_set: - # implicit name-based index - field = getattr(self, field_name) - if isinstance(field, VectorIndex): - if field_name == f"{key}_index": - idx = field - break - elif field.target is col: - idx = field - break - if idx is not None: - col._index = idx - idx.target = col - return self - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.table/", - "id": "hdmf-common.table", - "imports": ["hdmf-common.base", "hdmf-common.nwb.language"], - "name": "hdmf-common.table", - } -) - - -class VectorData(VectorDataMixin): - """ - An n-dimensional dataset representing a column of a DynamicTable. If used without an accompanying VectorIndex, first dimension is along the rows of the DynamicTable and each step along the first dimension is a cell of the larger table. VectorData can also be used to represent a ragged array if paired with a VectorIndex. This allows for storing arrays of varying length in a single cell of the DynamicTable by indexing into this VectorData. The first vector is at VectorData[0:VectorIndex[0]]. The second vector is at VectorData[VectorIndex[0]:VectorIndex[1]], and so on. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - description: Optional[str] = Field( - None, description="""Description of what these vectors represent.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class VectorIndex(VectorIndexMixin): - """ - Used with VectorData to encode a ragged array. An array of indices into the first dimension of the target VectorData, and forming a map between the rows of a DynamicTable and the indices of the VectorData. The name of the VectorIndex is expected to be the name of the target VectorData object followed by \"_index\". - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - target: Optional[VectorData] = Field( - None, description="""Reference to the target dataset that this index applies to.""" - ) - description: Optional[str] = Field( - None, description="""Description of what these vectors represent.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class ElementIdentifiers(Data): - """ - A list of unique identifiers for values within a dataset, e.g. rows of a DynamicTable. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field( - "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} - ) - - -class DynamicTableRegion(VectorData): - """ - DynamicTableRegion provides a link from one table to an index or region of another. The `table` attribute is a link to another `DynamicTable`, indicating which table is referenced, and the data is int(s) indicating the row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to associate rows with repeated meta-data without data duplication. They can also be used to create hierarchical relationships between multiple `DynamicTable`s. `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create ragged references, so a single cell of a `DynamicTable` can reference many rows of another `DynamicTable`. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - table: Optional[DynamicTable] = Field( - None, description="""Reference to the DynamicTable object that this region applies to.""" - ) - description: Optional[str] = Field( - None, description="""Description of what this table region points to.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class VocabData(VectorData): - """ - Data that come from a controlled vocabulary of text values. A data value of i corresponds to the i-th element in the 'vocabulary' array attribute. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - vocabulary: Optional[str] = Field( - None, description="""The available items in the controlled vocabulary.""" - ) - description: Optional[str] = Field( - None, description="""Description of what these vectors represent.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class DynamicTable(DynamicTableMixin): - """ - A group containing multiple datasets that are aligned on the first dimension (Currently, this requirement if left up to APIs to check and enforce). These datasets represent different columns in the table. Apart from a column that contains unique identifiers for each row, there are no other required datasets. Users are free to add any number of custom VectorData objects (columns) here. DynamicTable also supports ragged array columns, where each element can be of a different size. To add a ragged array column, use a VectorIndex type to index the corresponding VectorData type. See documentation for VectorData and VectorIndex for more details. Unlike a compound data type, which is analogous to storing an array-of-structs, a DynamicTable can be thought of as a struct-of-arrays. This provides an alternative structure to choose from when optimizing storage for anticipated access patterns. Additionally, this type provides a way of creating a table without having to define a compound type up front. Although this convenience may be attractive, users should think carefully about how data will be accessed. DynamicTable is more appropriate for column-centric access, whereas a dataset with a compound type would be more appropriate for row-centric access. Finally, data size should also be taken into account. For small tables, performance loss may be an acceptable trade-off for the flexibility of a DynamicTable. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - colnames: Optional[str] = Field( - None, - description="""The names of the columns in this table. This should be used to specify an order to the columns.""", - ) - description: Optional[str] = Field( - None, description="""Description of what is in this dynamic table.""" - ) - id: NDArray[Shape["* num_rows"], int] = Field( - ..., - description="""Array of unique identifiers for the rows of this dynamic table.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, - ) - vector_data: Optional[List[VectorData]] = Field( - None, description="""Vector columns, including index columns, of this dynamic table.""" - ) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -VectorData.model_rebuild() -VectorIndex.model_rebuild() -ElementIdentifiers.model_rebuild() -DynamicTableRegion.model_rebuild() -VocabData.model_rebuild() -DynamicTable.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_3_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_3_0/namespace.py deleted file mode 100644 index a2dcc70..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_3_0/namespace.py +++ /dev/null @@ -1,86 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_common.v1_3_0.hdmf_common_resources import ( - ExternalResources, - ExternalResourcesKeys, - ExternalResourcesResources, - ExternalResourcesObjects, - ExternalResourcesObjectKeys, -) -from ...hdmf_common.v1_3_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_3_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_3_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - VocabData, - DynamicTable, -) - -metamodel_version = "None" -version = "1.3.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": True}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common/", - "description": "Common data structures provided by HDMF", - "id": "hdmf-common", - "imports": [ - "hdmf-common.base", - "hdmf-common.table", - "hdmf-common.sparse", - "hdmf-common.resources", - "hdmf-common.nwb.language", - ], - "name": "hdmf-common", - } -) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_4_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_4_0/__init__.py deleted file mode 100644 index 8b13789..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_4_0/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_4_0/hdmf_common_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_4_0/hdmf_common_base.py deleted file mode 100644 index c26f4f8..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_4_0/hdmf_common_base.py +++ /dev/null @@ -1,104 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np - -metamodel_version = "None" -version = "1.4.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.base/", - "id": "hdmf-common.base", - "imports": ["hdmf-common.nwb.language"], - "name": "hdmf-common.base", - } -) - - -class Data(ConfiguredBaseModel): - """ - An abstract data type for a dataset. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.base", "tree_root": True} - ) - - name: str = Field(...) - - -class Container(ConfiguredBaseModel): - """ - An abstract data type for a group storing collections of data and metadata. Base type for all data and metadata containers. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.base", "tree_root": True} - ) - - name: str = Field(...) - - -class SimpleMultiContainer(Container): - """ - A simple Container for holding onto multiple containers. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.base", "tree_root": True} - ) - - children: Optional[List[Container]] = Field( - None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "Container"}]}} - ) - name: str = Field(...) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -Data.model_rebuild() -Container.model_rebuild() -SimpleMultiContainer.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_4_0/hdmf_common_sparse.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_4_0/hdmf_common_sparse.py deleted file mode 100644 index 83e31dd..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_4_0/hdmf_common_sparse.py +++ /dev/null @@ -1,110 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_common.v1_4_0.hdmf_common_base import Container -from numpydantic import NDArray, Shape - -metamodel_version = "None" -version = "1.4.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -NUMPYDANTIC_VERSION = "1.2.1" -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.sparse/", - "id": "hdmf-common.sparse", - "imports": ["hdmf-common.base", "hdmf-common.nwb.language"], - "name": "hdmf-common.sparse", - } -) - - -class CSRMatrix(Container): - """ - A compressed sparse row matrix. Data are stored in the standard CSR format, where column indices for row i are stored in indices[indptr[i]:indptr[i+1]] and their corresponding values are stored in data[indptr[i]:indptr[i+1]]. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.sparse", "tree_root": True} - ) - - name: str = Field(...) - shape: Optional[np.uint64] = Field( - None, description="""The shape (number of rows, number of columns) of this sparse matrix.""" - ) - indices: NDArray[Shape["* number_of_non_zero_values"], np.uint64] = Field( - ..., - description="""The column indices.""", - json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "number_of_non_zero_values"}]}} - }, - ) - indptr: NDArray[Shape["* number_of_rows_in_the_matrix_1"], np.uint64] = Field( - ..., - description="""The row index pointer.""", - json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "number_of_rows_in_the_matrix_1"}]}} - }, - ) - data: CSRMatrixData = Field(..., description="""The non-zero values in the matrix.""") - - -class CSRMatrixData(ConfiguredBaseModel): - """ - The non-zero values in the matrix. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) - - name: Literal["data"] = Field( - "data", - json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, - ) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -CSRMatrix.model_rebuild() -CSRMatrixData.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_4_0/hdmf_common_table.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_4_0/hdmf_common_table.py deleted file mode 100644 index 20c9a63..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_4_0/hdmf_common_table.py +++ /dev/null @@ -1,422 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -import numpy as np -from ...hdmf_common.v1_4_0.hdmf_common_base import Data, Container -from pandas import DataFrame -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, overload, Tuple -from numpydantic import NDArray, Shape -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, model_validator - -metamodel_version = "None" -version = "1.4.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -NUMPYDANTIC_VERSION = "1.2.1" - - -class VectorDataMixin(BaseModel): - """ - Mixin class to give VectorData indexing abilities - """ - - _index: Optional["VectorIndex"] = None - - # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None - - def __getitem__(self, item: Union[str, int, slice, Tuple[Union[str, int, slice], ...]]) -> Any: - if self._index: - # Following hdmf, VectorIndex is the thing that knows how to do the slicing - return self._index[item] - else: - return self.array[item] - - def __setitem__(self, key, value) -> None: - if self._index: - # Following hdmf, VectorIndex is the thing that knows how to do the slicing - self._index[key] = value - else: - self.array[key] = value - - -class VectorIndexMixin(BaseModel): - """ - Mixin class to give VectorIndex indexing abilities - """ - - # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None - target: Optional["VectorData"] = None - - def _getitem_helper(self, arg: int): - """ - Mimicking :func:`hdmf.common.table.VectorIndex.__getitem_helper` - """ - - start = 0 if arg == 0 else self.array[arg - 1] - end = self.array[arg] - return self.target.array[slice(start, end)] - - def __getitem__(self, item: Union[int, slice]) -> Any: - if self.target is None: - return self.array[item] - elif type(self.target).__name__ == "VectorData": - if isinstance(item, int): - return self._getitem_helper(item) - else: - idx = range(*item.indices(len(self.array))) - return [self._getitem_helper(i) for i in idx] - else: - raise NotImplementedError("DynamicTableRange not supported yet") - - def __setitem__(self, key, value) -> None: - if self._index: - # VectorIndex is the thing that knows how to do the slicing - self._index[key] = value - else: - self.array[key] = value - - -class DynamicTableMixin(BaseModel): - """ - Mixin to make DynamicTable subclasses behave like tables/dataframes - - Mimicking some of the behavior from :class:`hdmf.common.table.DynamicTable` - but simplifying along the way :) - """ - - model_config = ConfigDict(extra="allow") - __pydantic_extra__: Dict[str, Union[list, "NDArray", "VectorData"]] - NON_COLUMN_FIELDS: ClassVar[tuple[str]] = ( - "name", - "colnames", - "description", - ) - - # overridden by subclass but implemented here for testing and typechecking purposes :) - colnames: List[str] = Field(default_factory=list) - - @property - def _columns(self) -> Dict[str, Union[list, "NDArray", "VectorData"]]: - return {k: getattr(self, k) for i, k in enumerate(self.colnames)} - - @property - def _columns_list(self) -> List[Union[list, "NDArray", "VectorData"]]: - return [getattr(self, k) for i, k in enumerate(self.colnames)] - - @overload - def __getitem__(self, item: str) -> Union[list, "NDArray", "VectorData"]: ... - - @overload - def __getitem__(self, item: int) -> DataFrame: ... - - @overload - def __getitem__(self, item: Tuple[int, Union[int, str]]) -> Any: ... - - @overload - def __getitem__(self, item: Tuple[Union[int, slice], ...]) -> Union[ - DataFrame, - list, - "NDArray", - "VectorData", - ]: ... - - @overload - def __getitem__(self, item: slice) -> DataFrame: ... - - def __getitem__( - self, - item: Union[ - str, - int, - slice, - Tuple[int, Union[int, str]], - Tuple[Union[int, slice], ...], - ], - ) -> Any: - """ - Get an item from the table - - If item is... - - - ``str`` : get the column with this name - - ``int`` : get the row at this index - - ``tuple[int, int]`` : get a specific cell value eg. (0,1) gets the 0th row and 1st column - - ``tuple[int, str]`` : get a specific cell value eg. (0, 'colname') - gets the 0th row from ``colname`` - - ``tuple[int | slice, int | slice]`` : get a range of cells from a range of columns. - returns as a :class:`pandas.DataFrame` - """ - if isinstance(item, str): - return self._columns[item] - if isinstance(item, (int, slice)): - return DataFrame.from_dict(self._slice_range(item)) - elif isinstance(item, tuple): - if len(item) != 2: - raise ValueError( - "DynamicTables are 2-dimensional, can't index with more than 2 indices like" - f" {item}" - ) - - # all other cases are tuples of (rows, cols) - rows, cols = item - if isinstance(cols, (int, slice)): - cols = self.colnames[cols] - data = self._slice_range(rows, cols) - return DataFrame.from_dict(data) - else: - raise ValueError(f"Unsure how to get item with key {item}") - - def _slice_range( - self, rows: Union[int, slice], cols: Optional[Union[str, List[str]]] = None - ) -> Dict[str, Union[list, "NDArray", "VectorData"]]: - if cols is None: - cols = self.colnames - elif isinstance(cols, str): - cols = [cols] - - data = {k: self._columns[k][rows] for k in cols} - return data - - def __setitem__(self, key: str, value: Any) -> None: - raise NotImplementedError("TODO") - - def __setattr__(self, key: str, value: Union[list, "NDArray", "VectorData"]): - """ - Add a column, appending it to ``colnames`` - """ - # don't use this while building the model - if not getattr(self, "__pydantic_complete__", False): - return super().__setattr__(key, value) - - if key not in self.model_fields_set and not key.endswith("_index"): - self.colnames.append(key) - - return super().__setattr__(key, value) - - @model_validator(mode="before") - @classmethod - def create_colnames(cls, model: Dict[str, Any]): - """ - Construct colnames from arguments. - - the model dict is ordered after python3.6, so we can use that minus - anything in :attr:`.NON_COLUMN_FIELDS` to determine order implied from passage order - """ - if "colnames" not in model: - colnames = [ - k - for k in model.keys() - if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") - ] - model["colnames"] = colnames - else: - # add any columns not explicitly given an order at the end - colnames = [ - k - for k in model.keys() - if k not in cls.NON_COLUMN_FIELDS - and not k.endswith("_index") - and k not in model["colnames"].keys() - ] - model["colnames"].extend(colnames) - return model - - @model_validator(mode="after") - def resolve_targets(self) -> "DynamicTableMixin": - """ - Ensure that any implicitly indexed columns are linked, and create backlinks - """ - for key, col in self._columns.items(): - if isinstance(col, VectorData): - # find an index - idx = None - for field_name in self.model_fields_set: - # implicit name-based index - field = getattr(self, field_name) - if isinstance(field, VectorIndex): - if field_name == f"{key}_index": - idx = field - break - elif field.target is col: - idx = field - break - if idx is not None: - col._index = idx - idx.target = col - return self - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.table/", - "id": "hdmf-common.table", - "imports": ["hdmf-common.base", "hdmf-common.nwb.language"], - "name": "hdmf-common.table", - } -) - - -class VectorData(VectorDataMixin): - """ - An n-dimensional dataset representing a column of a DynamicTable. If used without an accompanying VectorIndex, first dimension is along the rows of the DynamicTable and each step along the first dimension is a cell of the larger table. VectorData can also be used to represent a ragged array if paired with a VectorIndex. This allows for storing arrays of varying length in a single cell of the DynamicTable by indexing into this VectorData. The first vector is at VectorData[0:VectorIndex[0]]. The second vector is at VectorData[VectorIndex[0]:VectorIndex[1]], and so on. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - description: Optional[str] = Field( - None, description="""Description of what these vectors represent.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class VectorIndex(VectorIndexMixin): - """ - Used with VectorData to encode a ragged array. An array of indices into the first dimension of the target VectorData, and forming a map between the rows of a DynamicTable and the indices of the VectorData. The name of the VectorIndex is expected to be the name of the target VectorData object followed by \"_index\". - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - target: Optional[VectorData] = Field( - None, description="""Reference to the target dataset that this index applies to.""" - ) - description: Optional[str] = Field( - None, description="""Description of what these vectors represent.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class ElementIdentifiers(Data): - """ - A list of unique identifiers for values within a dataset, e.g. rows of a DynamicTable. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field( - "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} - ) - - -class DynamicTableRegion(VectorData): - """ - DynamicTableRegion provides a link from one table to an index or region of another. The `table` attribute is a link to another `DynamicTable`, indicating which table is referenced, and the data is int(s) indicating the row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to associate rows with repeated meta-data without data duplication. They can also be used to create hierarchical relationships between multiple `DynamicTable`s. `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create ragged references, so a single cell of a `DynamicTable` can reference many rows of another `DynamicTable`. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - table: Optional[DynamicTable] = Field( - None, description="""Reference to the DynamicTable object that this region applies to.""" - ) - description: Optional[str] = Field( - None, description="""Description of what this table region points to.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class DynamicTable(DynamicTableMixin): - """ - A group containing multiple datasets that are aligned on the first dimension (Currently, this requirement if left up to APIs to check and enforce). These datasets represent different columns in the table. Apart from a column that contains unique identifiers for each row, there are no other required datasets. Users are free to add any number of custom VectorData objects (columns) here. DynamicTable also supports ragged array columns, where each element can be of a different size. To add a ragged array column, use a VectorIndex type to index the corresponding VectorData type. See documentation for VectorData and VectorIndex for more details. Unlike a compound data type, which is analogous to storing an array-of-structs, a DynamicTable can be thought of as a struct-of-arrays. This provides an alternative structure to choose from when optimizing storage for anticipated access patterns. Additionally, this type provides a way of creating a table without having to define a compound type up front. Although this convenience may be attractive, users should think carefully about how data will be accessed. DynamicTable is more appropriate for column-centric access, whereas a dataset with a compound type would be more appropriate for row-centric access. Finally, data size should also be taken into account. For small tables, performance loss may be an acceptable trade-off for the flexibility of a DynamicTable. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - colnames: Optional[str] = Field( - None, - description="""The names of the columns in this table. This should be used to specify an order to the columns.""", - ) - description: Optional[str] = Field( - None, description="""Description of what is in this dynamic table.""" - ) - id: NDArray[Shape["* num_rows"], int] = Field( - ..., - description="""Array of unique identifiers for the rows of this dynamic table.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, - ) - vector_data: Optional[List[VectorData]] = Field( - None, description="""Vector columns, including index columns, of this dynamic table.""" - ) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -VectorData.model_rebuild() -VectorIndex.model_rebuild() -ElementIdentifiers.model_rebuild() -DynamicTableRegion.model_rebuild() -DynamicTable.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_4_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_4_0/namespace.py deleted file mode 100644 index db59f28..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_4_0/namespace.py +++ /dev/null @@ -1,77 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_common.v1_4_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_4_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_4_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, -) - -metamodel_version = "None" -version = "1.4.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": True}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common/", - "description": "Common data structures provided by HDMF", - "id": "hdmf-common", - "imports": [ - "hdmf-common.base", - "hdmf-common.table", - "hdmf-common.sparse", - "hdmf-common.nwb.language", - ], - "name": "hdmf-common", - } -) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_sparse.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_sparse.py index e520f5f..49f08da 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_sparse.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_sparse.py @@ -71,17 +71,17 @@ class CSRMatrix(Container): ) name: str = Field(...) - shape: Optional[np.uint64] = Field( + shape: Optional[int] = Field( None, description="""The shape (number of rows, number of columns) of this sparse matrix.""" ) - indices: NDArray[Shape["* number_of_non_zero_values"], np.uint64] = Field( + indices: NDArray[Shape["* number_of_non_zero_values"], int] = Field( ..., description="""The column indices.""", json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "number_of_non_zero_values"}]}} }, ) - indptr: NDArray[Shape["* number_of_rows_in_the_matrix_1"], np.uint64] = Field( + indptr: NDArray[Shape["* number_of_rows_in_the_matrix_1"], int] = Field( ..., description="""The row index pointer.""", json_schema_extra={ diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_table.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_table.py index ba68e69..9dbabc2 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_table.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_table.py @@ -67,7 +67,7 @@ class VectorDataMixin(BaseModel): else: return self.array[item] - def __setitem__(self, key, value) -> None: + def __setitem__(self, key: Union[int, str, slice], value: Any) -> None: if self._index: # Following hdmf, VectorIndex is the thing that knows how to do the slicing self._index[key] = value @@ -84,7 +84,7 @@ class VectorIndexMixin(BaseModel): array: Optional[NDArray] = None target: Optional["VectorData"] = None - def _getitem_helper(self, arg: int): + def _getitem_helper(self, arg: int) -> Union[list, NDArray]: """ Mimicking :func:`hdmf.common.table.VectorIndex.__getitem_helper` """ @@ -105,7 +105,7 @@ class VectorIndexMixin(BaseModel): else: raise NotImplementedError("DynamicTableRange not supported yet") - def __setitem__(self, key, value) -> None: + def __setitem__(self, key: Union[int, slice], value: Any) -> None: if self._index: # VectorIndex is the thing that knows how to do the slicing self._index[key] = value @@ -122,7 +122,7 @@ class DynamicTableMixin(BaseModel): """ model_config = ConfigDict(extra="allow") - __pydantic_extra__: Dict[str, Union[list, "NDArray", "VectorData"]] + __pydantic_extra__: Dict[str, Union[list, "NDArray", "VectorDataMixin"]] NON_COLUMN_FIELDS: ClassVar[tuple[str]] = ( "name", "colnames", @@ -133,15 +133,15 @@ class DynamicTableMixin(BaseModel): colnames: List[str] = Field(default_factory=list) @property - def _columns(self) -> Dict[str, Union[list, "NDArray", "VectorData"]]: + def _columns(self) -> Dict[str, Union[list, "NDArray", "VectorDataMixin"]]: return {k: getattr(self, k) for i, k in enumerate(self.colnames)} @property - def _columns_list(self) -> List[Union[list, "NDArray", "VectorData"]]: + def _columns_list(self) -> List[Union[list, "NDArray", "VectorDataMixin"]]: return [getattr(self, k) for i, k in enumerate(self.colnames)] @overload - def __getitem__(self, item: str) -> Union[list, "NDArray", "VectorData"]: ... + def __getitem__(self, item: str) -> Union[list, "NDArray", "VectorDataMixin"]: ... @overload def __getitem__(self, item: int) -> DataFrame: ... @@ -154,7 +154,7 @@ class DynamicTableMixin(BaseModel): DataFrame, list, "NDArray", - "VectorData", + "VectorDataMixin", ]: ... @overload @@ -232,7 +232,7 @@ class DynamicTableMixin(BaseModel): @model_validator(mode="before") @classmethod - def create_colnames(cls, model: Dict[str, Any]): + def create_colnames(cls, model: Dict[str, Any]) -> None: """ Construct colnames from arguments. @@ -241,19 +241,17 @@ class DynamicTableMixin(BaseModel): """ if "colnames" not in model: colnames = [ - k - for k in model.keys() - if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") + k for k in model if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") ] model["colnames"] = colnames else: # add any columns not explicitly given an order at the end colnames = [ k - for k in model.keys() + for k in model if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") - and k not in model["colnames"].keys() + and k not in model["colnames"] ] model["colnames"].extend(colnames) return model @@ -270,13 +268,11 @@ class DynamicTableMixin(BaseModel): for field_name in self.model_fields_set: # implicit name-based index field = getattr(self, field_name) - if isinstance(field, VectorIndex): - if field_name == f"{key}_index": - idx = field - break - elif field.target is col: - idx = field - break + if isinstance(field, VectorIndex) and ( + field_name == f"{key}_index" or field.target is col + ): + idx = field + break if idx is not None: col._index = idx idx.target = col diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_1/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_1/__init__.py deleted file mode 100644 index 8b13789..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_1/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_1/hdmf_common_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_1/hdmf_common_base.py deleted file mode 100644 index ad29fbc..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_1/hdmf_common_base.py +++ /dev/null @@ -1,104 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np - -metamodel_version = "None" -version = "1.5.1" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.base/", - "id": "hdmf-common.base", - "imports": ["hdmf-common.nwb.language"], - "name": "hdmf-common.base", - } -) - - -class Data(ConfiguredBaseModel): - """ - An abstract data type for a dataset. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.base", "tree_root": True} - ) - - name: str = Field(...) - - -class Container(ConfiguredBaseModel): - """ - An abstract data type for a group storing collections of data and metadata. Base type for all data and metadata containers. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.base", "tree_root": True} - ) - - name: str = Field(...) - - -class SimpleMultiContainer(Container): - """ - A simple Container for holding onto multiple containers. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.base", "tree_root": True} - ) - - children: Optional[List[Container]] = Field( - None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "Container"}]}} - ) - name: str = Field(...) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -Data.model_rebuild() -Container.model_rebuild() -SimpleMultiContainer.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_1/hdmf_common_sparse.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_1/hdmf_common_sparse.py deleted file mode 100644 index a095b6b..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_1/hdmf_common_sparse.py +++ /dev/null @@ -1,110 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_common.v1_5_1.hdmf_common_base import Container -from numpydantic import NDArray, Shape - -metamodel_version = "None" -version = "1.5.1" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -NUMPYDANTIC_VERSION = "1.2.1" -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.sparse/", - "id": "hdmf-common.sparse", - "imports": ["hdmf-common.base", "hdmf-common.nwb.language"], - "name": "hdmf-common.sparse", - } -) - - -class CSRMatrix(Container): - """ - A compressed sparse row matrix. Data are stored in the standard CSR format, where column indices for row i are stored in indices[indptr[i]:indptr[i+1]] and their corresponding values are stored in data[indptr[i]:indptr[i+1]]. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.sparse", "tree_root": True} - ) - - name: str = Field(...) - shape: Optional[np.uint64] = Field( - None, description="""The shape (number of rows, number of columns) of this sparse matrix.""" - ) - indices: NDArray[Shape["* number_of_non_zero_values"], np.uint64] = Field( - ..., - description="""The column indices.""", - json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "number_of_non_zero_values"}]}} - }, - ) - indptr: NDArray[Shape["* number_of_rows_in_the_matrix_1"], np.uint64] = Field( - ..., - description="""The row index pointer.""", - json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "number_of_rows_in_the_matrix_1"}]}} - }, - ) - data: CSRMatrixData = Field(..., description="""The non-zero values in the matrix.""") - - -class CSRMatrixData(ConfiguredBaseModel): - """ - The non-zero values in the matrix. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) - - name: Literal["data"] = Field( - "data", - json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, - ) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -CSRMatrix.model_rebuild() -CSRMatrixData.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_1/hdmf_common_table.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_1/hdmf_common_table.py deleted file mode 100644 index 91746ee..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_1/hdmf_common_table.py +++ /dev/null @@ -1,453 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -import numpy as np -from ...hdmf_common.v1_5_1.hdmf_common_base import Data, Container -from pandas import DataFrame -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, overload, Tuple -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, model_validator -from numpydantic import NDArray, Shape - -metamodel_version = "None" -version = "1.5.1" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -NUMPYDANTIC_VERSION = "1.2.1" - - -class VectorDataMixin(BaseModel): - """ - Mixin class to give VectorData indexing abilities - """ - - _index: Optional["VectorIndex"] = None - - # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None - - def __getitem__(self, item: Union[str, int, slice, Tuple[Union[str, int, slice], ...]]) -> Any: - if self._index: - # Following hdmf, VectorIndex is the thing that knows how to do the slicing - return self._index[item] - else: - return self.array[item] - - def __setitem__(self, key, value) -> None: - if self._index: - # Following hdmf, VectorIndex is the thing that knows how to do the slicing - self._index[key] = value - else: - self.array[key] = value - - -class VectorIndexMixin(BaseModel): - """ - Mixin class to give VectorIndex indexing abilities - """ - - # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None - target: Optional["VectorData"] = None - - def _getitem_helper(self, arg: int): - """ - Mimicking :func:`hdmf.common.table.VectorIndex.__getitem_helper` - """ - - start = 0 if arg == 0 else self.array[arg - 1] - end = self.array[arg] - return self.target.array[slice(start, end)] - - def __getitem__(self, item: Union[int, slice]) -> Any: - if self.target is None: - return self.array[item] - elif type(self.target).__name__ == "VectorData": - if isinstance(item, int): - return self._getitem_helper(item) - else: - idx = range(*item.indices(len(self.array))) - return [self._getitem_helper(i) for i in idx] - else: - raise NotImplementedError("DynamicTableRange not supported yet") - - def __setitem__(self, key, value) -> None: - if self._index: - # VectorIndex is the thing that knows how to do the slicing - self._index[key] = value - else: - self.array[key] = value - - -class DynamicTableMixin(BaseModel): - """ - Mixin to make DynamicTable subclasses behave like tables/dataframes - - Mimicking some of the behavior from :class:`hdmf.common.table.DynamicTable` - but simplifying along the way :) - """ - - model_config = ConfigDict(extra="allow") - __pydantic_extra__: Dict[str, Union[list, "NDArray", "VectorData"]] - NON_COLUMN_FIELDS: ClassVar[tuple[str]] = ( - "name", - "colnames", - "description", - ) - - # overridden by subclass but implemented here for testing and typechecking purposes :) - colnames: List[str] = Field(default_factory=list) - - @property - def _columns(self) -> Dict[str, Union[list, "NDArray", "VectorData"]]: - return {k: getattr(self, k) for i, k in enumerate(self.colnames)} - - @property - def _columns_list(self) -> List[Union[list, "NDArray", "VectorData"]]: - return [getattr(self, k) for i, k in enumerate(self.colnames)] - - @overload - def __getitem__(self, item: str) -> Union[list, "NDArray", "VectorData"]: ... - - @overload - def __getitem__(self, item: int) -> DataFrame: ... - - @overload - def __getitem__(self, item: Tuple[int, Union[int, str]]) -> Any: ... - - @overload - def __getitem__(self, item: Tuple[Union[int, slice], ...]) -> Union[ - DataFrame, - list, - "NDArray", - "VectorData", - ]: ... - - @overload - def __getitem__(self, item: slice) -> DataFrame: ... - - def __getitem__( - self, - item: Union[ - str, - int, - slice, - Tuple[int, Union[int, str]], - Tuple[Union[int, slice], ...], - ], - ) -> Any: - """ - Get an item from the table - - If item is... - - - ``str`` : get the column with this name - - ``int`` : get the row at this index - - ``tuple[int, int]`` : get a specific cell value eg. (0,1) gets the 0th row and 1st column - - ``tuple[int, str]`` : get a specific cell value eg. (0, 'colname') - gets the 0th row from ``colname`` - - ``tuple[int | slice, int | slice]`` : get a range of cells from a range of columns. - returns as a :class:`pandas.DataFrame` - """ - if isinstance(item, str): - return self._columns[item] - if isinstance(item, (int, slice)): - return DataFrame.from_dict(self._slice_range(item)) - elif isinstance(item, tuple): - if len(item) != 2: - raise ValueError( - "DynamicTables are 2-dimensional, can't index with more than 2 indices like" - f" {item}" - ) - - # all other cases are tuples of (rows, cols) - rows, cols = item - if isinstance(cols, (int, slice)): - cols = self.colnames[cols] - data = self._slice_range(rows, cols) - return DataFrame.from_dict(data) - else: - raise ValueError(f"Unsure how to get item with key {item}") - - def _slice_range( - self, rows: Union[int, slice], cols: Optional[Union[str, List[str]]] = None - ) -> Dict[str, Union[list, "NDArray", "VectorData"]]: - if cols is None: - cols = self.colnames - elif isinstance(cols, str): - cols = [cols] - - data = {k: self._columns[k][rows] for k in cols} - return data - - def __setitem__(self, key: str, value: Any) -> None: - raise NotImplementedError("TODO") - - def __setattr__(self, key: str, value: Union[list, "NDArray", "VectorData"]): - """ - Add a column, appending it to ``colnames`` - """ - # don't use this while building the model - if not getattr(self, "__pydantic_complete__", False): - return super().__setattr__(key, value) - - if key not in self.model_fields_set and not key.endswith("_index"): - self.colnames.append(key) - - return super().__setattr__(key, value) - - @model_validator(mode="before") - @classmethod - def create_colnames(cls, model: Dict[str, Any]): - """ - Construct colnames from arguments. - - the model dict is ordered after python3.6, so we can use that minus - anything in :attr:`.NON_COLUMN_FIELDS` to determine order implied from passage order - """ - if "colnames" not in model: - colnames = [ - k - for k in model.keys() - if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") - ] - model["colnames"] = colnames - else: - # add any columns not explicitly given an order at the end - colnames = [ - k - for k in model.keys() - if k not in cls.NON_COLUMN_FIELDS - and not k.endswith("_index") - and k not in model["colnames"].keys() - ] - model["colnames"].extend(colnames) - return model - - @model_validator(mode="after") - def resolve_targets(self) -> "DynamicTableMixin": - """ - Ensure that any implicitly indexed columns are linked, and create backlinks - """ - for key, col in self._columns.items(): - if isinstance(col, VectorData): - # find an index - idx = None - for field_name in self.model_fields_set: - # implicit name-based index - field = getattr(self, field_name) - if isinstance(field, VectorIndex): - if field_name == f"{key}_index": - idx = field - break - elif field.target is col: - idx = field - break - if idx is not None: - col._index = idx - idx.target = col - return self - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.table/", - "id": "hdmf-common.table", - "imports": ["hdmf-common.base", "hdmf-common.nwb.language"], - "name": "hdmf-common.table", - } -) - - -class VectorData(VectorDataMixin): - """ - An n-dimensional dataset representing a column of a DynamicTable. If used without an accompanying VectorIndex, first dimension is along the rows of the DynamicTable and each step along the first dimension is a cell of the larger table. VectorData can also be used to represent a ragged array if paired with a VectorIndex. This allows for storing arrays of varying length in a single cell of the DynamicTable by indexing into this VectorData. The first vector is at VectorData[0:VectorIndex[0]]. The second vector is at VectorData[VectorIndex[0]:VectorIndex[1]], and so on. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - description: Optional[str] = Field( - None, description="""Description of what these vectors represent.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class VectorIndex(VectorIndexMixin): - """ - Used with VectorData to encode a ragged array. An array of indices into the first dimension of the target VectorData, and forming a map between the rows of a DynamicTable and the indices of the VectorData. The name of the VectorIndex is expected to be the name of the target VectorData object followed by \"_index\". - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - target: Optional[VectorData] = Field( - None, description="""Reference to the target dataset that this index applies to.""" - ) - description: Optional[str] = Field( - None, description="""Description of what these vectors represent.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class ElementIdentifiers(Data): - """ - A list of unique identifiers for values within a dataset, e.g. rows of a DynamicTable. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field( - "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} - ) - - -class DynamicTableRegion(VectorData): - """ - DynamicTableRegion provides a link from one table to an index or region of another. The `table` attribute is a link to another `DynamicTable`, indicating which table is referenced, and the data is int(s) indicating the row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to associate rows with repeated meta-data without data duplication. They can also be used to create hierarchical relationships between multiple `DynamicTable`s. `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create ragged references, so a single cell of a `DynamicTable` can reference many rows of another `DynamicTable`. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - table: Optional[DynamicTable] = Field( - None, description="""Reference to the DynamicTable object that this region applies to.""" - ) - description: Optional[str] = Field( - None, description="""Description of what this table region points to.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class DynamicTable(DynamicTableMixin): - """ - A group containing multiple datasets that are aligned on the first dimension (Currently, this requirement if left up to APIs to check and enforce). These datasets represent different columns in the table. Apart from a column that contains unique identifiers for each row, there are no other required datasets. Users are free to add any number of custom VectorData objects (columns) here. DynamicTable also supports ragged array columns, where each element can be of a different size. To add a ragged array column, use a VectorIndex type to index the corresponding VectorData type. See documentation for VectorData and VectorIndex for more details. Unlike a compound data type, which is analogous to storing an array-of-structs, a DynamicTable can be thought of as a struct-of-arrays. This provides an alternative structure to choose from when optimizing storage for anticipated access patterns. Additionally, this type provides a way of creating a table without having to define a compound type up front. Although this convenience may be attractive, users should think carefully about how data will be accessed. DynamicTable is more appropriate for column-centric access, whereas a dataset with a compound type would be more appropriate for row-centric access. Finally, data size should also be taken into account. For small tables, performance loss may be an acceptable trade-off for the flexibility of a DynamicTable. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - colnames: Optional[str] = Field( - None, - description="""The names of the columns in this table. This should be used to specify an order to the columns.""", - ) - description: Optional[str] = Field( - None, description="""Description of what is in this dynamic table.""" - ) - id: NDArray[Shape["* num_rows"], int] = Field( - ..., - description="""Array of unique identifiers for the rows of this dynamic table.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, - ) - vector_data: Optional[List[VectorData]] = Field( - None, description="""Vector columns, including index columns, of this dynamic table.""" - ) - - -class AlignedDynamicTable(DynamicTable): - """ - DynamicTable container that supports storing a collection of sub-tables. Each sub-table is a DynamicTable itself that is aligned with the main table by row index. I.e., all DynamicTables stored in this group MUST have the same number of rows. This type effectively defines a 2-level table in which the main data is stored in the main table implemented by this type and additional columns of the table are grouped into categories, with each category being represented by a separate DynamicTable stored within the group. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - children: Optional[List[DynamicTable]] = Field( - None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "DynamicTable"}]}} - ) - name: str = Field(...) - colnames: Optional[str] = Field( - None, - description="""The names of the columns in this table. This should be used to specify an order to the columns.""", - ) - description: Optional[str] = Field( - None, description="""Description of what is in this dynamic table.""" - ) - id: NDArray[Shape["* num_rows"], int] = Field( - ..., - description="""Array of unique identifiers for the rows of this dynamic table.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, - ) - vector_data: Optional[List[VectorData]] = Field( - None, description="""Vector columns, including index columns, of this dynamic table.""" - ) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -VectorData.model_rebuild() -VectorIndex.model_rebuild() -ElementIdentifiers.model_rebuild() -DynamicTableRegion.model_rebuild() -DynamicTable.model_rebuild() -AlignedDynamicTable.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_1/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_1/namespace.py deleted file mode 100644 index 836122e..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_1/namespace.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_common.v1_5_1.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_1.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_1.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) - -metamodel_version = "None" -version = "1.5.1" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": True}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common/", - "description": "Common data structures provided by HDMF", - "id": "hdmf-common", - "imports": [ - "hdmf-common.base", - "hdmf-common.table", - "hdmf-common.sparse", - "hdmf-common.nwb.language", - ], - "name": "hdmf-common", - } -) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_6_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_6_0/__init__.py deleted file mode 100644 index 8b13789..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_6_0/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_6_0/hdmf_common_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_6_0/hdmf_common_base.py deleted file mode 100644 index 499e6ad..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_6_0/hdmf_common_base.py +++ /dev/null @@ -1,104 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np - -metamodel_version = "None" -version = "1.6.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.base/", - "id": "hdmf-common.base", - "imports": ["hdmf-common.nwb.language"], - "name": "hdmf-common.base", - } -) - - -class Data(ConfiguredBaseModel): - """ - An abstract data type for a dataset. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.base", "tree_root": True} - ) - - name: str = Field(...) - - -class Container(ConfiguredBaseModel): - """ - An abstract data type for a group storing collections of data and metadata. Base type for all data and metadata containers. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.base", "tree_root": True} - ) - - name: str = Field(...) - - -class SimpleMultiContainer(Container): - """ - A simple Container for holding onto multiple containers. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.base", "tree_root": True} - ) - - children: Optional[List[Container]] = Field( - None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "Container"}]}} - ) - name: str = Field(...) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -Data.model_rebuild() -Container.model_rebuild() -SimpleMultiContainer.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_6_0/hdmf_common_sparse.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_6_0/hdmf_common_sparse.py deleted file mode 100644 index 0966f74..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_6_0/hdmf_common_sparse.py +++ /dev/null @@ -1,110 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_common.v1_6_0.hdmf_common_base import Container -from numpydantic import NDArray, Shape - -metamodel_version = "None" -version = "1.6.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -NUMPYDANTIC_VERSION = "1.2.1" -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.sparse/", - "id": "hdmf-common.sparse", - "imports": ["hdmf-common.base", "hdmf-common.nwb.language"], - "name": "hdmf-common.sparse", - } -) - - -class CSRMatrix(Container): - """ - A compressed sparse row matrix. Data are stored in the standard CSR format, where column indices for row i are stored in indices[indptr[i]:indptr[i+1]] and their corresponding values are stored in data[indptr[i]:indptr[i+1]]. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.sparse", "tree_root": True} - ) - - name: str = Field(...) - shape: Optional[np.uint64] = Field( - None, description="""The shape (number of rows, number of columns) of this sparse matrix.""" - ) - indices: NDArray[Shape["* number_of_non_zero_values"], np.uint64] = Field( - ..., - description="""The column indices.""", - json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "number_of_non_zero_values"}]}} - }, - ) - indptr: NDArray[Shape["* number_of_rows_in_the_matrix_1"], np.uint64] = Field( - ..., - description="""The row index pointer.""", - json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "number_of_rows_in_the_matrix_1"}]}} - }, - ) - data: CSRMatrixData = Field(..., description="""The non-zero values in the matrix.""") - - -class CSRMatrixData(ConfiguredBaseModel): - """ - The non-zero values in the matrix. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) - - name: Literal["data"] = Field( - "data", - json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, - ) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -CSRMatrix.model_rebuild() -CSRMatrixData.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_6_0/hdmf_common_table.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_6_0/hdmf_common_table.py deleted file mode 100644 index e0e06bc..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_6_0/hdmf_common_table.py +++ /dev/null @@ -1,453 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -import numpy as np -from ...hdmf_common.v1_6_0.hdmf_common_base import Data, Container -from pandas import DataFrame -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, overload, Tuple -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, model_validator -from numpydantic import NDArray, Shape - -metamodel_version = "None" -version = "1.6.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -NUMPYDANTIC_VERSION = "1.2.1" - - -class VectorDataMixin(BaseModel): - """ - Mixin class to give VectorData indexing abilities - """ - - _index: Optional["VectorIndex"] = None - - # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None - - def __getitem__(self, item: Union[str, int, slice, Tuple[Union[str, int, slice], ...]]) -> Any: - if self._index: - # Following hdmf, VectorIndex is the thing that knows how to do the slicing - return self._index[item] - else: - return self.array[item] - - def __setitem__(self, key, value) -> None: - if self._index: - # Following hdmf, VectorIndex is the thing that knows how to do the slicing - self._index[key] = value - else: - self.array[key] = value - - -class VectorIndexMixin(BaseModel): - """ - Mixin class to give VectorIndex indexing abilities - """ - - # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None - target: Optional["VectorData"] = None - - def _getitem_helper(self, arg: int): - """ - Mimicking :func:`hdmf.common.table.VectorIndex.__getitem_helper` - """ - - start = 0 if arg == 0 else self.array[arg - 1] - end = self.array[arg] - return self.target.array[slice(start, end)] - - def __getitem__(self, item: Union[int, slice]) -> Any: - if self.target is None: - return self.array[item] - elif type(self.target).__name__ == "VectorData": - if isinstance(item, int): - return self._getitem_helper(item) - else: - idx = range(*item.indices(len(self.array))) - return [self._getitem_helper(i) for i in idx] - else: - raise NotImplementedError("DynamicTableRange not supported yet") - - def __setitem__(self, key, value) -> None: - if self._index: - # VectorIndex is the thing that knows how to do the slicing - self._index[key] = value - else: - self.array[key] = value - - -class DynamicTableMixin(BaseModel): - """ - Mixin to make DynamicTable subclasses behave like tables/dataframes - - Mimicking some of the behavior from :class:`hdmf.common.table.DynamicTable` - but simplifying along the way :) - """ - - model_config = ConfigDict(extra="allow") - __pydantic_extra__: Dict[str, Union[list, "NDArray", "VectorData"]] - NON_COLUMN_FIELDS: ClassVar[tuple[str]] = ( - "name", - "colnames", - "description", - ) - - # overridden by subclass but implemented here for testing and typechecking purposes :) - colnames: List[str] = Field(default_factory=list) - - @property - def _columns(self) -> Dict[str, Union[list, "NDArray", "VectorData"]]: - return {k: getattr(self, k) for i, k in enumerate(self.colnames)} - - @property - def _columns_list(self) -> List[Union[list, "NDArray", "VectorData"]]: - return [getattr(self, k) for i, k in enumerate(self.colnames)] - - @overload - def __getitem__(self, item: str) -> Union[list, "NDArray", "VectorData"]: ... - - @overload - def __getitem__(self, item: int) -> DataFrame: ... - - @overload - def __getitem__(self, item: Tuple[int, Union[int, str]]) -> Any: ... - - @overload - def __getitem__(self, item: Tuple[Union[int, slice], ...]) -> Union[ - DataFrame, - list, - "NDArray", - "VectorData", - ]: ... - - @overload - def __getitem__(self, item: slice) -> DataFrame: ... - - def __getitem__( - self, - item: Union[ - str, - int, - slice, - Tuple[int, Union[int, str]], - Tuple[Union[int, slice], ...], - ], - ) -> Any: - """ - Get an item from the table - - If item is... - - - ``str`` : get the column with this name - - ``int`` : get the row at this index - - ``tuple[int, int]`` : get a specific cell value eg. (0,1) gets the 0th row and 1st column - - ``tuple[int, str]`` : get a specific cell value eg. (0, 'colname') - gets the 0th row from ``colname`` - - ``tuple[int | slice, int | slice]`` : get a range of cells from a range of columns. - returns as a :class:`pandas.DataFrame` - """ - if isinstance(item, str): - return self._columns[item] - if isinstance(item, (int, slice)): - return DataFrame.from_dict(self._slice_range(item)) - elif isinstance(item, tuple): - if len(item) != 2: - raise ValueError( - "DynamicTables are 2-dimensional, can't index with more than 2 indices like" - f" {item}" - ) - - # all other cases are tuples of (rows, cols) - rows, cols = item - if isinstance(cols, (int, slice)): - cols = self.colnames[cols] - data = self._slice_range(rows, cols) - return DataFrame.from_dict(data) - else: - raise ValueError(f"Unsure how to get item with key {item}") - - def _slice_range( - self, rows: Union[int, slice], cols: Optional[Union[str, List[str]]] = None - ) -> Dict[str, Union[list, "NDArray", "VectorData"]]: - if cols is None: - cols = self.colnames - elif isinstance(cols, str): - cols = [cols] - - data = {k: self._columns[k][rows] for k in cols} - return data - - def __setitem__(self, key: str, value: Any) -> None: - raise NotImplementedError("TODO") - - def __setattr__(self, key: str, value: Union[list, "NDArray", "VectorData"]): - """ - Add a column, appending it to ``colnames`` - """ - # don't use this while building the model - if not getattr(self, "__pydantic_complete__", False): - return super().__setattr__(key, value) - - if key not in self.model_fields_set and not key.endswith("_index"): - self.colnames.append(key) - - return super().__setattr__(key, value) - - @model_validator(mode="before") - @classmethod - def create_colnames(cls, model: Dict[str, Any]): - """ - Construct colnames from arguments. - - the model dict is ordered after python3.6, so we can use that minus - anything in :attr:`.NON_COLUMN_FIELDS` to determine order implied from passage order - """ - if "colnames" not in model: - colnames = [ - k - for k in model.keys() - if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") - ] - model["colnames"] = colnames - else: - # add any columns not explicitly given an order at the end - colnames = [ - k - for k in model.keys() - if k not in cls.NON_COLUMN_FIELDS - and not k.endswith("_index") - and k not in model["colnames"].keys() - ] - model["colnames"].extend(colnames) - return model - - @model_validator(mode="after") - def resolve_targets(self) -> "DynamicTableMixin": - """ - Ensure that any implicitly indexed columns are linked, and create backlinks - """ - for key, col in self._columns.items(): - if isinstance(col, VectorData): - # find an index - idx = None - for field_name in self.model_fields_set: - # implicit name-based index - field = getattr(self, field_name) - if isinstance(field, VectorIndex): - if field_name == f"{key}_index": - idx = field - break - elif field.target is col: - idx = field - break - if idx is not None: - col._index = idx - idx.target = col - return self - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.table/", - "id": "hdmf-common.table", - "imports": ["hdmf-common.base", "hdmf-common.nwb.language"], - "name": "hdmf-common.table", - } -) - - -class VectorData(VectorDataMixin): - """ - An n-dimensional dataset representing a column of a DynamicTable. If used without an accompanying VectorIndex, first dimension is along the rows of the DynamicTable and each step along the first dimension is a cell of the larger table. VectorData can also be used to represent a ragged array if paired with a VectorIndex. This allows for storing arrays of varying length in a single cell of the DynamicTable by indexing into this VectorData. The first vector is at VectorData[0:VectorIndex[0]]. The second vector is at VectorData[VectorIndex[0]:VectorIndex[1]], and so on. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - description: Optional[str] = Field( - None, description="""Description of what these vectors represent.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class VectorIndex(VectorIndexMixin): - """ - Used with VectorData to encode a ragged array. An array of indices into the first dimension of the target VectorData, and forming a map between the rows of a DynamicTable and the indices of the VectorData. The name of the VectorIndex is expected to be the name of the target VectorData object followed by \"_index\". - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - target: Optional[VectorData] = Field( - None, description="""Reference to the target dataset that this index applies to.""" - ) - description: Optional[str] = Field( - None, description="""Description of what these vectors represent.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class ElementIdentifiers(Data): - """ - A list of unique identifiers for values within a dataset, e.g. rows of a DynamicTable. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field( - "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} - ) - - -class DynamicTableRegion(VectorData): - """ - DynamicTableRegion provides a link from one table to an index or region of another. The `table` attribute is a link to another `DynamicTable`, indicating which table is referenced, and the data is int(s) indicating the row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to associate rows with repeated meta-data without data duplication. They can also be used to create hierarchical relationships between multiple `DynamicTable`s. `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create ragged references, so a single cell of a `DynamicTable` can reference many rows of another `DynamicTable`. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - table: Optional[DynamicTable] = Field( - None, description="""Reference to the DynamicTable object that this region applies to.""" - ) - description: Optional[str] = Field( - None, description="""Description of what this table region points to.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class DynamicTable(DynamicTableMixin): - """ - A group containing multiple datasets that are aligned on the first dimension (Currently, this requirement if left up to APIs to check and enforce). These datasets represent different columns in the table. Apart from a column that contains unique identifiers for each row, there are no other required datasets. Users are free to add any number of custom VectorData objects (columns) here. DynamicTable also supports ragged array columns, where each element can be of a different size. To add a ragged array column, use a VectorIndex type to index the corresponding VectorData type. See documentation for VectorData and VectorIndex for more details. Unlike a compound data type, which is analogous to storing an array-of-structs, a DynamicTable can be thought of as a struct-of-arrays. This provides an alternative structure to choose from when optimizing storage for anticipated access patterns. Additionally, this type provides a way of creating a table without having to define a compound type up front. Although this convenience may be attractive, users should think carefully about how data will be accessed. DynamicTable is more appropriate for column-centric access, whereas a dataset with a compound type would be more appropriate for row-centric access. Finally, data size should also be taken into account. For small tables, performance loss may be an acceptable trade-off for the flexibility of a DynamicTable. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - colnames: Optional[str] = Field( - None, - description="""The names of the columns in this table. This should be used to specify an order to the columns.""", - ) - description: Optional[str] = Field( - None, description="""Description of what is in this dynamic table.""" - ) - id: NDArray[Shape["* num_rows"], int] = Field( - ..., - description="""Array of unique identifiers for the rows of this dynamic table.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, - ) - vector_data: Optional[List[VectorData]] = Field( - None, description="""Vector columns, including index columns, of this dynamic table.""" - ) - - -class AlignedDynamicTable(DynamicTable): - """ - DynamicTable container that supports storing a collection of sub-tables. Each sub-table is a DynamicTable itself that is aligned with the main table by row index. I.e., all DynamicTables stored in this group MUST have the same number of rows. This type effectively defines a 2-level table in which the main data is stored in the main table implemented by this type and additional columns of the table are grouped into categories, with each category being represented by a separate DynamicTable stored within the group. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - children: Optional[List[DynamicTable]] = Field( - None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "DynamicTable"}]}} - ) - name: str = Field(...) - colnames: Optional[str] = Field( - None, - description="""The names of the columns in this table. This should be used to specify an order to the columns.""", - ) - description: Optional[str] = Field( - None, description="""Description of what is in this dynamic table.""" - ) - id: NDArray[Shape["* num_rows"], int] = Field( - ..., - description="""Array of unique identifiers for the rows of this dynamic table.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, - ) - vector_data: Optional[List[VectorData]] = Field( - None, description="""Vector columns, including index columns, of this dynamic table.""" - ) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -VectorData.model_rebuild() -VectorIndex.model_rebuild() -ElementIdentifiers.model_rebuild() -DynamicTableRegion.model_rebuild() -DynamicTable.model_rebuild() -AlignedDynamicTable.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_6_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_6_0/namespace.py deleted file mode 100644 index 1dc832f..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_6_0/namespace.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_common.v1_6_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_6_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_6_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) - -metamodel_version = "None" -version = "1.6.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": True}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common/", - "description": "Common data structures provided by HDMF", - "id": "hdmf-common", - "imports": [ - "hdmf-common.base", - "hdmf-common.table", - "hdmf-common.sparse", - "hdmf-common.nwb.language", - ], - "name": "hdmf-common", - } -) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_7_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_7_0/__init__.py deleted file mode 100644 index 8b13789..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_7_0/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_7_0/hdmf_common_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_7_0/hdmf_common_base.py deleted file mode 100644 index 751693c..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_7_0/hdmf_common_base.py +++ /dev/null @@ -1,104 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np - -metamodel_version = "None" -version = "1.7.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.base/", - "id": "hdmf-common.base", - "imports": ["hdmf-common.nwb.language"], - "name": "hdmf-common.base", - } -) - - -class Data(ConfiguredBaseModel): - """ - An abstract data type for a dataset. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.base", "tree_root": True} - ) - - name: str = Field(...) - - -class Container(ConfiguredBaseModel): - """ - An abstract data type for a group storing collections of data and metadata. Base type for all data and metadata containers. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.base", "tree_root": True} - ) - - name: str = Field(...) - - -class SimpleMultiContainer(Container): - """ - A simple Container for holding onto multiple containers. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.base", "tree_root": True} - ) - - children: Optional[List[Container]] = Field( - None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "Container"}]}} - ) - name: str = Field(...) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -Data.model_rebuild() -Container.model_rebuild() -SimpleMultiContainer.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_7_0/hdmf_common_sparse.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_7_0/hdmf_common_sparse.py deleted file mode 100644 index c6bfab5..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_7_0/hdmf_common_sparse.py +++ /dev/null @@ -1,110 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_common.v1_7_0.hdmf_common_base import Container -from numpydantic import NDArray, Shape - -metamodel_version = "None" -version = "1.7.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -NUMPYDANTIC_VERSION = "1.2.1" -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.sparse/", - "id": "hdmf-common.sparse", - "imports": ["hdmf-common.base", "hdmf-common.nwb.language"], - "name": "hdmf-common.sparse", - } -) - - -class CSRMatrix(Container): - """ - A compressed sparse row matrix. Data are stored in the standard CSR format, where column indices for row i are stored in indices[indptr[i]:indptr[i+1]] and their corresponding values are stored in data[indptr[i]:indptr[i+1]]. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.sparse", "tree_root": True} - ) - - name: str = Field(...) - shape: Optional[np.uint64] = Field( - None, description="""The shape (number of rows, number of columns) of this sparse matrix.""" - ) - indices: NDArray[Shape["* number_of_non_zero_values"], np.uint64] = Field( - ..., - description="""The column indices.""", - json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "number_of_non_zero_values"}]}} - }, - ) - indptr: NDArray[Shape["* number_of_rows_in_the_matrix_1"], np.uint64] = Field( - ..., - description="""The row index pointer.""", - json_schema_extra={ - "linkml_meta": {"array": {"dimensions": [{"alias": "number_of_rows_in_the_matrix_1"}]}} - }, - ) - data: CSRMatrixData = Field(..., description="""The non-zero values in the matrix.""") - - -class CSRMatrixData(ConfiguredBaseModel): - """ - The non-zero values in the matrix. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-common.sparse"}) - - name: Literal["data"] = Field( - "data", - json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}, - ) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -CSRMatrix.model_rebuild() -CSRMatrixData.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_7_0/hdmf_common_table.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_7_0/hdmf_common_table.py deleted file mode 100644 index 65a9dd3..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_7_0/hdmf_common_table.py +++ /dev/null @@ -1,453 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -import numpy as np -from ...hdmf_common.v1_7_0.hdmf_common_base import Data, Container -from pandas import DataFrame -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, overload, Tuple -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, model_validator -from numpydantic import NDArray, Shape - -metamodel_version = "None" -version = "1.7.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -NUMPYDANTIC_VERSION = "1.2.1" - - -class VectorDataMixin(BaseModel): - """ - Mixin class to give VectorData indexing abilities - """ - - _index: Optional["VectorIndex"] = None - - # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None - - def __getitem__(self, item: Union[str, int, slice, Tuple[Union[str, int, slice], ...]]) -> Any: - if self._index: - # Following hdmf, VectorIndex is the thing that knows how to do the slicing - return self._index[item] - else: - return self.array[item] - - def __setitem__(self, key, value) -> None: - if self._index: - # Following hdmf, VectorIndex is the thing that knows how to do the slicing - self._index[key] = value - else: - self.array[key] = value - - -class VectorIndexMixin(BaseModel): - """ - Mixin class to give VectorIndex indexing abilities - """ - - # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None - target: Optional["VectorData"] = None - - def _getitem_helper(self, arg: int): - """ - Mimicking :func:`hdmf.common.table.VectorIndex.__getitem_helper` - """ - - start = 0 if arg == 0 else self.array[arg - 1] - end = self.array[arg] - return self.target.array[slice(start, end)] - - def __getitem__(self, item: Union[int, slice]) -> Any: - if self.target is None: - return self.array[item] - elif type(self.target).__name__ == "VectorData": - if isinstance(item, int): - return self._getitem_helper(item) - else: - idx = range(*item.indices(len(self.array))) - return [self._getitem_helper(i) for i in idx] - else: - raise NotImplementedError("DynamicTableRange not supported yet") - - def __setitem__(self, key, value) -> None: - if self._index: - # VectorIndex is the thing that knows how to do the slicing - self._index[key] = value - else: - self.array[key] = value - - -class DynamicTableMixin(BaseModel): - """ - Mixin to make DynamicTable subclasses behave like tables/dataframes - - Mimicking some of the behavior from :class:`hdmf.common.table.DynamicTable` - but simplifying along the way :) - """ - - model_config = ConfigDict(extra="allow") - __pydantic_extra__: Dict[str, Union[list, "NDArray", "VectorData"]] - NON_COLUMN_FIELDS: ClassVar[tuple[str]] = ( - "name", - "colnames", - "description", - ) - - # overridden by subclass but implemented here for testing and typechecking purposes :) - colnames: List[str] = Field(default_factory=list) - - @property - def _columns(self) -> Dict[str, Union[list, "NDArray", "VectorData"]]: - return {k: getattr(self, k) for i, k in enumerate(self.colnames)} - - @property - def _columns_list(self) -> List[Union[list, "NDArray", "VectorData"]]: - return [getattr(self, k) for i, k in enumerate(self.colnames)] - - @overload - def __getitem__(self, item: str) -> Union[list, "NDArray", "VectorData"]: ... - - @overload - def __getitem__(self, item: int) -> DataFrame: ... - - @overload - def __getitem__(self, item: Tuple[int, Union[int, str]]) -> Any: ... - - @overload - def __getitem__(self, item: Tuple[Union[int, slice], ...]) -> Union[ - DataFrame, - list, - "NDArray", - "VectorData", - ]: ... - - @overload - def __getitem__(self, item: slice) -> DataFrame: ... - - def __getitem__( - self, - item: Union[ - str, - int, - slice, - Tuple[int, Union[int, str]], - Tuple[Union[int, slice], ...], - ], - ) -> Any: - """ - Get an item from the table - - If item is... - - - ``str`` : get the column with this name - - ``int`` : get the row at this index - - ``tuple[int, int]`` : get a specific cell value eg. (0,1) gets the 0th row and 1st column - - ``tuple[int, str]`` : get a specific cell value eg. (0, 'colname') - gets the 0th row from ``colname`` - - ``tuple[int | slice, int | slice]`` : get a range of cells from a range of columns. - returns as a :class:`pandas.DataFrame` - """ - if isinstance(item, str): - return self._columns[item] - if isinstance(item, (int, slice)): - return DataFrame.from_dict(self._slice_range(item)) - elif isinstance(item, tuple): - if len(item) != 2: - raise ValueError( - "DynamicTables are 2-dimensional, can't index with more than 2 indices like" - f" {item}" - ) - - # all other cases are tuples of (rows, cols) - rows, cols = item - if isinstance(cols, (int, slice)): - cols = self.colnames[cols] - data = self._slice_range(rows, cols) - return DataFrame.from_dict(data) - else: - raise ValueError(f"Unsure how to get item with key {item}") - - def _slice_range( - self, rows: Union[int, slice], cols: Optional[Union[str, List[str]]] = None - ) -> Dict[str, Union[list, "NDArray", "VectorData"]]: - if cols is None: - cols = self.colnames - elif isinstance(cols, str): - cols = [cols] - - data = {k: self._columns[k][rows] for k in cols} - return data - - def __setitem__(self, key: str, value: Any) -> None: - raise NotImplementedError("TODO") - - def __setattr__(self, key: str, value: Union[list, "NDArray", "VectorData"]): - """ - Add a column, appending it to ``colnames`` - """ - # don't use this while building the model - if not getattr(self, "__pydantic_complete__", False): - return super().__setattr__(key, value) - - if key not in self.model_fields_set and not key.endswith("_index"): - self.colnames.append(key) - - return super().__setattr__(key, value) - - @model_validator(mode="before") - @classmethod - def create_colnames(cls, model: Dict[str, Any]): - """ - Construct colnames from arguments. - - the model dict is ordered after python3.6, so we can use that minus - anything in :attr:`.NON_COLUMN_FIELDS` to determine order implied from passage order - """ - if "colnames" not in model: - colnames = [ - k - for k in model.keys() - if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") - ] - model["colnames"] = colnames - else: - # add any columns not explicitly given an order at the end - colnames = [ - k - for k in model.keys() - if k not in cls.NON_COLUMN_FIELDS - and not k.endswith("_index") - and k not in model["colnames"].keys() - ] - model["colnames"].extend(colnames) - return model - - @model_validator(mode="after") - def resolve_targets(self) -> "DynamicTableMixin": - """ - Ensure that any implicitly indexed columns are linked, and create backlinks - """ - for key, col in self._columns.items(): - if isinstance(col, VectorData): - # find an index - idx = None - for field_name in self.model_fields_set: - # implicit name-based index - field = getattr(self, field_name) - if isinstance(field, VectorIndex): - if field_name == f"{key}_index": - idx = field - break - elif field.target is col: - idx = field - break - if idx is not None: - col._index = idx - idx.target = col - return self - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common.table/", - "id": "hdmf-common.table", - "imports": ["hdmf-common.base", "hdmf-common.nwb.language"], - "name": "hdmf-common.table", - } -) - - -class VectorData(VectorDataMixin): - """ - An n-dimensional dataset representing a column of a DynamicTable. If used without an accompanying VectorIndex, first dimension is along the rows of the DynamicTable and each step along the first dimension is a cell of the larger table. VectorData can also be used to represent a ragged array if paired with a VectorIndex. This allows for storing arrays of varying length in a single cell of the DynamicTable by indexing into this VectorData. The first vector is at VectorData[0:VectorIndex[0]]. The second vector is at VectorData[VectorIndex[0]:VectorIndex[1]], and so on. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - description: Optional[str] = Field( - None, description="""Description of what these vectors represent.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class VectorIndex(VectorIndexMixin): - """ - Used with VectorData to encode a ragged array. An array of indices into the first dimension of the target VectorData, and forming a map between the rows of a DynamicTable and the indices of the VectorData. The name of the VectorIndex is expected to be the name of the target VectorData object followed by \"_index\". - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - target: Optional[VectorData] = Field( - None, description="""Reference to the target dataset that this index applies to.""" - ) - description: Optional[str] = Field( - None, description="""Description of what these vectors represent.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class ElementIdentifiers(Data): - """ - A list of unique identifiers for values within a dataset, e.g. rows of a DynamicTable. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field( - "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} - ) - - -class DynamicTableRegion(VectorData): - """ - DynamicTableRegion provides a link from one table to an index or region of another. The `table` attribute is a link to another `DynamicTable`, indicating which table is referenced, and the data is int(s) indicating the row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to associate rows with repeated meta-data without data duplication. They can also be used to create hierarchical relationships between multiple `DynamicTable`s. `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create ragged references, so a single cell of a `DynamicTable` can reference many rows of another `DynamicTable`. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - table: Optional[DynamicTable] = Field( - None, description="""Reference to the DynamicTable object that this region applies to.""" - ) - description: Optional[str] = Field( - None, description="""Description of what this table region points to.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -class DynamicTable(DynamicTableMixin): - """ - A group containing multiple datasets that are aligned on the first dimension (Currently, this requirement if left up to APIs to check and enforce). These datasets represent different columns in the table. Apart from a column that contains unique identifiers for each row, there are no other required datasets. Users are free to add any number of custom VectorData objects (columns) here. DynamicTable also supports ragged array columns, where each element can be of a different size. To add a ragged array column, use a VectorIndex type to index the corresponding VectorData type. See documentation for VectorData and VectorIndex for more details. Unlike a compound data type, which is analogous to storing an array-of-structs, a DynamicTable can be thought of as a struct-of-arrays. This provides an alternative structure to choose from when optimizing storage for anticipated access patterns. Additionally, this type provides a way of creating a table without having to define a compound type up front. Although this convenience may be attractive, users should think carefully about how data will be accessed. DynamicTable is more appropriate for column-centric access, whereas a dataset with a compound type would be more appropriate for row-centric access. Finally, data size should also be taken into account. For small tables, performance loss may be an acceptable trade-off for the flexibility of a DynamicTable. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - name: str = Field(...) - colnames: Optional[str] = Field( - None, - description="""The names of the columns in this table. This should be used to specify an order to the columns.""", - ) - description: Optional[str] = Field( - None, description="""Description of what is in this dynamic table.""" - ) - id: NDArray[Shape["* num_rows"], int] = Field( - ..., - description="""Array of unique identifiers for the rows of this dynamic table.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, - ) - vector_data: Optional[List[VectorData]] = Field( - None, description="""Vector columns, including index columns, of this dynamic table.""" - ) - - -class AlignedDynamicTable(DynamicTable): - """ - DynamicTable container that supports storing a collection of sub-tables. Each sub-table is a DynamicTable itself that is aligned with the main table by row index. I.e., all DynamicTables stored in this group MUST have the same number of rows. This type effectively defines a 2-level table in which the main data is stored in the main table implemented by this type and additional columns of the table are grouped into categories, with each category being represented by a separate DynamicTable stored within the group. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-common.table", "tree_root": True} - ) - - children: Optional[List[DynamicTable]] = Field( - None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "DynamicTable"}]}} - ) - name: str = Field(...) - colnames: Optional[str] = Field( - None, - description="""The names of the columns in this table. This should be used to specify an order to the columns.""", - ) - description: Optional[str] = Field( - None, description="""Description of what is in this dynamic table.""" - ) - id: NDArray[Shape["* num_rows"], int] = Field( - ..., - description="""Array of unique identifiers for the rows of this dynamic table.""", - json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}}, - ) - vector_data: Optional[List[VectorData]] = Field( - None, description="""Vector columns, including index columns, of this dynamic table.""" - ) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -VectorData.model_rebuild() -VectorIndex.model_rebuild() -ElementIdentifiers.model_rebuild() -DynamicTableRegion.model_rebuild() -DynamicTable.model_rebuild() -AlignedDynamicTable.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_7_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_7_0/namespace.py deleted file mode 100644 index 7d70e39..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_7_0/namespace.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_common.v1_7_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_7_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_7_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) - -metamodel_version = "None" -version = "1.7.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": True}, - "namespace": {"tag": "namespace", "value": "hdmf-common"}, - }, - "default_prefix": "hdmf-common/", - "description": "Common data structures provided by HDMF", - "id": "hdmf-common", - "imports": [ - "hdmf-common.base", - "hdmf-common.table", - "hdmf-common.sparse", - "hdmf-common.nwb.language", - ], - "name": "hdmf-common", - } -) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/hdmf_common_sparse.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/hdmf_common_sparse.py index 230460c..56fad93 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/hdmf_common_sparse.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/hdmf_common_sparse.py @@ -71,17 +71,17 @@ class CSRMatrix(Container): ) name: str = Field(...) - shape: Optional[np.uint64] = Field( + shape: Optional[int] = Field( None, description="""The shape (number of rows, number of columns) of this sparse matrix.""" ) - indices: NDArray[Shape["* number_of_non_zero_values"], np.uint64] = Field( + indices: NDArray[Shape["* number_of_non_zero_values"], int] = Field( ..., description="""The column indices.""", json_schema_extra={ "linkml_meta": {"array": {"dimensions": [{"alias": "number_of_non_zero_values"}]}} }, ) - indptr: NDArray[Shape["* number_of_rows_in_the_matrix_1"], np.uint64] = Field( + indptr: NDArray[Shape["* number_of_rows_in_the_matrix_1"], int] = Field( ..., description="""The row index pointer.""", json_schema_extra={ diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/hdmf_common_table.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/hdmf_common_table.py index 986c628..e9ce91d 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/hdmf_common_table.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_8_0/hdmf_common_table.py @@ -67,7 +67,7 @@ class VectorDataMixin(BaseModel): else: return self.array[item] - def __setitem__(self, key, value) -> None: + def __setitem__(self, key: Union[int, str, slice], value: Any) -> None: if self._index: # Following hdmf, VectorIndex is the thing that knows how to do the slicing self._index[key] = value @@ -84,7 +84,7 @@ class VectorIndexMixin(BaseModel): array: Optional[NDArray] = None target: Optional["VectorData"] = None - def _getitem_helper(self, arg: int): + def _getitem_helper(self, arg: int) -> Union[list, NDArray]: """ Mimicking :func:`hdmf.common.table.VectorIndex.__getitem_helper` """ @@ -105,7 +105,7 @@ class VectorIndexMixin(BaseModel): else: raise NotImplementedError("DynamicTableRange not supported yet") - def __setitem__(self, key, value) -> None: + def __setitem__(self, key: Union[int, slice], value: Any) -> None: if self._index: # VectorIndex is the thing that knows how to do the slicing self._index[key] = value @@ -122,7 +122,7 @@ class DynamicTableMixin(BaseModel): """ model_config = ConfigDict(extra="allow") - __pydantic_extra__: Dict[str, Union[list, "NDArray", "VectorData"]] + __pydantic_extra__: Dict[str, Union[list, "NDArray", "VectorDataMixin"]] NON_COLUMN_FIELDS: ClassVar[tuple[str]] = ( "name", "colnames", @@ -133,15 +133,15 @@ class DynamicTableMixin(BaseModel): colnames: List[str] = Field(default_factory=list) @property - def _columns(self) -> Dict[str, Union[list, "NDArray", "VectorData"]]: + def _columns(self) -> Dict[str, Union[list, "NDArray", "VectorDataMixin"]]: return {k: getattr(self, k) for i, k in enumerate(self.colnames)} @property - def _columns_list(self) -> List[Union[list, "NDArray", "VectorData"]]: + def _columns_list(self) -> List[Union[list, "NDArray", "VectorDataMixin"]]: return [getattr(self, k) for i, k in enumerate(self.colnames)] @overload - def __getitem__(self, item: str) -> Union[list, "NDArray", "VectorData"]: ... + def __getitem__(self, item: str) -> Union[list, "NDArray", "VectorDataMixin"]: ... @overload def __getitem__(self, item: int) -> DataFrame: ... @@ -154,7 +154,7 @@ class DynamicTableMixin(BaseModel): DataFrame, list, "NDArray", - "VectorData", + "VectorDataMixin", ]: ... @overload @@ -232,7 +232,7 @@ class DynamicTableMixin(BaseModel): @model_validator(mode="before") @classmethod - def create_colnames(cls, model: Dict[str, Any]): + def create_colnames(cls, model: Dict[str, Any]) -> None: """ Construct colnames from arguments. @@ -241,19 +241,17 @@ class DynamicTableMixin(BaseModel): """ if "colnames" not in model: colnames = [ - k - for k in model.keys() - if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") + k for k in model if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") ] model["colnames"] = colnames else: # add any columns not explicitly given an order at the end colnames = [ k - for k in model.keys() + for k in model if k not in cls.NON_COLUMN_FIELDS and not k.endswith("_index") - and k not in model["colnames"].keys() + and k not in model["colnames"] ] model["colnames"].extend(colnames) return model @@ -270,13 +268,11 @@ class DynamicTableMixin(BaseModel): for field_name in self.model_fields_set: # implicit name-based index field = getattr(self, field_name) - if isinstance(field, VectorIndex): - if field_name == f"{key}_index": - idx = field - break - elif field.target is col: - idx = field - break + if isinstance(field, VectorIndex) and ( + field_name == f"{key}_index" or field.target is col + ): + idx = field + break if idx is not None: col._index = idx idx.target = col diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_experimental.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_experimental.py index 0ca8353..065f135 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_experimental.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_experimental.py @@ -7,7 +7,7 @@ import sys from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator import numpy as np -from ...hdmf_common.v1_4_0.hdmf_common_table import VectorData +from ...hdmf_common.v1_5_0.hdmf_common_table import VectorData from numpydantic import NDArray, Shape metamodel_version = "None" @@ -55,7 +55,7 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "hdmf-experimental.experimental/", "id": "hdmf-experimental.experimental", - "imports": ["../../hdmf_common/v1_4_0/namespace", "hdmf-experimental.nwb.language"], + "imports": ["../../hdmf_common/v1_5_0/namespace", "hdmf-experimental.nwb.language"], "name": "hdmf-experimental.experimental", } ) diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_resources.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_resources.py index affdb23..366822a 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_resources.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_resources.py @@ -7,7 +7,7 @@ import sys from typing import Any, ClassVar, List, Literal, Dict, Optional, Union from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator import numpy as np -from ...hdmf_common.v1_4_0.hdmf_common_base import Container, Data +from ...hdmf_common.v1_5_0.hdmf_common_base import Container, Data metamodel_version = "None" version = "0.1.0" @@ -53,7 +53,7 @@ linkml_meta = LinkMLMeta( }, "default_prefix": "hdmf-experimental.resources/", "id": "hdmf-experimental.resources", - "imports": ["../../hdmf_common/v1_4_0/namespace", "hdmf-experimental.nwb.language"], + "imports": ["../../hdmf_common/v1_5_0/namespace", "hdmf-experimental.nwb.language"], "name": "hdmf-experimental.resources", } ) @@ -118,8 +118,8 @@ class ExternalResourcesEntities(Data): "linkml_meta": {"equals_string": "entities", "ifabsent": "string(entities)"} }, ) - keys_idx: np.uint64 = Field(..., description="""The index to the key in the 'keys' table.""") - resources_idx: np.uint64 = Field(..., description="""The index into the 'resources' table""") + keys_idx: int = Field(..., description="""The index to the key in the 'keys' table.""") + resources_idx: int = Field(..., description="""The index into the 'resources' table""") entity_id: str = Field(..., description="""The unique identifier entity.""") entity_uri: str = Field( ..., @@ -179,10 +179,10 @@ class ExternalResourcesObjectKeys(Data): "linkml_meta": {"equals_string": "object_keys", "ifabsent": "string(object_keys)"} }, ) - objects_idx: np.uint64 = Field( + objects_idx: int = Field( ..., description="""The index to the 'objects' table for the object that holds the key.""" ) - keys_idx: np.uint64 = Field(..., description="""The index to the 'keys' table for the key.""") + keys_idx: int = Field(..., description="""The index to the 'keys' table for the key.""") # Model rebuild diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/namespace.py index 7ea10f7..69ffad1 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/namespace.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/namespace.py @@ -15,14 +15,15 @@ from ...hdmf_experimental.v0_1_0.hdmf_experimental_resources import ( ExternalResourcesObjects, ExternalResourcesObjectKeys, ) -from ...hdmf_common.v1_4_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_4_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_4_0.hdmf_common_table import ( +from ...hdmf_common.v1_5_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData +from ...hdmf_common.v1_5_0.hdmf_common_base import Data, Container, SimpleMultiContainer +from ...hdmf_common.v1_5_0.hdmf_common_table import ( VectorData, VectorIndex, ElementIdentifiers, DynamicTableRegion, DynamicTable, + AlignedDynamicTable, ) from ...hdmf_experimental.v0_1_0.hdmf_experimental_experimental import EnumData diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_2_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_2_0/__init__.py deleted file mode 100644 index 8b13789..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_2_0/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_2_0/hdmf_experimental_experimental.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_2_0/hdmf_experimental_experimental.py deleted file mode 100644 index 7fef3e3..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_2_0/hdmf_experimental_experimental.py +++ /dev/null @@ -1,93 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_common.v1_5_1.hdmf_common_table import VectorData -from numpydantic import NDArray, Shape - -metamodel_version = "None" -version = "0.2.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -NUMPYDANTIC_VERSION = "1.2.1" -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-experimental"}, - }, - "default_prefix": "hdmf-experimental.experimental/", - "id": "hdmf-experimental.experimental", - "imports": ["../../hdmf_common/v1_5_1/namespace", "hdmf-experimental.nwb.language"], - "name": "hdmf-experimental.experimental", - } -) - - -class EnumData(VectorData): - """ - Data that come from a fixed set of values. A data value of i corresponds to the i-th value in the VectorData referenced by the 'elements' attribute. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-experimental.experimental", "tree_root": True} - ) - - name: str = Field(...) - elements: Optional[VectorData] = Field( - None, - description="""Reference to the VectorData object that contains the enumerable elements""", - ) - description: Optional[str] = Field( - None, description="""Description of what these vectors represent.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -EnumData.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_2_0/hdmf_experimental_resources.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_2_0/hdmf_experimental_resources.py deleted file mode 100644 index 7606660..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_2_0/hdmf_experimental_resources.py +++ /dev/null @@ -1,199 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_common.v1_5_1.hdmf_common_base import Container, Data - -metamodel_version = "None" -version = "0.2.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-experimental"}, - }, - "default_prefix": "hdmf-experimental.resources/", - "id": "hdmf-experimental.resources", - "imports": ["../../hdmf_common/v1_5_1/namespace", "hdmf-experimental.nwb.language"], - "name": "hdmf-experimental.resources", - } -) - - -class ExternalResources(Container): - """ - A set of four tables for tracking external resource references in a file. NOTE: this data type is in beta testing and is subject to change in a later version. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-experimental.resources", "tree_root": True} - ) - - name: str = Field(...) - keys: ExternalResourcesKeys = Field( - ..., - description="""A table for storing user terms that are used to refer to external resources.""", - ) - entities: ExternalResourcesEntities = Field( - ..., description="""A table for mapping user terms (i.e., keys) to resource entities.""" - ) - resources: ExternalResourcesResources = Field( - ..., description="""A table for mapping user terms (i.e., keys) to resource entities.""" - ) - objects: ExternalResourcesObjects = Field( - ..., - description="""A table for identifying which objects in a file contain references to external resources.""", - ) - object_keys: ExternalResourcesObjectKeys = Field( - ..., description="""A table for identifying which objects use which keys.""" - ) - - -class ExternalResourcesKeys(Data): - """ - A table for storing user terms that are used to refer to external resources. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) - - name: Literal["keys"] = Field( - "keys", - json_schema_extra={"linkml_meta": {"equals_string": "keys", "ifabsent": "string(keys)"}}, - ) - key: str = Field( - ..., - description="""The user term that maps to one or more resources in the 'resources' table.""", - ) - - -class ExternalResourcesEntities(Data): - """ - A table for mapping user terms (i.e., keys) to resource entities. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) - - name: Literal["entities"] = Field( - "entities", - json_schema_extra={ - "linkml_meta": {"equals_string": "entities", "ifabsent": "string(entities)"} - }, - ) - keys_idx: np.uint64 = Field(..., description="""The index to the key in the 'keys' table.""") - resources_idx: np.uint64 = Field(..., description="""The index into the 'resources' table""") - entity_id: str = Field(..., description="""The unique identifier entity.""") - entity_uri: str = Field( - ..., - description="""The URI for the entity this reference applies to. This can be an empty string.""", - ) - - -class ExternalResourcesResources(Data): - """ - A table for mapping user terms (i.e., keys) to resource entities. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) - - name: Literal["resources"] = Field( - "resources", - json_schema_extra={ - "linkml_meta": {"equals_string": "resources", "ifabsent": "string(resources)"} - }, - ) - resource: str = Field(..., description="""The name of the resource.""") - resource_uri: str = Field( - ..., description="""The URI for the resource. This can be an empty string.""" - ) - - -class ExternalResourcesObjects(Data): - """ - A table for identifying which objects in a file contain references to external resources. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) - - name: Literal["objects"] = Field( - "objects", - json_schema_extra={ - "linkml_meta": {"equals_string": "objects", "ifabsent": "string(objects)"} - }, - ) - object_id: str = Field(..., description="""The UUID for the object.""") - relative_path: str = Field( - ..., - description="""The relative path from the container with the object_id to the dataset or attribute with the value(s) that is associated with an external resource. This can be an empty string if the container is a dataset which contains the value(s) that is associated with an external resource.""", - ) - field: str = Field( - ..., - description="""The field of the compound data type using an external resource. This is used only if the dataset or attribute is a compound data type; otherwise this should be an empty string.""", - ) - - -class ExternalResourcesObjectKeys(Data): - """ - A table for identifying which objects use which keys. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) - - name: Literal["object_keys"] = Field( - "object_keys", - json_schema_extra={ - "linkml_meta": {"equals_string": "object_keys", "ifabsent": "string(object_keys)"} - }, - ) - objects_idx: np.uint64 = Field( - ..., description="""The index to the 'objects' table for the object that holds the key.""" - ) - keys_idx: np.uint64 = Field(..., description="""The index to the 'keys' table for the key.""") - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -ExternalResources.model_rebuild() -ExternalResourcesKeys.model_rebuild() -ExternalResourcesEntities.model_rebuild() -ExternalResourcesResources.model_rebuild() -ExternalResourcesObjects.model_rebuild() -ExternalResourcesObjectKeys.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_2_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_2_0/namespace.py deleted file mode 100644 index 1345536..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_2_0/namespace.py +++ /dev/null @@ -1,89 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_experimental.v0_2_0.hdmf_experimental_resources import ( - ExternalResources, - ExternalResourcesKeys, - ExternalResourcesEntities, - ExternalResourcesResources, - ExternalResourcesObjects, - ExternalResourcesObjectKeys, -) -from ...hdmf_common.v1_5_1.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_5_1.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_5_1.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) -from ...hdmf_experimental.v0_2_0.hdmf_experimental_experimental import EnumData - -metamodel_version = "None" -version = "0.2.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": True}, - "namespace": {"tag": "namespace", "value": "hdmf-experimental"}, - }, - "default_prefix": "hdmf-experimental/", - "description": ( - "Experimental data structures provided by HDMF. These are not " - "guaranteed to be available in the future." - ), - "id": "hdmf-experimental", - "imports": [ - "hdmf-experimental.experimental", - "hdmf-experimental.resources", - "hdmf-experimental.nwb.language", - ], - "name": "hdmf-experimental", - } -) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_3_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_3_0/__init__.py deleted file mode 100644 index 8b13789..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_3_0/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_3_0/hdmf_experimental_experimental.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_3_0/hdmf_experimental_experimental.py deleted file mode 100644 index f57439f..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_3_0/hdmf_experimental_experimental.py +++ /dev/null @@ -1,93 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_common.v1_6_0.hdmf_common_table import VectorData -from numpydantic import NDArray, Shape - -metamodel_version = "None" -version = "0.3.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -NUMPYDANTIC_VERSION = "1.2.1" -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-experimental"}, - }, - "default_prefix": "hdmf-experimental.experimental/", - "id": "hdmf-experimental.experimental", - "imports": ["../../hdmf_common/v1_6_0/namespace", "hdmf-experimental.nwb.language"], - "name": "hdmf-experimental.experimental", - } -) - - -class EnumData(VectorData): - """ - Data that come from a fixed set of values. A data value of i corresponds to the i-th value in the VectorData referenced by the 'elements' attribute. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-experimental.experimental", "tree_root": True} - ) - - name: str = Field(...) - elements: Optional[VectorData] = Field( - None, - description="""Reference to the VectorData object that contains the enumerable elements""", - ) - description: Optional[str] = Field( - None, description="""Description of what these vectors represent.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -EnumData.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_3_0/hdmf_experimental_resources.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_3_0/hdmf_experimental_resources.py deleted file mode 100644 index 600eb18..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_3_0/hdmf_experimental_resources.py +++ /dev/null @@ -1,207 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_common.v1_6_0.hdmf_common_base import Container, Data - -metamodel_version = "None" -version = "0.3.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-experimental"}, - }, - "default_prefix": "hdmf-experimental.resources/", - "id": "hdmf-experimental.resources", - "imports": ["../../hdmf_common/v1_6_0/namespace", "hdmf-experimental.nwb.language"], - "name": "hdmf-experimental.resources", - } -) - - -class ExternalResources(Container): - """ - A set of five tables for tracking external resource references in a file. NOTE: this data type is experimental and is subject to change in a later version. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-experimental.resources", "tree_root": True} - ) - - name: str = Field(...) - keys: ExternalResourcesKeys = Field( - ..., - description="""A table for storing user terms that are used to refer to external resources.""", - ) - files: ExternalResourcesFiles = Field( - ..., description="""A table for storing object ids of files used in external resources.""" - ) - entities: ExternalResourcesEntities = Field( - ..., description="""A table for mapping user terms (i.e., keys) to resource entities.""" - ) - objects: ExternalResourcesObjects = Field( - ..., - description="""A table for identifying which objects in a file contain references to external resources.""", - ) - object_keys: ExternalResourcesObjectKeys = Field( - ..., description="""A table for identifying which objects use which keys.""" - ) - - -class ExternalResourcesKeys(Data): - """ - A table for storing user terms that are used to refer to external resources. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) - - name: Literal["keys"] = Field( - "keys", - json_schema_extra={"linkml_meta": {"equals_string": "keys", "ifabsent": "string(keys)"}}, - ) - key: str = Field( - ..., - description="""The user term that maps to one or more resources in the `resources` table, e.g., \"human\".""", - ) - - -class ExternalResourcesFiles(Data): - """ - A table for storing object ids of files used in external resources. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) - - name: Literal["files"] = Field( - "files", - json_schema_extra={"linkml_meta": {"equals_string": "files", "ifabsent": "string(files)"}}, - ) - file_object_id: str = Field( - ..., - description="""The object id (UUID) of a file that contains objects that refers to external resources.""", - ) - - -class ExternalResourcesEntities(Data): - """ - A table for mapping user terms (i.e., keys) to resource entities. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) - - name: Literal["entities"] = Field( - "entities", - json_schema_extra={ - "linkml_meta": {"equals_string": "entities", "ifabsent": "string(entities)"} - }, - ) - keys_idx: np.uint64 = Field( - ..., description="""The row index to the key in the `keys` table.""" - ) - entity_id: str = Field( - ..., - description="""The compact uniform resource identifier (CURIE) of the entity, in the form [prefix]:[unique local identifier], e.g., 'NCBI_TAXON:9606'.""", - ) - entity_uri: str = Field( - ..., - description="""The URI for the entity this reference applies to. This can be an empty string. e.g., https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=info&id=9606""", - ) - - -class ExternalResourcesObjects(Data): - """ - A table for identifying which objects in a file contain references to external resources. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) - - name: Literal["objects"] = Field( - "objects", - json_schema_extra={ - "linkml_meta": {"equals_string": "objects", "ifabsent": "string(objects)"} - }, - ) - files_idx: np.uint64 = Field( - ..., description="""The row index to the file in the `files` table containing the object.""" - ) - object_id: str = Field(..., description="""The object id (UUID) of the object.""") - object_type: str = Field(..., description="""The data type of the object.""") - relative_path: str = Field( - ..., - description="""The relative path from the data object with the `object_id` to the dataset or attribute with the value(s) that is associated with an external resource. This can be an empty string if the object is a dataset that contains the value(s) that is associated with an external resource.""", - ) - field: str = Field( - ..., - description="""The field within the compound data type using an external resource. This is used only if the dataset or attribute is a compound data type; otherwise this should be an empty string.""", - ) - - -class ExternalResourcesObjectKeys(Data): - """ - A table for identifying which objects use which keys. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) - - name: Literal["object_keys"] = Field( - "object_keys", - json_schema_extra={ - "linkml_meta": {"equals_string": "object_keys", "ifabsent": "string(object_keys)"} - }, - ) - objects_idx: np.uint64 = Field( - ..., description="""The row index to the object in the `objects` table that holds the key""" - ) - keys_idx: np.uint64 = Field( - ..., description="""The row index to the key in the `keys` table.""" - ) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -ExternalResources.model_rebuild() -ExternalResourcesKeys.model_rebuild() -ExternalResourcesFiles.model_rebuild() -ExternalResourcesEntities.model_rebuild() -ExternalResourcesObjects.model_rebuild() -ExternalResourcesObjectKeys.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_3_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_3_0/namespace.py deleted file mode 100644 index 8361004..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_3_0/namespace.py +++ /dev/null @@ -1,89 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_experimental.v0_3_0.hdmf_experimental_resources import ( - ExternalResources, - ExternalResourcesKeys, - ExternalResourcesFiles, - ExternalResourcesEntities, - ExternalResourcesObjects, - ExternalResourcesObjectKeys, -) -from ...hdmf_common.v1_6_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_6_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_6_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) -from ...hdmf_experimental.v0_3_0.hdmf_experimental_experimental import EnumData - -metamodel_version = "None" -version = "0.3.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": True}, - "namespace": {"tag": "namespace", "value": "hdmf-experimental"}, - }, - "default_prefix": "hdmf-experimental/", - "description": ( - "Experimental data structures provided by HDMF. These are not " - "guaranteed to be available in the future." - ), - "id": "hdmf-experimental", - "imports": [ - "hdmf-experimental.experimental", - "hdmf-experimental.resources", - "hdmf-experimental.nwb.language", - ], - "name": "hdmf-experimental", - } -) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_4_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_4_0/__init__.py deleted file mode 100644 index 8b13789..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_4_0/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_4_0/hdmf_experimental_experimental.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_4_0/hdmf_experimental_experimental.py deleted file mode 100644 index 14e4d1a..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_4_0/hdmf_experimental_experimental.py +++ /dev/null @@ -1,93 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_common.v1_7_0.hdmf_common_table import VectorData -from numpydantic import NDArray, Shape - -metamodel_version = "None" -version = "0.4.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -NUMPYDANTIC_VERSION = "1.2.1" -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-experimental"}, - }, - "default_prefix": "hdmf-experimental.experimental/", - "id": "hdmf-experimental.experimental", - "imports": ["../../hdmf_common/v1_7_0/namespace", "hdmf-experimental.nwb.language"], - "name": "hdmf-experimental.experimental", - } -) - - -class EnumData(VectorData): - """ - Data that come from a fixed set of values. A data value of i corresponds to the i-th value in the VectorData referenced by the 'elements' attribute. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-experimental.experimental", "tree_root": True} - ) - - name: str = Field(...) - elements: Optional[VectorData] = Field( - None, - description="""Reference to the VectorData object that contains the enumerable elements""", - ) - description: Optional[str] = Field( - None, description="""Description of what these vectors represent.""" - ) - array: Optional[ - Union[ - NDArray[Shape["* dim0"], Any], - NDArray[Shape["* dim0, * dim1"], Any], - NDArray[Shape["* dim0, * dim1, * dim2"], Any], - NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any], - ] - ] = Field(None) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -EnumData.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_4_0/hdmf_experimental_resources.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_4_0/hdmf_experimental_resources.py deleted file mode 100644 index 6279463..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_4_0/hdmf_experimental_resources.py +++ /dev/null @@ -1,229 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_common.v1_7_0.hdmf_common_base import Container, Data - -metamodel_version = "None" -version = "0.4.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": False}, - "namespace": {"tag": "namespace", "value": "hdmf-experimental"}, - }, - "default_prefix": "hdmf-experimental.resources/", - "id": "hdmf-experimental.resources", - "imports": ["../../hdmf_common/v1_7_0/namespace", "hdmf-experimental.nwb.language"], - "name": "hdmf-experimental.resources", - } -) - - -class ExternalResources(Container): - """ - A set of five tables for tracking external resource references in a file. NOTE: this data type is experimental and is subject to change in a later version. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta( - {"from_schema": "hdmf-experimental.resources", "tree_root": True} - ) - - name: str = Field(...) - keys: ExternalResourcesKeys = Field( - ..., - description="""A table for storing user terms that are used to refer to external resources.""", - ) - files: ExternalResourcesFiles = Field( - ..., description="""A table for storing object ids of files used in external resources.""" - ) - entities: ExternalResourcesEntities = Field( - ..., description="""A table for mapping user terms (i.e., keys) to resource entities.""" - ) - objects: ExternalResourcesObjects = Field( - ..., - description="""A table for identifying which objects in a file contain references to external resources.""", - ) - object_keys: ExternalResourcesObjectKeys = Field( - ..., description="""A table for identifying which objects use which keys.""" - ) - entity_keys: ExternalResourcesEntityKeys = Field( - ..., description="""A table for identifying which keys use which entity.""" - ) - - -class ExternalResourcesKeys(Data): - """ - A table for storing user terms that are used to refer to external resources. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) - - name: Literal["keys"] = Field( - "keys", - json_schema_extra={"linkml_meta": {"equals_string": "keys", "ifabsent": "string(keys)"}}, - ) - key: str = Field( - ..., - description="""The user term that maps to one or more resources in the `resources` table, e.g., \"human\".""", - ) - - -class ExternalResourcesFiles(Data): - """ - A table for storing object ids of files used in external resources. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) - - name: Literal["files"] = Field( - "files", - json_schema_extra={"linkml_meta": {"equals_string": "files", "ifabsent": "string(files)"}}, - ) - file_object_id: str = Field( - ..., - description="""The object id (UUID) of a file that contains objects that refers to external resources.""", - ) - - -class ExternalResourcesEntities(Data): - """ - A table for mapping user terms (i.e., keys) to resource entities. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) - - name: Literal["entities"] = Field( - "entities", - json_schema_extra={ - "linkml_meta": {"equals_string": "entities", "ifabsent": "string(entities)"} - }, - ) - entity_id: str = Field( - ..., - description="""The compact uniform resource identifier (CURIE) of the entity, in the form [prefix]:[unique local identifier], e.g., 'NCBI_TAXON:9606'.""", - ) - entity_uri: str = Field( - ..., - description="""The URI for the entity this reference applies to. This can be an empty string. e.g., https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=info&id=9606""", - ) - - -class ExternalResourcesObjects(Data): - """ - A table for identifying which objects in a file contain references to external resources. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) - - name: Literal["objects"] = Field( - "objects", - json_schema_extra={ - "linkml_meta": {"equals_string": "objects", "ifabsent": "string(objects)"} - }, - ) - files_idx: np.uint64 = Field( - ..., description="""The row index to the file in the `files` table containing the object.""" - ) - object_id: str = Field(..., description="""The object id (UUID) of the object.""") - object_type: str = Field(..., description="""The data type of the object.""") - relative_path: str = Field( - ..., - description="""The relative path from the data object with the `object_id` to the dataset or attribute with the value(s) that is associated with an external resource. This can be an empty string if the object is a dataset that contains the value(s) that is associated with an external resource.""", - ) - field: str = Field( - ..., - description="""The field within the compound data type using an external resource. This is used only if the dataset or attribute is a compound data type; otherwise this should be an empty string.""", - ) - - -class ExternalResourcesObjectKeys(Data): - """ - A table for identifying which objects use which keys. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) - - name: Literal["object_keys"] = Field( - "object_keys", - json_schema_extra={ - "linkml_meta": {"equals_string": "object_keys", "ifabsent": "string(object_keys)"} - }, - ) - objects_idx: np.uint64 = Field( - ..., description="""The row index to the object in the `objects` table that holds the key""" - ) - keys_idx: np.uint64 = Field( - ..., description="""The row index to the key in the `keys` table.""" - ) - - -class ExternalResourcesEntityKeys(Data): - """ - A table for identifying which keys use which entity. - """ - - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "hdmf-experimental.resources"}) - - name: Literal["entity_keys"] = Field( - "entity_keys", - json_schema_extra={ - "linkml_meta": {"equals_string": "entity_keys", "ifabsent": "string(entity_keys)"} - }, - ) - entities_idx: np.uint64 = Field( - ..., description="""The row index to the entity in the `entities` table.""" - ) - keys_idx: np.uint64 = Field( - ..., description="""The row index to the key in the `keys` table.""" - ) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -ExternalResources.model_rebuild() -ExternalResourcesKeys.model_rebuild() -ExternalResourcesFiles.model_rebuild() -ExternalResourcesEntities.model_rebuild() -ExternalResourcesObjects.model_rebuild() -ExternalResourcesObjectKeys.model_rebuild() -ExternalResourcesEntityKeys.model_rebuild() diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_4_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_4_0/namespace.py deleted file mode 100644 index c642308..0000000 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_4_0/namespace.py +++ /dev/null @@ -1,90 +0,0 @@ -from __future__ import annotations -from datetime import datetime, date -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import Any, ClassVar, List, Literal, Dict, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator -import numpy as np -from ...hdmf_experimental.v0_4_0.hdmf_experimental_resources import ( - ExternalResources, - ExternalResourcesKeys, - ExternalResourcesFiles, - ExternalResourcesEntities, - ExternalResourcesObjects, - ExternalResourcesObjectKeys, - ExternalResourcesEntityKeys, -) -from ...hdmf_common.v1_7_0.hdmf_common_sparse import CSRMatrix, CSRMatrixData -from ...hdmf_common.v1_7_0.hdmf_common_base import Data, Container, SimpleMultiContainer -from ...hdmf_common.v1_7_0.hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable, -) -from ...hdmf_experimental.v0_4_0.hdmf_experimental_experimental import EnumData - -metamodel_version = "None" -version = "0.4.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra="forbid", - arbitrary_types_allowed=True, - use_enum_values=True, - strict=False, - ) - hdf5_path: Optional[str] = Field( - None, description="The absolute path that this object is stored in an NWB file" - ) - object_id: Optional[str] = Field(None, description="Unique UUID for each object") - - -class LinkMLMeta(RootModel): - root: Dict[str, Any] = {} - model_config = ConfigDict(frozen=True) - - def __getattr__(self, key: str): - return getattr(self.root, key) - - def __getitem__(self, key: str): - return self.root[key] - - def __setitem__(self, key: str, value): - self.root[key] = value - - def __contains__(self, key: str) -> bool: - return key in self.root - - -linkml_meta = LinkMLMeta( - { - "annotations": { - "is_namespace": {"tag": "is_namespace", "value": True}, - "namespace": {"tag": "namespace", "value": "hdmf-experimental"}, - }, - "default_prefix": "hdmf-experimental/", - "description": ( - "Experimental data structures provided by HDMF. These are not " - "guaranteed to be available in the future." - ), - "id": "hdmf-experimental", - "imports": [ - "hdmf-experimental.experimental", - "hdmf-experimental.resources", - "hdmf-experimental.nwb.language", - ], - "name": "hdmf-experimental", - } -) - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_5_0/hdmf_experimental_resources.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_5_0/hdmf_experimental_resources.py index cde0cca..8c33e35 100644 --- a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_5_0/hdmf_experimental_resources.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_5_0/hdmf_experimental_resources.py @@ -161,7 +161,7 @@ class HERDObjects(Data): "linkml_meta": {"equals_string": "objects", "ifabsent": "string(objects)"} }, ) - files_idx: np.uint64 = Field( + files_idx: int = Field( ..., description="""The row index to the file in the `files` table containing the object.""" ) object_id: str = Field(..., description="""The object id (UUID) of the object.""") @@ -189,12 +189,10 @@ class HERDObjectKeys(Data): "linkml_meta": {"equals_string": "object_keys", "ifabsent": "string(object_keys)"} }, ) - objects_idx: np.uint64 = Field( + objects_idx: int = Field( ..., description="""The row index to the object in the `objects` table that holds the key""" ) - keys_idx: np.uint64 = Field( - ..., description="""The row index to the key in the `keys` table.""" - ) + keys_idx: int = Field(..., description="""The row index to the key in the `keys` table.""") class HERDEntityKeys(Data): @@ -210,12 +208,10 @@ class HERDEntityKeys(Data): "linkml_meta": {"equals_string": "entity_keys", "ifabsent": "string(entity_keys)"} }, ) - entities_idx: np.uint64 = Field( + entities_idx: int = Field( ..., description="""The row index to the entity in the `entities` table.""" ) - keys_idx: np.uint64 = Field( - ..., description="""The row index to the key in the `keys` table.""" - ) + keys_idx: int = Field(..., description="""The row index to the key in the `keys` table.""") # Model rebuild diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.language.yaml index f48262a..e42c742 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.language.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.language.yaml @@ -19,67 +19,53 @@ types: float32: name: float32 typeof: float - repr: np.float32 float64: name: float64 typeof: double - repr: np.float64 long: name: long typeof: integer - repr: np.longlong int64: name: int64 typeof: integer - repr: np.int64 int: name: int typeof: integer int32: name: int32 typeof: integer - repr: np.int32 int16: name: int16 typeof: integer - repr: np.int16 short: name: short typeof: integer - repr: np.int16 int8: name: int8 typeof: integer - repr: np.int8 uint: name: uint typeof: integer - repr: np.uint64 minimum_value: 0 uint32: name: uint32 typeof: integer - repr: np.uint32 minimum_value: 0 uint16: name: uint16 typeof: integer - repr: np.uint16 minimum_value: 0 uint8: name: uint8 typeof: integer - repr: np.uint8 minimum_value: 0 uint64: name: uint64 typeof: integer - repr: np.uint64 minimum_value: 0 numeric: name: numeric typeof: float - repr: np.number text: name: text typeof: string @@ -101,7 +87,6 @@ types: isodatetime: name: isodatetime typeof: datetime - repr: np.datetime64 classes: AnyType: name: AnyType diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.language.yaml index f48262a..e42c742 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.language.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.language.yaml @@ -19,67 +19,53 @@ types: float32: name: float32 typeof: float - repr: np.float32 float64: name: float64 typeof: double - repr: np.float64 long: name: long typeof: integer - repr: np.longlong int64: name: int64 typeof: integer - repr: np.int64 int: name: int typeof: integer int32: name: int32 typeof: integer - repr: np.int32 int16: name: int16 typeof: integer - repr: np.int16 short: name: short typeof: integer - repr: np.int16 int8: name: int8 typeof: integer - repr: np.int8 uint: name: uint typeof: integer - repr: np.uint64 minimum_value: 0 uint32: name: uint32 typeof: integer - repr: np.uint32 minimum_value: 0 uint16: name: uint16 typeof: integer - repr: np.uint16 minimum_value: 0 uint8: name: uint8 typeof: integer - repr: np.uint8 minimum_value: 0 uint64: name: uint64 typeof: integer - repr: np.uint64 minimum_value: 0 numeric: name: numeric typeof: float - repr: np.number text: name: text typeof: string @@ -101,7 +87,6 @@ types: isodatetime: name: isodatetime typeof: datetime - repr: np.datetime64 classes: AnyType: name: AnyType diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.language.yaml index f48262a..e42c742 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.language.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.language.yaml @@ -19,67 +19,53 @@ types: float32: name: float32 typeof: float - repr: np.float32 float64: name: float64 typeof: double - repr: np.float64 long: name: long typeof: integer - repr: np.longlong int64: name: int64 typeof: integer - repr: np.int64 int: name: int typeof: integer int32: name: int32 typeof: integer - repr: np.int32 int16: name: int16 typeof: integer - repr: np.int16 short: name: short typeof: integer - repr: np.int16 int8: name: int8 typeof: integer - repr: np.int8 uint: name: uint typeof: integer - repr: np.uint64 minimum_value: 0 uint32: name: uint32 typeof: integer - repr: np.uint32 minimum_value: 0 uint16: name: uint16 typeof: integer - repr: np.uint16 minimum_value: 0 uint8: name: uint8 typeof: integer - repr: np.uint8 minimum_value: 0 uint64: name: uint64 typeof: integer - repr: np.uint64 minimum_value: 0 numeric: name: numeric typeof: float - repr: np.number text: name: text typeof: string @@ -101,7 +87,6 @@ types: isodatetime: name: isodatetime typeof: datetime - repr: np.datetime64 classes: AnyType: name: AnyType diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.language.yaml index f48262a..e42c742 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.language.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.language.yaml @@ -19,67 +19,53 @@ types: float32: name: float32 typeof: float - repr: np.float32 float64: name: float64 typeof: double - repr: np.float64 long: name: long typeof: integer - repr: np.longlong int64: name: int64 typeof: integer - repr: np.int64 int: name: int typeof: integer int32: name: int32 typeof: integer - repr: np.int32 int16: name: int16 typeof: integer - repr: np.int16 short: name: short typeof: integer - repr: np.int16 int8: name: int8 typeof: integer - repr: np.int8 uint: name: uint typeof: integer - repr: np.uint64 minimum_value: 0 uint32: name: uint32 typeof: integer - repr: np.uint32 minimum_value: 0 uint16: name: uint16 typeof: integer - repr: np.uint16 minimum_value: 0 uint8: name: uint8 typeof: integer - repr: np.uint8 minimum_value: 0 uint64: name: uint64 typeof: integer - repr: np.uint64 minimum_value: 0 numeric: name: numeric typeof: float - repr: np.number text: name: text typeof: string @@ -101,7 +87,6 @@ types: isodatetime: name: isodatetime typeof: datetime - repr: np.datetime64 classes: AnyType: name: AnyType diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.language.yaml index f48262a..e42c742 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.language.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.language.yaml @@ -19,67 +19,53 @@ types: float32: name: float32 typeof: float - repr: np.float32 float64: name: float64 typeof: double - repr: np.float64 long: name: long typeof: integer - repr: np.longlong int64: name: int64 typeof: integer - repr: np.int64 int: name: int typeof: integer int32: name: int32 typeof: integer - repr: np.int32 int16: name: int16 typeof: integer - repr: np.int16 short: name: short typeof: integer - repr: np.int16 int8: name: int8 typeof: integer - repr: np.int8 uint: name: uint typeof: integer - repr: np.uint64 minimum_value: 0 uint32: name: uint32 typeof: integer - repr: np.uint32 minimum_value: 0 uint16: name: uint16 typeof: integer - repr: np.uint16 minimum_value: 0 uint8: name: uint8 typeof: integer - repr: np.uint8 minimum_value: 0 uint64: name: uint64 typeof: integer - repr: np.uint64 minimum_value: 0 numeric: name: numeric typeof: float - repr: np.number text: name: text typeof: string @@ -101,7 +87,6 @@ types: isodatetime: name: isodatetime typeof: datetime - repr: np.datetime64 classes: AnyType: name: AnyType diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.language.yaml index f48262a..e42c742 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.language.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.language.yaml @@ -19,67 +19,53 @@ types: float32: name: float32 typeof: float - repr: np.float32 float64: name: float64 typeof: double - repr: np.float64 long: name: long typeof: integer - repr: np.longlong int64: name: int64 typeof: integer - repr: np.int64 int: name: int typeof: integer int32: name: int32 typeof: integer - repr: np.int32 int16: name: int16 typeof: integer - repr: np.int16 short: name: short typeof: integer - repr: np.int16 int8: name: int8 typeof: integer - repr: np.int8 uint: name: uint typeof: integer - repr: np.uint64 minimum_value: 0 uint32: name: uint32 typeof: integer - repr: np.uint32 minimum_value: 0 uint16: name: uint16 typeof: integer - repr: np.uint16 minimum_value: 0 uint8: name: uint8 typeof: integer - repr: np.uint8 minimum_value: 0 uint64: name: uint64 typeof: integer - repr: np.uint64 minimum_value: 0 numeric: name: numeric typeof: float - repr: np.number text: name: text typeof: string @@ -101,7 +87,6 @@ types: isodatetime: name: isodatetime typeof: datetime - repr: np.datetime64 classes: AnyType: name: AnyType diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.language.yaml index f48262a..e42c742 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.language.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.language.yaml @@ -19,67 +19,53 @@ types: float32: name: float32 typeof: float - repr: np.float32 float64: name: float64 typeof: double - repr: np.float64 long: name: long typeof: integer - repr: np.longlong int64: name: int64 typeof: integer - repr: np.int64 int: name: int typeof: integer int32: name: int32 typeof: integer - repr: np.int32 int16: name: int16 typeof: integer - repr: np.int16 short: name: short typeof: integer - repr: np.int16 int8: name: int8 typeof: integer - repr: np.int8 uint: name: uint typeof: integer - repr: np.uint64 minimum_value: 0 uint32: name: uint32 typeof: integer - repr: np.uint32 minimum_value: 0 uint16: name: uint16 typeof: integer - repr: np.uint16 minimum_value: 0 uint8: name: uint8 typeof: integer - repr: np.uint8 minimum_value: 0 uint64: name: uint64 typeof: integer - repr: np.uint64 minimum_value: 0 numeric: name: numeric typeof: float - repr: np.number text: name: text typeof: string @@ -101,7 +87,6 @@ types: isodatetime: name: isodatetime typeof: datetime - repr: np.datetime64 classes: AnyType: name: AnyType diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.language.yaml index f48262a..e42c742 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.language.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.language.yaml @@ -19,67 +19,53 @@ types: float32: name: float32 typeof: float - repr: np.float32 float64: name: float64 typeof: double - repr: np.float64 long: name: long typeof: integer - repr: np.longlong int64: name: int64 typeof: integer - repr: np.int64 int: name: int typeof: integer int32: name: int32 typeof: integer - repr: np.int32 int16: name: int16 typeof: integer - repr: np.int16 short: name: short typeof: integer - repr: np.int16 int8: name: int8 typeof: integer - repr: np.int8 uint: name: uint typeof: integer - repr: np.uint64 minimum_value: 0 uint32: name: uint32 typeof: integer - repr: np.uint32 minimum_value: 0 uint16: name: uint16 typeof: integer - repr: np.uint16 minimum_value: 0 uint8: name: uint8 typeof: integer - repr: np.uint8 minimum_value: 0 uint64: name: uint64 typeof: integer - repr: np.uint64 minimum_value: 0 numeric: name: numeric typeof: float - repr: np.number text: name: text typeof: string @@ -101,7 +87,6 @@ types: isodatetime: name: isodatetime typeof: datetime - repr: np.datetime64 classes: AnyType: name: AnyType diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.language.yaml index f48262a..e42c742 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.language.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.language.yaml @@ -19,67 +19,53 @@ types: float32: name: float32 typeof: float - repr: np.float32 float64: name: float64 typeof: double - repr: np.float64 long: name: long typeof: integer - repr: np.longlong int64: name: int64 typeof: integer - repr: np.int64 int: name: int typeof: integer int32: name: int32 typeof: integer - repr: np.int32 int16: name: int16 typeof: integer - repr: np.int16 short: name: short typeof: integer - repr: np.int16 int8: name: int8 typeof: integer - repr: np.int8 uint: name: uint typeof: integer - repr: np.uint64 minimum_value: 0 uint32: name: uint32 typeof: integer - repr: np.uint32 minimum_value: 0 uint16: name: uint16 typeof: integer - repr: np.uint16 minimum_value: 0 uint8: name: uint8 typeof: integer - repr: np.uint8 minimum_value: 0 uint64: name: uint64 typeof: integer - repr: np.uint64 minimum_value: 0 numeric: name: numeric typeof: float - repr: np.number text: name: text typeof: string @@ -101,7 +87,6 @@ types: isodatetime: name: isodatetime typeof: datetime - repr: np.datetime64 classes: AnyType: name: AnyType diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_7_0/core.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_7_0/core.nwb.language.yaml index f48262a..e42c742 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_7_0/core.nwb.language.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_7_0/core.nwb.language.yaml @@ -19,67 +19,53 @@ types: float32: name: float32 typeof: float - repr: np.float32 float64: name: float64 typeof: double - repr: np.float64 long: name: long typeof: integer - repr: np.longlong int64: name: int64 typeof: integer - repr: np.int64 int: name: int typeof: integer int32: name: int32 typeof: integer - repr: np.int32 int16: name: int16 typeof: integer - repr: np.int16 short: name: short typeof: integer - repr: np.int16 int8: name: int8 typeof: integer - repr: np.int8 uint: name: uint typeof: integer - repr: np.uint64 minimum_value: 0 uint32: name: uint32 typeof: integer - repr: np.uint32 minimum_value: 0 uint16: name: uint16 typeof: integer - repr: np.uint16 minimum_value: 0 uint8: name: uint8 typeof: integer - repr: np.uint8 minimum_value: 0 uint64: name: uint64 typeof: integer - repr: np.uint64 minimum_value: 0 numeric: name: numeric typeof: float - repr: np.number text: name: text typeof: string @@ -101,7 +87,6 @@ types: isodatetime: name: isodatetime typeof: datetime - repr: np.datetime64 classes: AnyType: name: AnyType diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_0/hdmf-common.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_0/hdmf-common.nwb.language.yaml index 35776f9..c7a8401 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_0/hdmf-common.nwb.language.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_0/hdmf-common.nwb.language.yaml @@ -5,7 +5,7 @@ annotations: value: 'False' namespace: tag: namespace - value: hdmf-common + value: core description: Adapter objects to mimic the behavior of elements in the nwb-schema-language id: nwb.language imports: @@ -19,67 +19,53 @@ types: float32: name: float32 typeof: float - repr: np.float32 float64: name: float64 typeof: double - repr: np.float64 long: name: long typeof: integer - repr: np.longlong int64: name: int64 typeof: integer - repr: np.int64 int: name: int typeof: integer int32: name: int32 typeof: integer - repr: np.int32 int16: name: int16 typeof: integer - repr: np.int16 short: name: short typeof: integer - repr: np.int16 int8: name: int8 typeof: integer - repr: np.int8 uint: name: uint typeof: integer - repr: np.uint64 minimum_value: 0 uint32: name: uint32 typeof: integer - repr: np.uint32 minimum_value: 0 uint16: name: uint16 typeof: integer - repr: np.uint16 minimum_value: 0 uint8: name: uint8 typeof: integer - repr: np.uint8 minimum_value: 0 uint64: name: uint64 typeof: integer - repr: np.uint64 minimum_value: 0 numeric: name: numeric typeof: float - repr: np.number text: name: text typeof: string @@ -101,7 +87,6 @@ types: isodatetime: name: isodatetime typeof: datetime - repr: np.datetime64 classes: AnyType: name: AnyType diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_2/hdmf-common.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_2/hdmf-common.nwb.language.yaml index 35776f9..c7a8401 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_2/hdmf-common.nwb.language.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_2/hdmf-common.nwb.language.yaml @@ -5,7 +5,7 @@ annotations: value: 'False' namespace: tag: namespace - value: hdmf-common + value: core description: Adapter objects to mimic the behavior of elements in the nwb-schema-language id: nwb.language imports: @@ -19,67 +19,53 @@ types: float32: name: float32 typeof: float - repr: np.float32 float64: name: float64 typeof: double - repr: np.float64 long: name: long typeof: integer - repr: np.longlong int64: name: int64 typeof: integer - repr: np.int64 int: name: int typeof: integer int32: name: int32 typeof: integer - repr: np.int32 int16: name: int16 typeof: integer - repr: np.int16 short: name: short typeof: integer - repr: np.int16 int8: name: int8 typeof: integer - repr: np.int8 uint: name: uint typeof: integer - repr: np.uint64 minimum_value: 0 uint32: name: uint32 typeof: integer - repr: np.uint32 minimum_value: 0 uint16: name: uint16 typeof: integer - repr: np.uint16 minimum_value: 0 uint8: name: uint8 typeof: integer - repr: np.uint8 minimum_value: 0 uint64: name: uint64 typeof: integer - repr: np.uint64 minimum_value: 0 numeric: name: numeric typeof: float - repr: np.number text: name: text typeof: string @@ -101,7 +87,6 @@ types: isodatetime: name: isodatetime typeof: datetime - repr: np.datetime64 classes: AnyType: name: AnyType diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_3/hdmf-common.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_3/hdmf-common.nwb.language.yaml index 35776f9..c7a8401 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_3/hdmf-common.nwb.language.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_3/hdmf-common.nwb.language.yaml @@ -5,7 +5,7 @@ annotations: value: 'False' namespace: tag: namespace - value: hdmf-common + value: core description: Adapter objects to mimic the behavior of elements in the nwb-schema-language id: nwb.language imports: @@ -19,67 +19,53 @@ types: float32: name: float32 typeof: float - repr: np.float32 float64: name: float64 typeof: double - repr: np.float64 long: name: long typeof: integer - repr: np.longlong int64: name: int64 typeof: integer - repr: np.int64 int: name: int typeof: integer int32: name: int32 typeof: integer - repr: np.int32 int16: name: int16 typeof: integer - repr: np.int16 short: name: short typeof: integer - repr: np.int16 int8: name: int8 typeof: integer - repr: np.int8 uint: name: uint typeof: integer - repr: np.uint64 minimum_value: 0 uint32: name: uint32 typeof: integer - repr: np.uint32 minimum_value: 0 uint16: name: uint16 typeof: integer - repr: np.uint16 minimum_value: 0 uint8: name: uint8 typeof: integer - repr: np.uint8 minimum_value: 0 uint64: name: uint64 typeof: integer - repr: np.uint64 minimum_value: 0 numeric: name: numeric typeof: float - repr: np.number text: name: text typeof: string @@ -101,7 +87,6 @@ types: isodatetime: name: isodatetime typeof: datetime - repr: np.datetime64 classes: AnyType: name: AnyType diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_0/hdmf-common.base.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_0/hdmf-common.base.yaml deleted file mode 100644 index ff30beb..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_0/hdmf-common.base.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: hdmf-common.base -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.base -version: 1.2.0 -imports: -- hdmf-common.nwb.language -default_prefix: hdmf-common.base/ -classes: - Data: - name: Data - description: An abstract data type for a dataset. - attributes: - name: - name: name - range: string - required: true - tree_root: true - Container: - name: Container - description: An abstract data type for a group storing collections of data and - metadata. Base type for all data and metadata containers. - attributes: - name: - name: name - range: string - required: true - tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_0/hdmf-common.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_0/hdmf-common.nwb.language.yaml deleted file mode 100644 index 35776f9..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_0/hdmf-common.nwb.language.yaml +++ /dev/null @@ -1,109 +0,0 @@ -name: hdmf-common.nwb.language -annotations: - is_namespace: - tag: is_namespace - value: 'False' - namespace: - tag: namespace - value: hdmf-common -description: Adapter objects to mimic the behavior of elements in the nwb-schema-language -id: nwb.language -imports: -- linkml:types -prefixes: - linkml: - prefix_prefix: linkml - prefix_reference: https://w3id.org/linkml -default_prefix: nwb.language/ -types: - float32: - name: float32 - typeof: float - repr: np.float32 - float64: - name: float64 - typeof: double - repr: np.float64 - long: - name: long - typeof: integer - repr: np.longlong - int64: - name: int64 - typeof: integer - repr: np.int64 - int: - name: int - typeof: integer - int32: - name: int32 - typeof: integer - repr: np.int32 - int16: - name: int16 - typeof: integer - repr: np.int16 - short: - name: short - typeof: integer - repr: np.int16 - int8: - name: int8 - typeof: integer - repr: np.int8 - uint: - name: uint - typeof: integer - repr: np.uint64 - minimum_value: 0 - uint32: - name: uint32 - typeof: integer - repr: np.uint32 - minimum_value: 0 - uint16: - name: uint16 - typeof: integer - repr: np.uint16 - minimum_value: 0 - uint8: - name: uint8 - typeof: integer - repr: np.uint8 - minimum_value: 0 - uint64: - name: uint64 - typeof: integer - repr: np.uint64 - minimum_value: 0 - numeric: - name: numeric - typeof: float - repr: np.number - text: - name: text - typeof: string - utf: - name: utf - typeof: string - utf8: - name: utf8 - typeof: string - utf_8: - name: utf_8 - typeof: string - ascii: - name: ascii - typeof: string - bool: - name: bool - typeof: boolean - isodatetime: - name: isodatetime - typeof: datetime - repr: np.datetime64 -classes: - AnyType: - name: AnyType - description: Needed because some classes in hdmf-common are datasets without dtype - class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_0/hdmf-common.sparse.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_0/hdmf-common.sparse.yaml deleted file mode 100644 index 2d9616c..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_0/hdmf-common.sparse.yaml +++ /dev/null @@ -1,75 +0,0 @@ -name: hdmf-common.sparse -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.sparse -version: 1.2.0 -imports: -- hdmf-common.nwb.language -default_prefix: hdmf-common.sparse/ -classes: - CSRMatrix: - name: CSRMatrix - description: a compressed sparse row matrix - attributes: - name: - name: name - range: string - required: true - shape: - name: shape - description: the shape of this sparse matrix - range: int - indices: - name: indices - description: column indices - range: CSRMatrix__indices - required: true - multivalued: false - indptr: - name: indptr - description: index pointer - range: CSRMatrix__indptr - required: true - multivalued: false - data: - name: data - description: values in the matrix - range: CSRMatrix__data - required: true - multivalued: false - tree_root: true - CSRMatrix__indices: - name: CSRMatrix__indices - description: column indices - attributes: - name: - name: name - ifabsent: string(indices) - range: string - required: true - equals_string: indices - CSRMatrix__indptr: - name: CSRMatrix__indptr - description: index pointer - attributes: - name: - name: name - ifabsent: string(indptr) - range: string - required: true - equals_string: indptr - CSRMatrix__data: - name: CSRMatrix__data - description: values in the matrix - attributes: - name: - name: name - ifabsent: string(data) - range: string - required: true - equals_string: data diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_0/hdmf-common.table.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_0/hdmf-common.table.yaml deleted file mode 100644 index accfb99..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_0/hdmf-common.table.yaml +++ /dev/null @@ -1,181 +0,0 @@ -name: hdmf-common.table -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.table -version: 1.2.0 -imports: -- hdmf-common.base -- hdmf-common.nwb.language -default_prefix: hdmf-common.table/ -classes: - VectorData: - name: VectorData - description: An n-dimensional dataset representing a column of a DynamicTable. - If used without an accompanying VectorIndex, first dimension is along the rows - of the DynamicTable and each step along the first dimension is a cell of the - larger table. VectorData can also be used to represent a ragged array if paired - with a VectorIndex. This allows for storing arrays of varying length in a single - cell of the DynamicTable by indexing into this VectorData. The first vector - is at VectorData[0:VectorIndex[0]]. The second vector is at VectorData[VectorIndex[0]:VectorIndex[1]], - and so on. - is_a: Data - attributes: - name: - name: name - range: string - required: true - description: - name: description - description: Description of what these vectors represent. - range: text - array: - name: array - range: AnyType - any_of: - - array: - dimensions: - - alias: dim0 - - array: - dimensions: - - alias: dim0 - - alias: dim1 - - array: - dimensions: - - alias: dim0 - - alias: dim1 - - alias: dim2 - - array: - dimensions: - - alias: dim0 - - alias: dim1 - - alias: dim2 - - alias: dim3 - tree_root: true - VectorIndex: - name: VectorIndex - description: Used with VectorData to encode a ragged array. An array of indices - into the first dimension of the target VectorData, and forming a map between - the rows of a DynamicTable and the indices of the VectorData. The name of the - VectorIndex is expected to be the name of the target VectorData object followed - by "_index". - is_a: VectorData - attributes: - name: - name: name - range: string - required: true - target: - name: target - description: Reference to the target dataset that this index applies to. - range: VectorData - tree_root: true - ElementIdentifiers: - name: ElementIdentifiers - description: A list of unique identifiers for values within a dataset, e.g. rows - of a DynamicTable. - is_a: Data - attributes: - name: - name: name - ifabsent: string(element_id) - range: string - required: true - tree_root: true - DynamicTableRegion: - name: DynamicTableRegion - description: DynamicTableRegion provides a link from one table to an index or - region of another. The `table` attribute is a link to another `DynamicTable`, - indicating which table is referenced, and the data is int(s) indicating the - row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to - associate rows with repeated meta-data without data duplication. They can also - be used to create hierarchical relationships between multiple `DynamicTable`s. - `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create - ragged references, so a single cell of a `DynamicTable` can reference many rows - of another `DynamicTable`. - is_a: VectorData - attributes: - name: - name: name - range: string - required: true - table: - name: table - description: Reference to the DynamicTable object that this region applies - to. - range: DynamicTable - description: - name: description - description: Description of what this table region points to. - range: text - tree_root: true - VocabData: - name: VocabData - description: Data that come from a controlled vocabulary of text values. A data - value of i corresponds to the i-th element in the 'vocabulary' array attribute. - is_a: VectorData - attributes: - name: - name: name - range: string - required: true - vocabulary: - name: vocabulary - description: The available items in the controlled vocabulary. - range: text - tree_root: true - DynamicTable: - name: DynamicTable - description: A group containing multiple datasets that are aligned on the first - dimension (Currently, this requirement if left up to APIs to check and enforce). - These datasets represent different columns in the table. Apart from a column - that contains unique identifiers for each row, there are no other required datasets. - Users are free to add any number of custom VectorData objects (columns) here. - DynamicTable also supports ragged array columns, where each element can be of - a different size. To add a ragged array column, use a VectorIndex type to index - the corresponding VectorData type. See documentation for VectorData and VectorIndex - for more details. Unlike a compound data type, which is analogous to storing - an array-of-structs, a DynamicTable can be thought of as a struct-of-arrays. - This provides an alternative structure to choose from when optimizing storage - for anticipated access patterns. Additionally, this type provides a way of creating - a table without having to define a compound type up front. Although this convenience - may be attractive, users should think carefully about how data will be accessed. - DynamicTable is more appropriate for column-centric access, whereas a dataset - with a compound type would be more appropriate for row-centric access. Finally, - data size should also be taken into account. For small tables, performance loss - may be an acceptable trade-off for the flexibility of a DynamicTable. - is_a: Container - attributes: - name: - name: name - range: string - required: true - colnames: - name: colnames - description: The names of the columns in this table. This should be used to - specify an order to the columns. - range: text - description: - name: description - description: Description of what is in this dynamic table. - range: text - id: - name: id - description: Array of unique identifiers for the rows of this dynamic table. - array: - dimensions: - - alias: num_rows - range: int - required: true - multivalued: false - vector_data: - name: vector_data - description: Vector columns, including index columns, of this dynamic table. - range: VectorData - required: false - multivalued: true - tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_0/namespace.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_0/namespace.yaml deleted file mode 100644 index 7befc87..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_0/namespace.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: hdmf-common -annotations: - is_namespace: - tag: is_namespace - value: true - namespace: - tag: namespace - value: hdmf-common -description: Common data structures provided by HDMF -id: hdmf-common -version: 1.2.0 -imports: -- hdmf-common.base -- hdmf-common.table -- hdmf-common.sparse -- hdmf-common.nwb.language -default_prefix: hdmf-common/ diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_1/hdmf-common.base.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_1/hdmf-common.base.yaml deleted file mode 100644 index 17f8013..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_1/hdmf-common.base.yaml +++ /dev/null @@ -1,46 +0,0 @@ -name: hdmf-common.base -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.base -version: 1.2.1 -imports: -- hdmf-common.nwb.language -default_prefix: hdmf-common.base/ -classes: - Data: - name: Data - description: An abstract data type for a dataset. - attributes: - name: - name: name - range: string - required: true - tree_root: true - Container: - name: Container - description: An abstract data type for a group storing collections of data and - metadata. Base type for all data and metadata containers. - attributes: - name: - name: name - range: string - required: true - tree_root: true - SimpleMultiContainer: - name: SimpleMultiContainer - description: A simple Container for holding onto multiple containers - is_a: Container - attributes: - children: - name: children - multivalued: true - inlined: true - inlined_as_list: false - any_of: - - range: Container - tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_1/hdmf-common.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_1/hdmf-common.nwb.language.yaml deleted file mode 100644 index 35776f9..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_1/hdmf-common.nwb.language.yaml +++ /dev/null @@ -1,109 +0,0 @@ -name: hdmf-common.nwb.language -annotations: - is_namespace: - tag: is_namespace - value: 'False' - namespace: - tag: namespace - value: hdmf-common -description: Adapter objects to mimic the behavior of elements in the nwb-schema-language -id: nwb.language -imports: -- linkml:types -prefixes: - linkml: - prefix_prefix: linkml - prefix_reference: https://w3id.org/linkml -default_prefix: nwb.language/ -types: - float32: - name: float32 - typeof: float - repr: np.float32 - float64: - name: float64 - typeof: double - repr: np.float64 - long: - name: long - typeof: integer - repr: np.longlong - int64: - name: int64 - typeof: integer - repr: np.int64 - int: - name: int - typeof: integer - int32: - name: int32 - typeof: integer - repr: np.int32 - int16: - name: int16 - typeof: integer - repr: np.int16 - short: - name: short - typeof: integer - repr: np.int16 - int8: - name: int8 - typeof: integer - repr: np.int8 - uint: - name: uint - typeof: integer - repr: np.uint64 - minimum_value: 0 - uint32: - name: uint32 - typeof: integer - repr: np.uint32 - minimum_value: 0 - uint16: - name: uint16 - typeof: integer - repr: np.uint16 - minimum_value: 0 - uint8: - name: uint8 - typeof: integer - repr: np.uint8 - minimum_value: 0 - uint64: - name: uint64 - typeof: integer - repr: np.uint64 - minimum_value: 0 - numeric: - name: numeric - typeof: float - repr: np.number - text: - name: text - typeof: string - utf: - name: utf - typeof: string - utf8: - name: utf8 - typeof: string - utf_8: - name: utf_8 - typeof: string - ascii: - name: ascii - typeof: string - bool: - name: bool - typeof: boolean - isodatetime: - name: isodatetime - typeof: datetime - repr: np.datetime64 -classes: - AnyType: - name: AnyType - description: Needed because some classes in hdmf-common are datasets without dtype - class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_1/hdmf-common.sparse.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_1/hdmf-common.sparse.yaml deleted file mode 100644 index b480dbe..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_1/hdmf-common.sparse.yaml +++ /dev/null @@ -1,77 +0,0 @@ -name: hdmf-common.sparse -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.sparse -version: 1.2.1 -imports: -- hdmf-common.base -- hdmf-common.nwb.language -default_prefix: hdmf-common.sparse/ -classes: - CSRMatrix: - name: CSRMatrix - description: a compressed sparse row matrix - is_a: Container - attributes: - name: - name: name - range: string - required: true - shape: - name: shape - description: the shape of this sparse matrix - range: int - indices: - name: indices - description: column indices - range: CSRMatrix__indices - required: true - multivalued: false - indptr: - name: indptr - description: index pointer - range: CSRMatrix__indptr - required: true - multivalued: false - data: - name: data - description: values in the matrix - range: CSRMatrix__data - required: true - multivalued: false - tree_root: true - CSRMatrix__indices: - name: CSRMatrix__indices - description: column indices - attributes: - name: - name: name - ifabsent: string(indices) - range: string - required: true - equals_string: indices - CSRMatrix__indptr: - name: CSRMatrix__indptr - description: index pointer - attributes: - name: - name: name - ifabsent: string(indptr) - range: string - required: true - equals_string: indptr - CSRMatrix__data: - name: CSRMatrix__data - description: values in the matrix - attributes: - name: - name: name - ifabsent: string(data) - range: string - required: true - equals_string: data diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_1/hdmf-common.table.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_1/hdmf-common.table.yaml deleted file mode 100644 index 4b3b3ef..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_1/hdmf-common.table.yaml +++ /dev/null @@ -1,181 +0,0 @@ -name: hdmf-common.table -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.table -version: 1.2.1 -imports: -- hdmf-common.base -- hdmf-common.nwb.language -default_prefix: hdmf-common.table/ -classes: - VectorData: - name: VectorData - description: An n-dimensional dataset representing a column of a DynamicTable. - If used without an accompanying VectorIndex, first dimension is along the rows - of the DynamicTable and each step along the first dimension is a cell of the - larger table. VectorData can also be used to represent a ragged array if paired - with a VectorIndex. This allows for storing arrays of varying length in a single - cell of the DynamicTable by indexing into this VectorData. The first vector - is at VectorData[0:VectorIndex[0]]. The second vector is at VectorData[VectorIndex[0]:VectorIndex[1]], - and so on. - is_a: Data - attributes: - name: - name: name - range: string - required: true - description: - name: description - description: Description of what these vectors represent. - range: text - array: - name: array - range: AnyType - any_of: - - array: - dimensions: - - alias: dim0 - - array: - dimensions: - - alias: dim0 - - alias: dim1 - - array: - dimensions: - - alias: dim0 - - alias: dim1 - - alias: dim2 - - array: - dimensions: - - alias: dim0 - - alias: dim1 - - alias: dim2 - - alias: dim3 - tree_root: true - VectorIndex: - name: VectorIndex - description: Used with VectorData to encode a ragged array. An array of indices - into the first dimension of the target VectorData, and forming a map between - the rows of a DynamicTable and the indices of the VectorData. The name of the - VectorIndex is expected to be the name of the target VectorData object followed - by "_index". - is_a: VectorData - attributes: - name: - name: name - range: string - required: true - target: - name: target - description: Reference to the target dataset that this index applies to. - range: VectorData - tree_root: true - ElementIdentifiers: - name: ElementIdentifiers - description: A list of unique identifiers for values within a dataset, e.g. rows - of a DynamicTable. - is_a: Data - attributes: - name: - name: name - ifabsent: string(element_id) - range: string - required: true - tree_root: true - DynamicTableRegion: - name: DynamicTableRegion - description: DynamicTableRegion provides a link from one table to an index or - region of another. The `table` attribute is a link to another `DynamicTable`, - indicating which table is referenced, and the data is int(s) indicating the - row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to - associate rows with repeated meta-data without data duplication. They can also - be used to create hierarchical relationships between multiple `DynamicTable`s. - `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create - ragged references, so a single cell of a `DynamicTable` can reference many rows - of another `DynamicTable`. - is_a: VectorData - attributes: - name: - name: name - range: string - required: true - table: - name: table - description: Reference to the DynamicTable object that this region applies - to. - range: DynamicTable - description: - name: description - description: Description of what this table region points to. - range: text - tree_root: true - VocabData: - name: VocabData - description: Data that come from a controlled vocabulary of text values. A data - value of i corresponds to the i-th element in the 'vocabulary' array attribute. - is_a: VectorData - attributes: - name: - name: name - range: string - required: true - vocabulary: - name: vocabulary - description: The available items in the controlled vocabulary. - range: text - tree_root: true - DynamicTable: - name: DynamicTable - description: A group containing multiple datasets that are aligned on the first - dimension (Currently, this requirement if left up to APIs to check and enforce). - These datasets represent different columns in the table. Apart from a column - that contains unique identifiers for each row, there are no other required datasets. - Users are free to add any number of custom VectorData objects (columns) here. - DynamicTable also supports ragged array columns, where each element can be of - a different size. To add a ragged array column, use a VectorIndex type to index - the corresponding VectorData type. See documentation for VectorData and VectorIndex - for more details. Unlike a compound data type, which is analogous to storing - an array-of-structs, a DynamicTable can be thought of as a struct-of-arrays. - This provides an alternative structure to choose from when optimizing storage - for anticipated access patterns. Additionally, this type provides a way of creating - a table without having to define a compound type up front. Although this convenience - may be attractive, users should think carefully about how data will be accessed. - DynamicTable is more appropriate for column-centric access, whereas a dataset - with a compound type would be more appropriate for row-centric access. Finally, - data size should also be taken into account. For small tables, performance loss - may be an acceptable trade-off for the flexibility of a DynamicTable. - is_a: Container - attributes: - name: - name: name - range: string - required: true - colnames: - name: colnames - description: The names of the columns in this table. This should be used to - specify an order to the columns. - range: text - description: - name: description - description: Description of what is in this dynamic table. - range: text - id: - name: id - description: Array of unique identifiers for the rows of this dynamic table. - array: - dimensions: - - alias: num_rows - range: int - required: true - multivalued: false - vector_data: - name: vector_data - description: Vector columns, including index columns, of this dynamic table. - range: VectorData - required: false - multivalued: true - tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_1/namespace.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_1/namespace.yaml deleted file mode 100644 index e29bfb9..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_2_1/namespace.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: hdmf-common -annotations: - is_namespace: - tag: is_namespace - value: true - namespace: - tag: namespace - value: hdmf-common -description: Common data structures provided by HDMF -id: hdmf-common -version: 1.2.1 -imports: -- hdmf-common.base -- hdmf-common.table -- hdmf-common.sparse -- hdmf-common.nwb.language -default_prefix: hdmf-common/ diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_3_0/hdmf-common.base.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_3_0/hdmf-common.base.yaml deleted file mode 100644 index 22efa9c..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_3_0/hdmf-common.base.yaml +++ /dev/null @@ -1,46 +0,0 @@ -name: hdmf-common.base -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.base -version: 1.3.0 -imports: -- hdmf-common.nwb.language -default_prefix: hdmf-common.base/ -classes: - Data: - name: Data - description: An abstract data type for a dataset. - attributes: - name: - name: name - range: string - required: true - tree_root: true - Container: - name: Container - description: An abstract data type for a group storing collections of data and - metadata. Base type for all data and metadata containers. - attributes: - name: - name: name - range: string - required: true - tree_root: true - SimpleMultiContainer: - name: SimpleMultiContainer - description: A simple Container for holding onto multiple containers. - is_a: Container - attributes: - children: - name: children - multivalued: true - inlined: true - inlined_as_list: false - any_of: - - range: Container - tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_3_0/hdmf-common.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_3_0/hdmf-common.nwb.language.yaml deleted file mode 100644 index 35776f9..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_3_0/hdmf-common.nwb.language.yaml +++ /dev/null @@ -1,109 +0,0 @@ -name: hdmf-common.nwb.language -annotations: - is_namespace: - tag: is_namespace - value: 'False' - namespace: - tag: namespace - value: hdmf-common -description: Adapter objects to mimic the behavior of elements in the nwb-schema-language -id: nwb.language -imports: -- linkml:types -prefixes: - linkml: - prefix_prefix: linkml - prefix_reference: https://w3id.org/linkml -default_prefix: nwb.language/ -types: - float32: - name: float32 - typeof: float - repr: np.float32 - float64: - name: float64 - typeof: double - repr: np.float64 - long: - name: long - typeof: integer - repr: np.longlong - int64: - name: int64 - typeof: integer - repr: np.int64 - int: - name: int - typeof: integer - int32: - name: int32 - typeof: integer - repr: np.int32 - int16: - name: int16 - typeof: integer - repr: np.int16 - short: - name: short - typeof: integer - repr: np.int16 - int8: - name: int8 - typeof: integer - repr: np.int8 - uint: - name: uint - typeof: integer - repr: np.uint64 - minimum_value: 0 - uint32: - name: uint32 - typeof: integer - repr: np.uint32 - minimum_value: 0 - uint16: - name: uint16 - typeof: integer - repr: np.uint16 - minimum_value: 0 - uint8: - name: uint8 - typeof: integer - repr: np.uint8 - minimum_value: 0 - uint64: - name: uint64 - typeof: integer - repr: np.uint64 - minimum_value: 0 - numeric: - name: numeric - typeof: float - repr: np.number - text: - name: text - typeof: string - utf: - name: utf - typeof: string - utf8: - name: utf8 - typeof: string - utf_8: - name: utf_8 - typeof: string - ascii: - name: ascii - typeof: string - bool: - name: bool - typeof: boolean - isodatetime: - name: isodatetime - typeof: datetime - repr: np.datetime64 -classes: - AnyType: - name: AnyType - description: Needed because some classes in hdmf-common are datasets without dtype - class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_3_0/hdmf-common.resources.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_3_0/hdmf-common.resources.yaml deleted file mode 100644 index 918a6a5..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_3_0/hdmf-common.resources.yaml +++ /dev/null @@ -1,158 +0,0 @@ -name: hdmf-common.resources -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.resources -version: 1.3.0 -imports: -- hdmf-common.base -- hdmf-common.nwb.language -default_prefix: hdmf-common.resources/ -classes: - ExternalResources: - name: ExternalResources - description: 'A set of four tables for tracking external resource references in - a file. NOTE: this data type is in beta testing and is subject to change in - a later version.' - is_a: Container - attributes: - name: - name: name - range: string - required: true - keys: - name: keys - description: A table for storing user terms that are used to refer to external - resources. - range: ExternalResources__keys - required: true - multivalued: false - resources: - name: resources - description: A table for mapping user terms (i.e., keys) to resource entities. - range: ExternalResources__resources - required: true - multivalued: false - objects: - name: objects - description: A table for identifying which objects in a file contain references - to external resources. - range: ExternalResources__objects - required: true - multivalued: false - object_keys: - name: object_keys - description: A table for identifying which objects use which keys. - range: ExternalResources__object_keys - required: true - multivalued: false - tree_root: true - ExternalResources__keys: - name: ExternalResources__keys - description: A table for storing user terms that are used to refer to external - resources. - is_a: Data - attributes: - name: - name: name - ifabsent: string(keys) - range: string - required: true - equals_string: keys - key_name: - name: key_name - description: The user term that maps to one or more resources in the 'resources' - table. - range: text - required: true - multivalued: false - ExternalResources__resources: - name: ExternalResources__resources - description: A table for mapping user terms (i.e., keys) to resource entities. - is_a: Data - attributes: - name: - name: name - ifabsent: string(resources) - range: string - required: true - equals_string: resources - keytable_idx: - name: keytable_idx - description: The index to the key in the 'keys' table. - range: uint - required: true - multivalued: false - resource_name: - name: resource_name - description: The name of the online resource (e.g., website, database) that - has the entity. - range: text - required: true - multivalued: false - resource_id: - name: resource_id - description: The unique identifier for the resource entity at the resource. - range: text - required: true - multivalued: false - uri: - name: uri - description: The URI for the resource entity this reference applies to. This - can be an empty string. - range: text - required: true - multivalued: false - ExternalResources__objects: - name: ExternalResources__objects - description: A table for identifying which objects in a file contain references - to external resources. - is_a: Data - attributes: - name: - name: name - ifabsent: string(objects) - range: string - required: true - equals_string: objects - object_id: - name: object_id - description: The UUID for the object. - range: text - required: true - multivalued: false - field: - name: field - description: The field of the object. This can be an empty string if the object - is a dataset and the field is the dataset values. - range: text - required: true - multivalued: false - ExternalResources__object_keys: - name: ExternalResources__object_keys - description: A table for identifying which objects use which keys. - is_a: Data - attributes: - name: - name: name - ifabsent: string(object_keys) - range: string - required: true - equals_string: object_keys - objecttable_idx: - name: objecttable_idx - description: The index to the 'objects' table for the object that holds the - key. - range: uint - required: true - multivalued: false - keytable_idx: - name: keytable_idx - description: The index to the 'keys' table for the key. - range: uint - required: true - multivalued: false diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_3_0/hdmf-common.sparse.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_3_0/hdmf-common.sparse.yaml deleted file mode 100644 index 264e15d..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_3_0/hdmf-common.sparse.yaml +++ /dev/null @@ -1,66 +0,0 @@ -name: hdmf-common.sparse -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.sparse -version: 1.3.0 -imports: -- hdmf-common.base -- hdmf-common.nwb.language -default_prefix: hdmf-common.sparse/ -classes: - CSRMatrix: - name: CSRMatrix - description: A compressed sparse row matrix. Data are stored in the standard CSR - format, where column indices for row i are stored in indices[indptr[i]:indptr[i+1]] - and their corresponding values are stored in data[indptr[i]:indptr[i+1]]. - is_a: Container - attributes: - name: - name: name - range: string - required: true - shape: - name: shape - description: The shape (number of rows, number of columns) of this sparse - matrix. - range: uint - indices: - name: indices - description: The column indices. - array: - dimensions: - - alias: number_of_non_zero_values - range: uint - required: true - multivalued: false - indptr: - name: indptr - description: The row index pointer. - array: - dimensions: - - alias: number_of_rows_in_the_matrix_1 - range: uint - required: true - multivalued: false - data: - name: data - description: The non-zero values in the matrix. - range: CSRMatrix__data - required: true - multivalued: false - tree_root: true - CSRMatrix__data: - name: CSRMatrix__data - description: The non-zero values in the matrix. - attributes: - name: - name: name - ifabsent: string(data) - range: string - required: true - equals_string: data diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_3_0/hdmf-common.table.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_3_0/hdmf-common.table.yaml deleted file mode 100644 index 478c18d..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_3_0/hdmf-common.table.yaml +++ /dev/null @@ -1,181 +0,0 @@ -name: hdmf-common.table -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.table -version: 1.3.0 -imports: -- hdmf-common.base -- hdmf-common.nwb.language -default_prefix: hdmf-common.table/ -classes: - VectorData: - name: VectorData - description: An n-dimensional dataset representing a column of a DynamicTable. - If used without an accompanying VectorIndex, first dimension is along the rows - of the DynamicTable and each step along the first dimension is a cell of the - larger table. VectorData can also be used to represent a ragged array if paired - with a VectorIndex. This allows for storing arrays of varying length in a single - cell of the DynamicTable by indexing into this VectorData. The first vector - is at VectorData[0:VectorIndex[0]]. The second vector is at VectorData[VectorIndex[0]:VectorIndex[1]], - and so on. - is_a: Data - attributes: - name: - name: name - range: string - required: true - description: - name: description - description: Description of what these vectors represent. - range: text - array: - name: array - range: AnyType - any_of: - - array: - dimensions: - - alias: dim0 - - array: - dimensions: - - alias: dim0 - - alias: dim1 - - array: - dimensions: - - alias: dim0 - - alias: dim1 - - alias: dim2 - - array: - dimensions: - - alias: dim0 - - alias: dim1 - - alias: dim2 - - alias: dim3 - tree_root: true - VectorIndex: - name: VectorIndex - description: Used with VectorData to encode a ragged array. An array of indices - into the first dimension of the target VectorData, and forming a map between - the rows of a DynamicTable and the indices of the VectorData. The name of the - VectorIndex is expected to be the name of the target VectorData object followed - by "_index". - is_a: VectorData - attributes: - name: - name: name - range: string - required: true - target: - name: target - description: Reference to the target dataset that this index applies to. - range: VectorData - tree_root: true - ElementIdentifiers: - name: ElementIdentifiers - description: A list of unique identifiers for values within a dataset, e.g. rows - of a DynamicTable. - is_a: Data - attributes: - name: - name: name - ifabsent: string(element_id) - range: string - required: true - tree_root: true - DynamicTableRegion: - name: DynamicTableRegion - description: DynamicTableRegion provides a link from one table to an index or - region of another. The `table` attribute is a link to another `DynamicTable`, - indicating which table is referenced, and the data is int(s) indicating the - row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to - associate rows with repeated meta-data without data duplication. They can also - be used to create hierarchical relationships between multiple `DynamicTable`s. - `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create - ragged references, so a single cell of a `DynamicTable` can reference many rows - of another `DynamicTable`. - is_a: VectorData - attributes: - name: - name: name - range: string - required: true - table: - name: table - description: Reference to the DynamicTable object that this region applies - to. - range: DynamicTable - description: - name: description - description: Description of what this table region points to. - range: text - tree_root: true - VocabData: - name: VocabData - description: Data that come from a controlled vocabulary of text values. A data - value of i corresponds to the i-th element in the 'vocabulary' array attribute. - is_a: VectorData - attributes: - name: - name: name - range: string - required: true - vocabulary: - name: vocabulary - description: The available items in the controlled vocabulary. - range: text - tree_root: true - DynamicTable: - name: DynamicTable - description: A group containing multiple datasets that are aligned on the first - dimension (Currently, this requirement if left up to APIs to check and enforce). - These datasets represent different columns in the table. Apart from a column - that contains unique identifiers for each row, there are no other required datasets. - Users are free to add any number of custom VectorData objects (columns) here. - DynamicTable also supports ragged array columns, where each element can be of - a different size. To add a ragged array column, use a VectorIndex type to index - the corresponding VectorData type. See documentation for VectorData and VectorIndex - for more details. Unlike a compound data type, which is analogous to storing - an array-of-structs, a DynamicTable can be thought of as a struct-of-arrays. - This provides an alternative structure to choose from when optimizing storage - for anticipated access patterns. Additionally, this type provides a way of creating - a table without having to define a compound type up front. Although this convenience - may be attractive, users should think carefully about how data will be accessed. - DynamicTable is more appropriate for column-centric access, whereas a dataset - with a compound type would be more appropriate for row-centric access. Finally, - data size should also be taken into account. For small tables, performance loss - may be an acceptable trade-off for the flexibility of a DynamicTable. - is_a: Container - attributes: - name: - name: name - range: string - required: true - colnames: - name: colnames - description: The names of the columns in this table. This should be used to - specify an order to the columns. - range: text - description: - name: description - description: Description of what is in this dynamic table. - range: text - id: - name: id - description: Array of unique identifiers for the rows of this dynamic table. - array: - dimensions: - - alias: num_rows - range: int - required: true - multivalued: false - vector_data: - name: vector_data - description: Vector columns, including index columns, of this dynamic table. - range: VectorData - required: false - multivalued: true - tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_3_0/namespace.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_3_0/namespace.yaml deleted file mode 100644 index 11885e7..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_3_0/namespace.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: hdmf-common -annotations: - is_namespace: - tag: is_namespace - value: true - namespace: - tag: namespace - value: hdmf-common -description: Common data structures provided by HDMF -id: hdmf-common -version: 1.3.0 -imports: -- hdmf-common.base -- hdmf-common.table -- hdmf-common.sparse -- hdmf-common.resources -- hdmf-common.nwb.language -default_prefix: hdmf-common/ diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_4_0/hdmf-common.base.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_4_0/hdmf-common.base.yaml deleted file mode 100644 index ef51ebd..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_4_0/hdmf-common.base.yaml +++ /dev/null @@ -1,46 +0,0 @@ -name: hdmf-common.base -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.base -version: 1.4.0 -imports: -- hdmf-common.nwb.language -default_prefix: hdmf-common.base/ -classes: - Data: - name: Data - description: An abstract data type for a dataset. - attributes: - name: - name: name - range: string - required: true - tree_root: true - Container: - name: Container - description: An abstract data type for a group storing collections of data and - metadata. Base type for all data and metadata containers. - attributes: - name: - name: name - range: string - required: true - tree_root: true - SimpleMultiContainer: - name: SimpleMultiContainer - description: A simple Container for holding onto multiple containers. - is_a: Container - attributes: - children: - name: children - multivalued: true - inlined: true - inlined_as_list: false - any_of: - - range: Container - tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_4_0/hdmf-common.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_4_0/hdmf-common.nwb.language.yaml deleted file mode 100644 index 98c00e4..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_4_0/hdmf-common.nwb.language.yaml +++ /dev/null @@ -1,109 +0,0 @@ -name: hdmf-common.nwb.language -annotations: - is_namespace: - tag: is_namespace - value: 'False' - namespace: - tag: namespace - value: hdmf-experimental -description: Adapter objects to mimic the behavior of elements in the nwb-schema-language -id: nwb.language -imports: -- linkml:types -prefixes: - linkml: - prefix_prefix: linkml - prefix_reference: https://w3id.org/linkml -default_prefix: nwb.language/ -types: - float32: - name: float32 - typeof: float - repr: np.float32 - float64: - name: float64 - typeof: double - repr: np.float64 - long: - name: long - typeof: integer - repr: np.longlong - int64: - name: int64 - typeof: integer - repr: np.int64 - int: - name: int - typeof: integer - int32: - name: int32 - typeof: integer - repr: np.int32 - int16: - name: int16 - typeof: integer - repr: np.int16 - short: - name: short - typeof: integer - repr: np.int16 - int8: - name: int8 - typeof: integer - repr: np.int8 - uint: - name: uint - typeof: integer - repr: np.uint64 - minimum_value: 0 - uint32: - name: uint32 - typeof: integer - repr: np.uint32 - minimum_value: 0 - uint16: - name: uint16 - typeof: integer - repr: np.uint16 - minimum_value: 0 - uint8: - name: uint8 - typeof: integer - repr: np.uint8 - minimum_value: 0 - uint64: - name: uint64 - typeof: integer - repr: np.uint64 - minimum_value: 0 - numeric: - name: numeric - typeof: float - repr: np.number - text: - name: text - typeof: string - utf: - name: utf - typeof: string - utf8: - name: utf8 - typeof: string - utf_8: - name: utf_8 - typeof: string - ascii: - name: ascii - typeof: string - bool: - name: bool - typeof: boolean - isodatetime: - name: isodatetime - typeof: datetime - repr: np.datetime64 -classes: - AnyType: - name: AnyType - description: Needed because some classes in hdmf-common are datasets without dtype - class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_4_0/hdmf-common.sparse.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_4_0/hdmf-common.sparse.yaml deleted file mode 100644 index a004e10..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_4_0/hdmf-common.sparse.yaml +++ /dev/null @@ -1,66 +0,0 @@ -name: hdmf-common.sparse -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.sparse -version: 1.4.0 -imports: -- hdmf-common.base -- hdmf-common.nwb.language -default_prefix: hdmf-common.sparse/ -classes: - CSRMatrix: - name: CSRMatrix - description: A compressed sparse row matrix. Data are stored in the standard CSR - format, where column indices for row i are stored in indices[indptr[i]:indptr[i+1]] - and their corresponding values are stored in data[indptr[i]:indptr[i+1]]. - is_a: Container - attributes: - name: - name: name - range: string - required: true - shape: - name: shape - description: The shape (number of rows, number of columns) of this sparse - matrix. - range: uint - indices: - name: indices - description: The column indices. - array: - dimensions: - - alias: number_of_non_zero_values - range: uint - required: true - multivalued: false - indptr: - name: indptr - description: The row index pointer. - array: - dimensions: - - alias: number_of_rows_in_the_matrix_1 - range: uint - required: true - multivalued: false - data: - name: data - description: The non-zero values in the matrix. - range: CSRMatrix__data - required: true - multivalued: false - tree_root: true - CSRMatrix__data: - name: CSRMatrix__data - description: The non-zero values in the matrix. - attributes: - name: - name: name - ifabsent: string(data) - range: string - required: true - equals_string: data diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_4_0/hdmf-common.table.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_4_0/hdmf-common.table.yaml deleted file mode 100644 index ca9ead2..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_4_0/hdmf-common.table.yaml +++ /dev/null @@ -1,166 +0,0 @@ -name: hdmf-common.table -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.table -version: 1.4.0 -imports: -- hdmf-common.base -- hdmf-common.nwb.language -default_prefix: hdmf-common.table/ -classes: - VectorData: - name: VectorData - description: An n-dimensional dataset representing a column of a DynamicTable. - If used without an accompanying VectorIndex, first dimension is along the rows - of the DynamicTable and each step along the first dimension is a cell of the - larger table. VectorData can also be used to represent a ragged array if paired - with a VectorIndex. This allows for storing arrays of varying length in a single - cell of the DynamicTable by indexing into this VectorData. The first vector - is at VectorData[0:VectorIndex[0]]. The second vector is at VectorData[VectorIndex[0]:VectorIndex[1]], - and so on. - is_a: Data - attributes: - name: - name: name - range: string - required: true - description: - name: description - description: Description of what these vectors represent. - range: text - array: - name: array - range: AnyType - any_of: - - array: - dimensions: - - alias: dim0 - - array: - dimensions: - - alias: dim0 - - alias: dim1 - - array: - dimensions: - - alias: dim0 - - alias: dim1 - - alias: dim2 - - array: - dimensions: - - alias: dim0 - - alias: dim1 - - alias: dim2 - - alias: dim3 - tree_root: true - VectorIndex: - name: VectorIndex - description: Used with VectorData to encode a ragged array. An array of indices - into the first dimension of the target VectorData, and forming a map between - the rows of a DynamicTable and the indices of the VectorData. The name of the - VectorIndex is expected to be the name of the target VectorData object followed - by "_index". - is_a: VectorData - attributes: - name: - name: name - range: string - required: true - target: - name: target - description: Reference to the target dataset that this index applies to. - range: VectorData - tree_root: true - ElementIdentifiers: - name: ElementIdentifiers - description: A list of unique identifiers for values within a dataset, e.g. rows - of a DynamicTable. - is_a: Data - attributes: - name: - name: name - ifabsent: string(element_id) - range: string - required: true - tree_root: true - DynamicTableRegion: - name: DynamicTableRegion - description: DynamicTableRegion provides a link from one table to an index or - region of another. The `table` attribute is a link to another `DynamicTable`, - indicating which table is referenced, and the data is int(s) indicating the - row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to - associate rows with repeated meta-data without data duplication. They can also - be used to create hierarchical relationships between multiple `DynamicTable`s. - `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create - ragged references, so a single cell of a `DynamicTable` can reference many rows - of another `DynamicTable`. - is_a: VectorData - attributes: - name: - name: name - range: string - required: true - table: - name: table - description: Reference to the DynamicTable object that this region applies - to. - range: DynamicTable - description: - name: description - description: Description of what this table region points to. - range: text - tree_root: true - DynamicTable: - name: DynamicTable - description: A group containing multiple datasets that are aligned on the first - dimension (Currently, this requirement if left up to APIs to check and enforce). - These datasets represent different columns in the table. Apart from a column - that contains unique identifiers for each row, there are no other required datasets. - Users are free to add any number of custom VectorData objects (columns) here. - DynamicTable also supports ragged array columns, where each element can be of - a different size. To add a ragged array column, use a VectorIndex type to index - the corresponding VectorData type. See documentation for VectorData and VectorIndex - for more details. Unlike a compound data type, which is analogous to storing - an array-of-structs, a DynamicTable can be thought of as a struct-of-arrays. - This provides an alternative structure to choose from when optimizing storage - for anticipated access patterns. Additionally, this type provides a way of creating - a table without having to define a compound type up front. Although this convenience - may be attractive, users should think carefully about how data will be accessed. - DynamicTable is more appropriate for column-centric access, whereas a dataset - with a compound type would be more appropriate for row-centric access. Finally, - data size should also be taken into account. For small tables, performance loss - may be an acceptable trade-off for the flexibility of a DynamicTable. - is_a: Container - attributes: - name: - name: name - range: string - required: true - colnames: - name: colnames - description: The names of the columns in this table. This should be used to - specify an order to the columns. - range: text - description: - name: description - description: Description of what is in this dynamic table. - range: text - id: - name: id - description: Array of unique identifiers for the rows of this dynamic table. - array: - dimensions: - - alias: num_rows - range: int - required: true - multivalued: false - vector_data: - name: vector_data - description: Vector columns, including index columns, of this dynamic table. - range: VectorData - required: false - multivalued: true - tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_4_0/namespace.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_4_0/namespace.yaml deleted file mode 100644 index 50680da..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_4_0/namespace.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: hdmf-common -annotations: - is_namespace: - tag: is_namespace - value: true - namespace: - tag: namespace - value: hdmf-common -description: Common data structures provided by HDMF -id: hdmf-common -version: 1.4.0 -imports: -- hdmf-common.base -- hdmf-common.table -- hdmf-common.sparse -- hdmf-common.nwb.language -default_prefix: hdmf-common/ diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_0/hdmf-common.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_0/hdmf-common.nwb.language.yaml index 98c00e4..c7a8401 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_0/hdmf-common.nwb.language.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_0/hdmf-common.nwb.language.yaml @@ -5,7 +5,7 @@ annotations: value: 'False' namespace: tag: namespace - value: hdmf-experimental + value: core description: Adapter objects to mimic the behavior of elements in the nwb-schema-language id: nwb.language imports: @@ -19,67 +19,53 @@ types: float32: name: float32 typeof: float - repr: np.float32 float64: name: float64 typeof: double - repr: np.float64 long: name: long typeof: integer - repr: np.longlong int64: name: int64 typeof: integer - repr: np.int64 int: name: int typeof: integer int32: name: int32 typeof: integer - repr: np.int32 int16: name: int16 typeof: integer - repr: np.int16 short: name: short typeof: integer - repr: np.int16 int8: name: int8 typeof: integer - repr: np.int8 uint: name: uint typeof: integer - repr: np.uint64 minimum_value: 0 uint32: name: uint32 typeof: integer - repr: np.uint32 minimum_value: 0 uint16: name: uint16 typeof: integer - repr: np.uint16 minimum_value: 0 uint8: name: uint8 typeof: integer - repr: np.uint8 minimum_value: 0 uint64: name: uint64 typeof: integer - repr: np.uint64 minimum_value: 0 numeric: name: numeric typeof: float - repr: np.number text: name: text typeof: string @@ -101,7 +87,6 @@ types: isodatetime: name: isodatetime typeof: datetime - repr: np.datetime64 classes: AnyType: name: AnyType diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_1/hdmf-common.base.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_1/hdmf-common.base.yaml deleted file mode 100644 index 75e5a6c..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_1/hdmf-common.base.yaml +++ /dev/null @@ -1,46 +0,0 @@ -name: hdmf-common.base -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.base -version: 1.5.1 -imports: -- hdmf-common.nwb.language -default_prefix: hdmf-common.base/ -classes: - Data: - name: Data - description: An abstract data type for a dataset. - attributes: - name: - name: name - range: string - required: true - tree_root: true - Container: - name: Container - description: An abstract data type for a group storing collections of data and - metadata. Base type for all data and metadata containers. - attributes: - name: - name: name - range: string - required: true - tree_root: true - SimpleMultiContainer: - name: SimpleMultiContainer - description: A simple Container for holding onto multiple containers. - is_a: Container - attributes: - children: - name: children - multivalued: true - inlined: true - inlined_as_list: false - any_of: - - range: Container - tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_1/hdmf-common.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_1/hdmf-common.nwb.language.yaml deleted file mode 100644 index 98c00e4..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_1/hdmf-common.nwb.language.yaml +++ /dev/null @@ -1,109 +0,0 @@ -name: hdmf-common.nwb.language -annotations: - is_namespace: - tag: is_namespace - value: 'False' - namespace: - tag: namespace - value: hdmf-experimental -description: Adapter objects to mimic the behavior of elements in the nwb-schema-language -id: nwb.language -imports: -- linkml:types -prefixes: - linkml: - prefix_prefix: linkml - prefix_reference: https://w3id.org/linkml -default_prefix: nwb.language/ -types: - float32: - name: float32 - typeof: float - repr: np.float32 - float64: - name: float64 - typeof: double - repr: np.float64 - long: - name: long - typeof: integer - repr: np.longlong - int64: - name: int64 - typeof: integer - repr: np.int64 - int: - name: int - typeof: integer - int32: - name: int32 - typeof: integer - repr: np.int32 - int16: - name: int16 - typeof: integer - repr: np.int16 - short: - name: short - typeof: integer - repr: np.int16 - int8: - name: int8 - typeof: integer - repr: np.int8 - uint: - name: uint - typeof: integer - repr: np.uint64 - minimum_value: 0 - uint32: - name: uint32 - typeof: integer - repr: np.uint32 - minimum_value: 0 - uint16: - name: uint16 - typeof: integer - repr: np.uint16 - minimum_value: 0 - uint8: - name: uint8 - typeof: integer - repr: np.uint8 - minimum_value: 0 - uint64: - name: uint64 - typeof: integer - repr: np.uint64 - minimum_value: 0 - numeric: - name: numeric - typeof: float - repr: np.number - text: - name: text - typeof: string - utf: - name: utf - typeof: string - utf8: - name: utf8 - typeof: string - utf_8: - name: utf_8 - typeof: string - ascii: - name: ascii - typeof: string - bool: - name: bool - typeof: boolean - isodatetime: - name: isodatetime - typeof: datetime - repr: np.datetime64 -classes: - AnyType: - name: AnyType - description: Needed because some classes in hdmf-common are datasets without dtype - class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_1/hdmf-common.sparse.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_1/hdmf-common.sparse.yaml deleted file mode 100644 index 380bc7e..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_1/hdmf-common.sparse.yaml +++ /dev/null @@ -1,66 +0,0 @@ -name: hdmf-common.sparse -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.sparse -version: 1.5.1 -imports: -- hdmf-common.base -- hdmf-common.nwb.language -default_prefix: hdmf-common.sparse/ -classes: - CSRMatrix: - name: CSRMatrix - description: A compressed sparse row matrix. Data are stored in the standard CSR - format, where column indices for row i are stored in indices[indptr[i]:indptr[i+1]] - and their corresponding values are stored in data[indptr[i]:indptr[i+1]]. - is_a: Container - attributes: - name: - name: name - range: string - required: true - shape: - name: shape - description: The shape (number of rows, number of columns) of this sparse - matrix. - range: uint - indices: - name: indices - description: The column indices. - array: - dimensions: - - alias: number_of_non_zero_values - range: uint - required: true - multivalued: false - indptr: - name: indptr - description: The row index pointer. - array: - dimensions: - - alias: number_of_rows_in_the_matrix_1 - range: uint - required: true - multivalued: false - data: - name: data - description: The non-zero values in the matrix. - range: CSRMatrix__data - required: true - multivalued: false - tree_root: true - CSRMatrix__data: - name: CSRMatrix__data - description: The non-zero values in the matrix. - attributes: - name: - name: name - ifabsent: string(data) - range: string - required: true - equals_string: data diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_1/hdmf-common.table.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_1/hdmf-common.table.yaml deleted file mode 100644 index 557721d..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_1/hdmf-common.table.yaml +++ /dev/null @@ -1,185 +0,0 @@ -name: hdmf-common.table -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.table -version: 1.5.1 -imports: -- hdmf-common.base -- hdmf-common.nwb.language -default_prefix: hdmf-common.table/ -classes: - VectorData: - name: VectorData - description: An n-dimensional dataset representing a column of a DynamicTable. - If used without an accompanying VectorIndex, first dimension is along the rows - of the DynamicTable and each step along the first dimension is a cell of the - larger table. VectorData can also be used to represent a ragged array if paired - with a VectorIndex. This allows for storing arrays of varying length in a single - cell of the DynamicTable by indexing into this VectorData. The first vector - is at VectorData[0:VectorIndex[0]]. The second vector is at VectorData[VectorIndex[0]:VectorIndex[1]], - and so on. - is_a: Data - attributes: - name: - name: name - range: string - required: true - description: - name: description - description: Description of what these vectors represent. - range: text - array: - name: array - range: AnyType - any_of: - - array: - dimensions: - - alias: dim0 - - array: - dimensions: - - alias: dim0 - - alias: dim1 - - array: - dimensions: - - alias: dim0 - - alias: dim1 - - alias: dim2 - - array: - dimensions: - - alias: dim0 - - alias: dim1 - - alias: dim2 - - alias: dim3 - tree_root: true - VectorIndex: - name: VectorIndex - description: Used with VectorData to encode a ragged array. An array of indices - into the first dimension of the target VectorData, and forming a map between - the rows of a DynamicTable and the indices of the VectorData. The name of the - VectorIndex is expected to be the name of the target VectorData object followed - by "_index". - is_a: VectorData - attributes: - name: - name: name - range: string - required: true - target: - name: target - description: Reference to the target dataset that this index applies to. - range: VectorData - tree_root: true - ElementIdentifiers: - name: ElementIdentifiers - description: A list of unique identifiers for values within a dataset, e.g. rows - of a DynamicTable. - is_a: Data - attributes: - name: - name: name - ifabsent: string(element_id) - range: string - required: true - tree_root: true - DynamicTableRegion: - name: DynamicTableRegion - description: DynamicTableRegion provides a link from one table to an index or - region of another. The `table` attribute is a link to another `DynamicTable`, - indicating which table is referenced, and the data is int(s) indicating the - row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to - associate rows with repeated meta-data without data duplication. They can also - be used to create hierarchical relationships between multiple `DynamicTable`s. - `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create - ragged references, so a single cell of a `DynamicTable` can reference many rows - of another `DynamicTable`. - is_a: VectorData - attributes: - name: - name: name - range: string - required: true - table: - name: table - description: Reference to the DynamicTable object that this region applies - to. - range: DynamicTable - description: - name: description - description: Description of what this table region points to. - range: text - tree_root: true - DynamicTable: - name: DynamicTable - description: A group containing multiple datasets that are aligned on the first - dimension (Currently, this requirement if left up to APIs to check and enforce). - These datasets represent different columns in the table. Apart from a column - that contains unique identifiers for each row, there are no other required datasets. - Users are free to add any number of custom VectorData objects (columns) here. - DynamicTable also supports ragged array columns, where each element can be of - a different size. To add a ragged array column, use a VectorIndex type to index - the corresponding VectorData type. See documentation for VectorData and VectorIndex - for more details. Unlike a compound data type, which is analogous to storing - an array-of-structs, a DynamicTable can be thought of as a struct-of-arrays. - This provides an alternative structure to choose from when optimizing storage - for anticipated access patterns. Additionally, this type provides a way of creating - a table without having to define a compound type up front. Although this convenience - may be attractive, users should think carefully about how data will be accessed. - DynamicTable is more appropriate for column-centric access, whereas a dataset - with a compound type would be more appropriate for row-centric access. Finally, - data size should also be taken into account. For small tables, performance loss - may be an acceptable trade-off for the flexibility of a DynamicTable. - is_a: Container - attributes: - name: - name: name - range: string - required: true - colnames: - name: colnames - description: The names of the columns in this table. This should be used to - specify an order to the columns. - range: text - description: - name: description - description: Description of what is in this dynamic table. - range: text - id: - name: id - description: Array of unique identifiers for the rows of this dynamic table. - array: - dimensions: - - alias: num_rows - range: int - required: true - multivalued: false - vector_data: - name: vector_data - description: Vector columns, including index columns, of this dynamic table. - range: VectorData - required: false - multivalued: true - tree_root: true - AlignedDynamicTable: - name: AlignedDynamicTable - description: DynamicTable container that supports storing a collection of sub-tables. - Each sub-table is a DynamicTable itself that is aligned with the main table - by row index. I.e., all DynamicTables stored in this group MUST have the same - number of rows. This type effectively defines a 2-level table in which the main - data is stored in the main table implemented by this type and additional columns - of the table are grouped into categories, with each category being represented - by a separate DynamicTable stored within the group. - is_a: DynamicTable - attributes: - children: - name: children - multivalued: true - inlined: true - inlined_as_list: false - any_of: - - range: DynamicTable - tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_1/namespace.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_1/namespace.yaml deleted file mode 100644 index 917870d..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_1/namespace.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: hdmf-common -annotations: - is_namespace: - tag: is_namespace - value: true - namespace: - tag: namespace - value: hdmf-common -description: Common data structures provided by HDMF -id: hdmf-common -version: 1.5.1 -imports: -- hdmf-common.base -- hdmf-common.table -- hdmf-common.sparse -- hdmf-common.nwb.language -default_prefix: hdmf-common/ diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_6_0/hdmf-common.base.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_6_0/hdmf-common.base.yaml deleted file mode 100644 index 7031d84..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_6_0/hdmf-common.base.yaml +++ /dev/null @@ -1,46 +0,0 @@ -name: hdmf-common.base -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.base -version: 1.6.0 -imports: -- hdmf-common.nwb.language -default_prefix: hdmf-common.base/ -classes: - Data: - name: Data - description: An abstract data type for a dataset. - attributes: - name: - name: name - range: string - required: true - tree_root: true - Container: - name: Container - description: An abstract data type for a group storing collections of data and - metadata. Base type for all data and metadata containers. - attributes: - name: - name: name - range: string - required: true - tree_root: true - SimpleMultiContainer: - name: SimpleMultiContainer - description: A simple Container for holding onto multiple containers. - is_a: Container - attributes: - children: - name: children - multivalued: true - inlined: true - inlined_as_list: false - any_of: - - range: Container - tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_6_0/hdmf-common.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_6_0/hdmf-common.nwb.language.yaml deleted file mode 100644 index 98c00e4..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_6_0/hdmf-common.nwb.language.yaml +++ /dev/null @@ -1,109 +0,0 @@ -name: hdmf-common.nwb.language -annotations: - is_namespace: - tag: is_namespace - value: 'False' - namespace: - tag: namespace - value: hdmf-experimental -description: Adapter objects to mimic the behavior of elements in the nwb-schema-language -id: nwb.language -imports: -- linkml:types -prefixes: - linkml: - prefix_prefix: linkml - prefix_reference: https://w3id.org/linkml -default_prefix: nwb.language/ -types: - float32: - name: float32 - typeof: float - repr: np.float32 - float64: - name: float64 - typeof: double - repr: np.float64 - long: - name: long - typeof: integer - repr: np.longlong - int64: - name: int64 - typeof: integer - repr: np.int64 - int: - name: int - typeof: integer - int32: - name: int32 - typeof: integer - repr: np.int32 - int16: - name: int16 - typeof: integer - repr: np.int16 - short: - name: short - typeof: integer - repr: np.int16 - int8: - name: int8 - typeof: integer - repr: np.int8 - uint: - name: uint - typeof: integer - repr: np.uint64 - minimum_value: 0 - uint32: - name: uint32 - typeof: integer - repr: np.uint32 - minimum_value: 0 - uint16: - name: uint16 - typeof: integer - repr: np.uint16 - minimum_value: 0 - uint8: - name: uint8 - typeof: integer - repr: np.uint8 - minimum_value: 0 - uint64: - name: uint64 - typeof: integer - repr: np.uint64 - minimum_value: 0 - numeric: - name: numeric - typeof: float - repr: np.number - text: - name: text - typeof: string - utf: - name: utf - typeof: string - utf8: - name: utf8 - typeof: string - utf_8: - name: utf_8 - typeof: string - ascii: - name: ascii - typeof: string - bool: - name: bool - typeof: boolean - isodatetime: - name: isodatetime - typeof: datetime - repr: np.datetime64 -classes: - AnyType: - name: AnyType - description: Needed because some classes in hdmf-common are datasets without dtype - class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_6_0/hdmf-common.sparse.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_6_0/hdmf-common.sparse.yaml deleted file mode 100644 index e2e8cff..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_6_0/hdmf-common.sparse.yaml +++ /dev/null @@ -1,66 +0,0 @@ -name: hdmf-common.sparse -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.sparse -version: 1.6.0 -imports: -- hdmf-common.base -- hdmf-common.nwb.language -default_prefix: hdmf-common.sparse/ -classes: - CSRMatrix: - name: CSRMatrix - description: A compressed sparse row matrix. Data are stored in the standard CSR - format, where column indices for row i are stored in indices[indptr[i]:indptr[i+1]] - and their corresponding values are stored in data[indptr[i]:indptr[i+1]]. - is_a: Container - attributes: - name: - name: name - range: string - required: true - shape: - name: shape - description: The shape (number of rows, number of columns) of this sparse - matrix. - range: uint - indices: - name: indices - description: The column indices. - array: - dimensions: - - alias: number_of_non_zero_values - range: uint - required: true - multivalued: false - indptr: - name: indptr - description: The row index pointer. - array: - dimensions: - - alias: number_of_rows_in_the_matrix_1 - range: uint - required: true - multivalued: false - data: - name: data - description: The non-zero values in the matrix. - range: CSRMatrix__data - required: true - multivalued: false - tree_root: true - CSRMatrix__data: - name: CSRMatrix__data - description: The non-zero values in the matrix. - attributes: - name: - name: name - ifabsent: string(data) - range: string - required: true - equals_string: data diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_6_0/hdmf-common.table.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_6_0/hdmf-common.table.yaml deleted file mode 100644 index 100ea47..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_6_0/hdmf-common.table.yaml +++ /dev/null @@ -1,185 +0,0 @@ -name: hdmf-common.table -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.table -version: 1.6.0 -imports: -- hdmf-common.base -- hdmf-common.nwb.language -default_prefix: hdmf-common.table/ -classes: - VectorData: - name: VectorData - description: An n-dimensional dataset representing a column of a DynamicTable. - If used without an accompanying VectorIndex, first dimension is along the rows - of the DynamicTable and each step along the first dimension is a cell of the - larger table. VectorData can also be used to represent a ragged array if paired - with a VectorIndex. This allows for storing arrays of varying length in a single - cell of the DynamicTable by indexing into this VectorData. The first vector - is at VectorData[0:VectorIndex[0]]. The second vector is at VectorData[VectorIndex[0]:VectorIndex[1]], - and so on. - is_a: Data - attributes: - name: - name: name - range: string - required: true - description: - name: description - description: Description of what these vectors represent. - range: text - array: - name: array - range: AnyType - any_of: - - array: - dimensions: - - alias: dim0 - - array: - dimensions: - - alias: dim0 - - alias: dim1 - - array: - dimensions: - - alias: dim0 - - alias: dim1 - - alias: dim2 - - array: - dimensions: - - alias: dim0 - - alias: dim1 - - alias: dim2 - - alias: dim3 - tree_root: true - VectorIndex: - name: VectorIndex - description: Used with VectorData to encode a ragged array. An array of indices - into the first dimension of the target VectorData, and forming a map between - the rows of a DynamicTable and the indices of the VectorData. The name of the - VectorIndex is expected to be the name of the target VectorData object followed - by "_index". - is_a: VectorData - attributes: - name: - name: name - range: string - required: true - target: - name: target - description: Reference to the target dataset that this index applies to. - range: VectorData - tree_root: true - ElementIdentifiers: - name: ElementIdentifiers - description: A list of unique identifiers for values within a dataset, e.g. rows - of a DynamicTable. - is_a: Data - attributes: - name: - name: name - ifabsent: string(element_id) - range: string - required: true - tree_root: true - DynamicTableRegion: - name: DynamicTableRegion - description: DynamicTableRegion provides a link from one table to an index or - region of another. The `table` attribute is a link to another `DynamicTable`, - indicating which table is referenced, and the data is int(s) indicating the - row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to - associate rows with repeated meta-data without data duplication. They can also - be used to create hierarchical relationships between multiple `DynamicTable`s. - `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create - ragged references, so a single cell of a `DynamicTable` can reference many rows - of another `DynamicTable`. - is_a: VectorData - attributes: - name: - name: name - range: string - required: true - table: - name: table - description: Reference to the DynamicTable object that this region applies - to. - range: DynamicTable - description: - name: description - description: Description of what this table region points to. - range: text - tree_root: true - DynamicTable: - name: DynamicTable - description: A group containing multiple datasets that are aligned on the first - dimension (Currently, this requirement if left up to APIs to check and enforce). - These datasets represent different columns in the table. Apart from a column - that contains unique identifiers for each row, there are no other required datasets. - Users are free to add any number of custom VectorData objects (columns) here. - DynamicTable also supports ragged array columns, where each element can be of - a different size. To add a ragged array column, use a VectorIndex type to index - the corresponding VectorData type. See documentation for VectorData and VectorIndex - for more details. Unlike a compound data type, which is analogous to storing - an array-of-structs, a DynamicTable can be thought of as a struct-of-arrays. - This provides an alternative structure to choose from when optimizing storage - for anticipated access patterns. Additionally, this type provides a way of creating - a table without having to define a compound type up front. Although this convenience - may be attractive, users should think carefully about how data will be accessed. - DynamicTable is more appropriate for column-centric access, whereas a dataset - with a compound type would be more appropriate for row-centric access. Finally, - data size should also be taken into account. For small tables, performance loss - may be an acceptable trade-off for the flexibility of a DynamicTable. - is_a: Container - attributes: - name: - name: name - range: string - required: true - colnames: - name: colnames - description: The names of the columns in this table. This should be used to - specify an order to the columns. - range: text - description: - name: description - description: Description of what is in this dynamic table. - range: text - id: - name: id - description: Array of unique identifiers for the rows of this dynamic table. - array: - dimensions: - - alias: num_rows - range: int - required: true - multivalued: false - vector_data: - name: vector_data - description: Vector columns, including index columns, of this dynamic table. - range: VectorData - required: false - multivalued: true - tree_root: true - AlignedDynamicTable: - name: AlignedDynamicTable - description: DynamicTable container that supports storing a collection of sub-tables. - Each sub-table is a DynamicTable itself that is aligned with the main table - by row index. I.e., all DynamicTables stored in this group MUST have the same - number of rows. This type effectively defines a 2-level table in which the main - data is stored in the main table implemented by this type and additional columns - of the table are grouped into categories, with each category being represented - by a separate DynamicTable stored within the group. - is_a: DynamicTable - attributes: - children: - name: children - multivalued: true - inlined: true - inlined_as_list: false - any_of: - - range: DynamicTable - tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_6_0/namespace.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_6_0/namespace.yaml deleted file mode 100644 index 241b849..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_6_0/namespace.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: hdmf-common -annotations: - is_namespace: - tag: is_namespace - value: true - namespace: - tag: namespace - value: hdmf-common -description: Common data structures provided by HDMF -id: hdmf-common -version: 1.6.0 -imports: -- hdmf-common.base -- hdmf-common.table -- hdmf-common.sparse -- hdmf-common.nwb.language -default_prefix: hdmf-common/ diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_7_0/hdmf-common.base.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_7_0/hdmf-common.base.yaml deleted file mode 100644 index acf8a08..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_7_0/hdmf-common.base.yaml +++ /dev/null @@ -1,46 +0,0 @@ -name: hdmf-common.base -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.base -version: 1.7.0 -imports: -- hdmf-common.nwb.language -default_prefix: hdmf-common.base/ -classes: - Data: - name: Data - description: An abstract data type for a dataset. - attributes: - name: - name: name - range: string - required: true - tree_root: true - Container: - name: Container - description: An abstract data type for a group storing collections of data and - metadata. Base type for all data and metadata containers. - attributes: - name: - name: name - range: string - required: true - tree_root: true - SimpleMultiContainer: - name: SimpleMultiContainer - description: A simple Container for holding onto multiple containers. - is_a: Container - attributes: - children: - name: children - multivalued: true - inlined: true - inlined_as_list: false - any_of: - - range: Container - tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_7_0/hdmf-common.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_7_0/hdmf-common.nwb.language.yaml deleted file mode 100644 index 98c00e4..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_7_0/hdmf-common.nwb.language.yaml +++ /dev/null @@ -1,109 +0,0 @@ -name: hdmf-common.nwb.language -annotations: - is_namespace: - tag: is_namespace - value: 'False' - namespace: - tag: namespace - value: hdmf-experimental -description: Adapter objects to mimic the behavior of elements in the nwb-schema-language -id: nwb.language -imports: -- linkml:types -prefixes: - linkml: - prefix_prefix: linkml - prefix_reference: https://w3id.org/linkml -default_prefix: nwb.language/ -types: - float32: - name: float32 - typeof: float - repr: np.float32 - float64: - name: float64 - typeof: double - repr: np.float64 - long: - name: long - typeof: integer - repr: np.longlong - int64: - name: int64 - typeof: integer - repr: np.int64 - int: - name: int - typeof: integer - int32: - name: int32 - typeof: integer - repr: np.int32 - int16: - name: int16 - typeof: integer - repr: np.int16 - short: - name: short - typeof: integer - repr: np.int16 - int8: - name: int8 - typeof: integer - repr: np.int8 - uint: - name: uint - typeof: integer - repr: np.uint64 - minimum_value: 0 - uint32: - name: uint32 - typeof: integer - repr: np.uint32 - minimum_value: 0 - uint16: - name: uint16 - typeof: integer - repr: np.uint16 - minimum_value: 0 - uint8: - name: uint8 - typeof: integer - repr: np.uint8 - minimum_value: 0 - uint64: - name: uint64 - typeof: integer - repr: np.uint64 - minimum_value: 0 - numeric: - name: numeric - typeof: float - repr: np.number - text: - name: text - typeof: string - utf: - name: utf - typeof: string - utf8: - name: utf8 - typeof: string - utf_8: - name: utf_8 - typeof: string - ascii: - name: ascii - typeof: string - bool: - name: bool - typeof: boolean - isodatetime: - name: isodatetime - typeof: datetime - repr: np.datetime64 -classes: - AnyType: - name: AnyType - description: Needed because some classes in hdmf-common are datasets without dtype - class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_7_0/hdmf-common.sparse.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_7_0/hdmf-common.sparse.yaml deleted file mode 100644 index e258d51..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_7_0/hdmf-common.sparse.yaml +++ /dev/null @@ -1,66 +0,0 @@ -name: hdmf-common.sparse -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.sparse -version: 1.7.0 -imports: -- hdmf-common.base -- hdmf-common.nwb.language -default_prefix: hdmf-common.sparse/ -classes: - CSRMatrix: - name: CSRMatrix - description: A compressed sparse row matrix. Data are stored in the standard CSR - format, where column indices for row i are stored in indices[indptr[i]:indptr[i+1]] - and their corresponding values are stored in data[indptr[i]:indptr[i+1]]. - is_a: Container - attributes: - name: - name: name - range: string - required: true - shape: - name: shape - description: The shape (number of rows, number of columns) of this sparse - matrix. - range: uint - indices: - name: indices - description: The column indices. - array: - dimensions: - - alias: number_of_non_zero_values - range: uint - required: true - multivalued: false - indptr: - name: indptr - description: The row index pointer. - array: - dimensions: - - alias: number_of_rows_in_the_matrix_1 - range: uint - required: true - multivalued: false - data: - name: data - description: The non-zero values in the matrix. - range: CSRMatrix__data - required: true - multivalued: false - tree_root: true - CSRMatrix__data: - name: CSRMatrix__data - description: The non-zero values in the matrix. - attributes: - name: - name: name - ifabsent: string(data) - range: string - required: true - equals_string: data diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_7_0/hdmf-common.table.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_7_0/hdmf-common.table.yaml deleted file mode 100644 index 3dba25e..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_7_0/hdmf-common.table.yaml +++ /dev/null @@ -1,185 +0,0 @@ -name: hdmf-common.table -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-common -id: hdmf-common.table -version: 1.7.0 -imports: -- hdmf-common.base -- hdmf-common.nwb.language -default_prefix: hdmf-common.table/ -classes: - VectorData: - name: VectorData - description: An n-dimensional dataset representing a column of a DynamicTable. - If used without an accompanying VectorIndex, first dimension is along the rows - of the DynamicTable and each step along the first dimension is a cell of the - larger table. VectorData can also be used to represent a ragged array if paired - with a VectorIndex. This allows for storing arrays of varying length in a single - cell of the DynamicTable by indexing into this VectorData. The first vector - is at VectorData[0:VectorIndex[0]]. The second vector is at VectorData[VectorIndex[0]:VectorIndex[1]], - and so on. - is_a: Data - attributes: - name: - name: name - range: string - required: true - description: - name: description - description: Description of what these vectors represent. - range: text - array: - name: array - range: AnyType - any_of: - - array: - dimensions: - - alias: dim0 - - array: - dimensions: - - alias: dim0 - - alias: dim1 - - array: - dimensions: - - alias: dim0 - - alias: dim1 - - alias: dim2 - - array: - dimensions: - - alias: dim0 - - alias: dim1 - - alias: dim2 - - alias: dim3 - tree_root: true - VectorIndex: - name: VectorIndex - description: Used with VectorData to encode a ragged array. An array of indices - into the first dimension of the target VectorData, and forming a map between - the rows of a DynamicTable and the indices of the VectorData. The name of the - VectorIndex is expected to be the name of the target VectorData object followed - by "_index". - is_a: VectorData - attributes: - name: - name: name - range: string - required: true - target: - name: target - description: Reference to the target dataset that this index applies to. - range: VectorData - tree_root: true - ElementIdentifiers: - name: ElementIdentifiers - description: A list of unique identifiers for values within a dataset, e.g. rows - of a DynamicTable. - is_a: Data - attributes: - name: - name: name - ifabsent: string(element_id) - range: string - required: true - tree_root: true - DynamicTableRegion: - name: DynamicTableRegion - description: DynamicTableRegion provides a link from one table to an index or - region of another. The `table` attribute is a link to another `DynamicTable`, - indicating which table is referenced, and the data is int(s) indicating the - row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to - associate rows with repeated meta-data without data duplication. They can also - be used to create hierarchical relationships between multiple `DynamicTable`s. - `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create - ragged references, so a single cell of a `DynamicTable` can reference many rows - of another `DynamicTable`. - is_a: VectorData - attributes: - name: - name: name - range: string - required: true - table: - name: table - description: Reference to the DynamicTable object that this region applies - to. - range: DynamicTable - description: - name: description - description: Description of what this table region points to. - range: text - tree_root: true - DynamicTable: - name: DynamicTable - description: A group containing multiple datasets that are aligned on the first - dimension (Currently, this requirement if left up to APIs to check and enforce). - These datasets represent different columns in the table. Apart from a column - that contains unique identifiers for each row, there are no other required datasets. - Users are free to add any number of custom VectorData objects (columns) here. - DynamicTable also supports ragged array columns, where each element can be of - a different size. To add a ragged array column, use a VectorIndex type to index - the corresponding VectorData type. See documentation for VectorData and VectorIndex - for more details. Unlike a compound data type, which is analogous to storing - an array-of-structs, a DynamicTable can be thought of as a struct-of-arrays. - This provides an alternative structure to choose from when optimizing storage - for anticipated access patterns. Additionally, this type provides a way of creating - a table without having to define a compound type up front. Although this convenience - may be attractive, users should think carefully about how data will be accessed. - DynamicTable is more appropriate for column-centric access, whereas a dataset - with a compound type would be more appropriate for row-centric access. Finally, - data size should also be taken into account. For small tables, performance loss - may be an acceptable trade-off for the flexibility of a DynamicTable. - is_a: Container - attributes: - name: - name: name - range: string - required: true - colnames: - name: colnames - description: The names of the columns in this table. This should be used to - specify an order to the columns. - range: text - description: - name: description - description: Description of what is in this dynamic table. - range: text - id: - name: id - description: Array of unique identifiers for the rows of this dynamic table. - array: - dimensions: - - alias: num_rows - range: int - required: true - multivalued: false - vector_data: - name: vector_data - description: Vector columns, including index columns, of this dynamic table. - range: VectorData - required: false - multivalued: true - tree_root: true - AlignedDynamicTable: - name: AlignedDynamicTable - description: DynamicTable container that supports storing a collection of sub-tables. - Each sub-table is a DynamicTable itself that is aligned with the main table - by row index. I.e., all DynamicTables stored in this group MUST have the same - number of rows. This type effectively defines a 2-level table in which the main - data is stored in the main table implemented by this type and additional columns - of the table are grouped into categories, with each category being represented - by a separate DynamicTable stored within the group. - is_a: DynamicTable - attributes: - children: - name: children - multivalued: true - inlined: true - inlined_as_list: false - any_of: - - range: DynamicTable - tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_7_0/namespace.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_7_0/namespace.yaml deleted file mode 100644 index b689554..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_7_0/namespace.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: hdmf-common -annotations: - is_namespace: - tag: is_namespace - value: true - namespace: - tag: namespace - value: hdmf-common -description: Common data structures provided by HDMF -id: hdmf-common -version: 1.7.0 -imports: -- hdmf-common.base -- hdmf-common.table -- hdmf-common.sparse -- hdmf-common.nwb.language -default_prefix: hdmf-common/ diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_8_0/hdmf-common.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_8_0/hdmf-common.nwb.language.yaml index 98c00e4..c7a8401 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_8_0/hdmf-common.nwb.language.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_8_0/hdmf-common.nwb.language.yaml @@ -5,7 +5,7 @@ annotations: value: 'False' namespace: tag: namespace - value: hdmf-experimental + value: core description: Adapter objects to mimic the behavior of elements in the nwb-schema-language id: nwb.language imports: @@ -19,67 +19,53 @@ types: float32: name: float32 typeof: float - repr: np.float32 float64: name: float64 typeof: double - repr: np.float64 long: name: long typeof: integer - repr: np.longlong int64: name: int64 typeof: integer - repr: np.int64 int: name: int typeof: integer int32: name: int32 typeof: integer - repr: np.int32 int16: name: int16 typeof: integer - repr: np.int16 short: name: short typeof: integer - repr: np.int16 int8: name: int8 typeof: integer - repr: np.int8 uint: name: uint typeof: integer - repr: np.uint64 minimum_value: 0 uint32: name: uint32 typeof: integer - repr: np.uint32 minimum_value: 0 uint16: name: uint16 typeof: integer - repr: np.uint16 minimum_value: 0 uint8: name: uint8 typeof: integer - repr: np.uint8 minimum_value: 0 uint64: name: uint64 typeof: integer - repr: np.uint64 minimum_value: 0 numeric: name: numeric typeof: float - repr: np.number text: name: text typeof: string @@ -101,7 +87,6 @@ types: isodatetime: name: isodatetime typeof: datetime - repr: np.datetime64 classes: AnyType: name: AnyType diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/hdmf-experimental.experimental.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/hdmf-experimental.experimental.yaml index 6b54542..c14e264 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/hdmf-experimental.experimental.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/hdmf-experimental.experimental.yaml @@ -9,7 +9,7 @@ annotations: id: hdmf-experimental.experimental version: 0.1.0 imports: -- ../../hdmf_common/v1_4_0/namespace +- ../../hdmf_common/v1_5_0/namespace - hdmf-experimental.nwb.language default_prefix: hdmf-experimental.experimental/ classes: diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/hdmf-experimental.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/hdmf-experimental.nwb.language.yaml index a884e44..bab9ede 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/hdmf-experimental.nwb.language.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/hdmf-experimental.nwb.language.yaml @@ -5,7 +5,7 @@ annotations: value: 'False' namespace: tag: namespace - value: hdmf-experimental + value: core description: Adapter objects to mimic the behavior of elements in the nwb-schema-language id: nwb.language imports: @@ -19,67 +19,53 @@ types: float32: name: float32 typeof: float - repr: np.float32 float64: name: float64 typeof: double - repr: np.float64 long: name: long typeof: integer - repr: np.longlong int64: name: int64 typeof: integer - repr: np.int64 int: name: int typeof: integer int32: name: int32 typeof: integer - repr: np.int32 int16: name: int16 typeof: integer - repr: np.int16 short: name: short typeof: integer - repr: np.int16 int8: name: int8 typeof: integer - repr: np.int8 uint: name: uint typeof: integer - repr: np.uint64 minimum_value: 0 uint32: name: uint32 typeof: integer - repr: np.uint32 minimum_value: 0 uint16: name: uint16 typeof: integer - repr: np.uint16 minimum_value: 0 uint8: name: uint8 typeof: integer - repr: np.uint8 minimum_value: 0 uint64: name: uint64 typeof: integer - repr: np.uint64 minimum_value: 0 numeric: name: numeric typeof: float - repr: np.number text: name: text typeof: string @@ -101,7 +87,6 @@ types: isodatetime: name: isodatetime typeof: datetime - repr: np.datetime64 classes: AnyType: name: AnyType diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/hdmf-experimental.resources.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/hdmf-experimental.resources.yaml index 89ffc2c..17a7d9d 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/hdmf-experimental.resources.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/hdmf-experimental.resources.yaml @@ -9,7 +9,7 @@ annotations: id: hdmf-experimental.resources version: 0.1.0 imports: -- ../../hdmf_common/v1_4_0/namespace +- ../../hdmf_common/v1_5_0/namespace - hdmf-experimental.nwb.language default_prefix: hdmf-experimental.resources/ classes: diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_2_0/hdmf-experimental.experimental.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_2_0/hdmf-experimental.experimental.yaml deleted file mode 100644 index daf947b..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_2_0/hdmf-experimental.experimental.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: hdmf-experimental.experimental -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-experimental -id: hdmf-experimental.experimental -version: 0.2.0 -imports: -- ../../hdmf_common/v1_5_1/namespace -- hdmf-experimental.nwb.language -default_prefix: hdmf-experimental.experimental/ -classes: - EnumData: - name: EnumData - description: Data that come from a fixed set of values. A data value of i corresponds - to the i-th value in the VectorData referenced by the 'elements' attribute. - is_a: VectorData - attributes: - name: - name: name - range: string - required: true - elements: - name: elements - description: Reference to the VectorData object that contains the enumerable - elements - range: VectorData - tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_2_0/hdmf-experimental.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_2_0/hdmf-experimental.nwb.language.yaml deleted file mode 100644 index a884e44..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_2_0/hdmf-experimental.nwb.language.yaml +++ /dev/null @@ -1,109 +0,0 @@ -name: hdmf-experimental.nwb.language -annotations: - is_namespace: - tag: is_namespace - value: 'False' - namespace: - tag: namespace - value: hdmf-experimental -description: Adapter objects to mimic the behavior of elements in the nwb-schema-language -id: nwb.language -imports: -- linkml:types -prefixes: - linkml: - prefix_prefix: linkml - prefix_reference: https://w3id.org/linkml -default_prefix: nwb.language/ -types: - float32: - name: float32 - typeof: float - repr: np.float32 - float64: - name: float64 - typeof: double - repr: np.float64 - long: - name: long - typeof: integer - repr: np.longlong - int64: - name: int64 - typeof: integer - repr: np.int64 - int: - name: int - typeof: integer - int32: - name: int32 - typeof: integer - repr: np.int32 - int16: - name: int16 - typeof: integer - repr: np.int16 - short: - name: short - typeof: integer - repr: np.int16 - int8: - name: int8 - typeof: integer - repr: np.int8 - uint: - name: uint - typeof: integer - repr: np.uint64 - minimum_value: 0 - uint32: - name: uint32 - typeof: integer - repr: np.uint32 - minimum_value: 0 - uint16: - name: uint16 - typeof: integer - repr: np.uint16 - minimum_value: 0 - uint8: - name: uint8 - typeof: integer - repr: np.uint8 - minimum_value: 0 - uint64: - name: uint64 - typeof: integer - repr: np.uint64 - minimum_value: 0 - numeric: - name: numeric - typeof: float - repr: np.number - text: - name: text - typeof: string - utf: - name: utf - typeof: string - utf8: - name: utf8 - typeof: string - utf_8: - name: utf_8 - typeof: string - ascii: - name: ascii - typeof: string - bool: - name: bool - typeof: boolean - isodatetime: - name: isodatetime - typeof: datetime - repr: np.datetime64 -classes: - AnyType: - name: AnyType - description: Needed because some classes in hdmf-common are datasets without dtype - class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_2_0/hdmf-experimental.resources.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_2_0/hdmf-experimental.resources.yaml deleted file mode 100644 index c2fc8d8..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_2_0/hdmf-experimental.resources.yaml +++ /dev/null @@ -1,196 +0,0 @@ -name: hdmf-experimental.resources -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-experimental -id: hdmf-experimental.resources -version: 0.2.0 -imports: -- ../../hdmf_common/v1_5_1/namespace -- hdmf-experimental.nwb.language -default_prefix: hdmf-experimental.resources/ -classes: - ExternalResources: - name: ExternalResources - description: 'A set of four tables for tracking external resource references in - a file. NOTE: this data type is in beta testing and is subject to change in - a later version.' - is_a: Container - attributes: - name: - name: name - range: string - required: true - keys: - name: keys - description: A table for storing user terms that are used to refer to external - resources. - range: ExternalResources__keys - required: true - multivalued: false - entities: - name: entities - description: A table for mapping user terms (i.e., keys) to resource entities. - range: ExternalResources__entities - required: true - multivalued: false - resources: - name: resources - description: A table for mapping user terms (i.e., keys) to resource entities. - range: ExternalResources__resources - required: true - multivalued: false - objects: - name: objects - description: A table for identifying which objects in a file contain references - to external resources. - range: ExternalResources__objects - required: true - multivalued: false - object_keys: - name: object_keys - description: A table for identifying which objects use which keys. - range: ExternalResources__object_keys - required: true - multivalued: false - tree_root: true - ExternalResources__keys: - name: ExternalResources__keys - description: A table for storing user terms that are used to refer to external - resources. - is_a: Data - attributes: - name: - name: name - ifabsent: string(keys) - range: string - required: true - equals_string: keys - key: - name: key - description: The user term that maps to one or more resources in the 'resources' - table. - range: text - required: true - multivalued: false - ExternalResources__entities: - name: ExternalResources__entities - description: A table for mapping user terms (i.e., keys) to resource entities. - is_a: Data - attributes: - name: - name: name - ifabsent: string(entities) - range: string - required: true - equals_string: entities - keys_idx: - name: keys_idx - description: The index to the key in the 'keys' table. - range: uint - required: true - multivalued: false - resources_idx: - name: resources_idx - description: The index into the 'resources' table - range: uint - required: true - multivalued: false - entity_id: - name: entity_id - description: The unique identifier entity. - range: text - required: true - multivalued: false - entity_uri: - name: entity_uri - description: The URI for the entity this reference applies to. This can be - an empty string. - range: text - required: true - multivalued: false - ExternalResources__resources: - name: ExternalResources__resources - description: A table for mapping user terms (i.e., keys) to resource entities. - is_a: Data - attributes: - name: - name: name - ifabsent: string(resources) - range: string - required: true - equals_string: resources - resource: - name: resource - description: The name of the resource. - range: text - required: true - multivalued: false - resource_uri: - name: resource_uri - description: The URI for the resource. This can be an empty string. - range: text - required: true - multivalued: false - ExternalResources__objects: - name: ExternalResources__objects - description: A table for identifying which objects in a file contain references - to external resources. - is_a: Data - attributes: - name: - name: name - ifabsent: string(objects) - range: string - required: true - equals_string: objects - object_id: - name: object_id - description: The UUID for the object. - range: text - required: true - multivalued: false - relative_path: - name: relative_path - description: The relative path from the container with the object_id to the - dataset or attribute with the value(s) that is associated with an external - resource. This can be an empty string if the container is a dataset which - contains the value(s) that is associated with an external resource. - range: text - required: true - multivalued: false - field: - name: field - description: The field of the compound data type using an external resource. - This is used only if the dataset or attribute is a compound data type; otherwise - this should be an empty string. - range: text - required: true - multivalued: false - ExternalResources__object_keys: - name: ExternalResources__object_keys - description: A table for identifying which objects use which keys. - is_a: Data - attributes: - name: - name: name - ifabsent: string(object_keys) - range: string - required: true - equals_string: object_keys - objects_idx: - name: objects_idx - description: The index to the 'objects' table for the object that holds the - key. - range: uint - required: true - multivalued: false - keys_idx: - name: keys_idx - description: The index to the 'keys' table for the key. - range: uint - required: true - multivalued: false diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_2_0/namespace.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_2_0/namespace.yaml deleted file mode 100644 index 6a311e0..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_2_0/namespace.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: hdmf-experimental -annotations: - is_namespace: - tag: is_namespace - value: true - namespace: - tag: namespace - value: hdmf-experimental -description: Experimental data structures provided by HDMF. These are not guaranteed - to be available in the future. -id: hdmf-experimental -version: 0.2.0 -imports: -- hdmf-experimental.experimental -- hdmf-experimental.resources -- hdmf-experimental.nwb.language -default_prefix: hdmf-experimental/ diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_3_0/hdmf-experimental.experimental.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_3_0/hdmf-experimental.experimental.yaml deleted file mode 100644 index fb98004..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_3_0/hdmf-experimental.experimental.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: hdmf-experimental.experimental -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-experimental -id: hdmf-experimental.experimental -version: 0.3.0 -imports: -- ../../hdmf_common/v1_6_0/namespace -- hdmf-experimental.nwb.language -default_prefix: hdmf-experimental.experimental/ -classes: - EnumData: - name: EnumData - description: Data that come from a fixed set of values. A data value of i corresponds - to the i-th value in the VectorData referenced by the 'elements' attribute. - is_a: VectorData - attributes: - name: - name: name - range: string - required: true - elements: - name: elements - description: Reference to the VectorData object that contains the enumerable - elements - range: VectorData - tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_3_0/hdmf-experimental.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_3_0/hdmf-experimental.nwb.language.yaml deleted file mode 100644 index a884e44..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_3_0/hdmf-experimental.nwb.language.yaml +++ /dev/null @@ -1,109 +0,0 @@ -name: hdmf-experimental.nwb.language -annotations: - is_namespace: - tag: is_namespace - value: 'False' - namespace: - tag: namespace - value: hdmf-experimental -description: Adapter objects to mimic the behavior of elements in the nwb-schema-language -id: nwb.language -imports: -- linkml:types -prefixes: - linkml: - prefix_prefix: linkml - prefix_reference: https://w3id.org/linkml -default_prefix: nwb.language/ -types: - float32: - name: float32 - typeof: float - repr: np.float32 - float64: - name: float64 - typeof: double - repr: np.float64 - long: - name: long - typeof: integer - repr: np.longlong - int64: - name: int64 - typeof: integer - repr: np.int64 - int: - name: int - typeof: integer - int32: - name: int32 - typeof: integer - repr: np.int32 - int16: - name: int16 - typeof: integer - repr: np.int16 - short: - name: short - typeof: integer - repr: np.int16 - int8: - name: int8 - typeof: integer - repr: np.int8 - uint: - name: uint - typeof: integer - repr: np.uint64 - minimum_value: 0 - uint32: - name: uint32 - typeof: integer - repr: np.uint32 - minimum_value: 0 - uint16: - name: uint16 - typeof: integer - repr: np.uint16 - minimum_value: 0 - uint8: - name: uint8 - typeof: integer - repr: np.uint8 - minimum_value: 0 - uint64: - name: uint64 - typeof: integer - repr: np.uint64 - minimum_value: 0 - numeric: - name: numeric - typeof: float - repr: np.number - text: - name: text - typeof: string - utf: - name: utf - typeof: string - utf8: - name: utf8 - typeof: string - utf_8: - name: utf_8 - typeof: string - ascii: - name: ascii - typeof: string - bool: - name: bool - typeof: boolean - isodatetime: - name: isodatetime - typeof: datetime - repr: np.datetime64 -classes: - AnyType: - name: AnyType - description: Needed because some classes in hdmf-common are datasets without dtype - class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_3_0/hdmf-experimental.resources.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_3_0/hdmf-experimental.resources.yaml deleted file mode 100644 index 350ef24..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_3_0/hdmf-experimental.resources.yaml +++ /dev/null @@ -1,199 +0,0 @@ -name: hdmf-experimental.resources -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-experimental -id: hdmf-experimental.resources -version: 0.3.0 -imports: -- ../../hdmf_common/v1_6_0/namespace -- hdmf-experimental.nwb.language -default_prefix: hdmf-experimental.resources/ -classes: - ExternalResources: - name: ExternalResources - description: 'A set of five tables for tracking external resource references in - a file. NOTE: this data type is experimental and is subject to change in a later - version.' - is_a: Container - attributes: - name: - name: name - range: string - required: true - keys: - name: keys - description: A table for storing user terms that are used to refer to external - resources. - range: ExternalResources__keys - required: true - multivalued: false - files: - name: files - description: A table for storing object ids of files used in external resources. - range: ExternalResources__files - required: true - multivalued: false - entities: - name: entities - description: A table for mapping user terms (i.e., keys) to resource entities. - range: ExternalResources__entities - required: true - multivalued: false - objects: - name: objects - description: A table for identifying which objects in a file contain references - to external resources. - range: ExternalResources__objects - required: true - multivalued: false - object_keys: - name: object_keys - description: A table for identifying which objects use which keys. - range: ExternalResources__object_keys - required: true - multivalued: false - tree_root: true - ExternalResources__keys: - name: ExternalResources__keys - description: A table for storing user terms that are used to refer to external - resources. - is_a: Data - attributes: - name: - name: name - ifabsent: string(keys) - range: string - required: true - equals_string: keys - key: - name: key - description: The user term that maps to one or more resources in the `resources` - table, e.g., "human". - range: text - required: true - multivalued: false - ExternalResources__files: - name: ExternalResources__files - description: A table for storing object ids of files used in external resources. - is_a: Data - attributes: - name: - name: name - ifabsent: string(files) - range: string - required: true - equals_string: files - file_object_id: - name: file_object_id - description: The object id (UUID) of a file that contains objects that refers - to external resources. - range: text - required: true - multivalued: false - ExternalResources__entities: - name: ExternalResources__entities - description: A table for mapping user terms (i.e., keys) to resource entities. - is_a: Data - attributes: - name: - name: name - ifabsent: string(entities) - range: string - required: true - equals_string: entities - keys_idx: - name: keys_idx - description: The row index to the key in the `keys` table. - range: uint - required: true - multivalued: false - entity_id: - name: entity_id - description: The compact uniform resource identifier (CURIE) of the entity, - in the form [prefix]:[unique local identifier], e.g., 'NCBI_TAXON:9606'. - range: text - required: true - multivalued: false - entity_uri: - name: entity_uri - description: The URI for the entity this reference applies to. This can be - an empty string. e.g., https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=info&id=9606 - range: text - required: true - multivalued: false - ExternalResources__objects: - name: ExternalResources__objects - description: A table for identifying which objects in a file contain references - to external resources. - is_a: Data - attributes: - name: - name: name - ifabsent: string(objects) - range: string - required: true - equals_string: objects - files_idx: - name: files_idx - description: The row index to the file in the `files` table containing the - object. - range: uint - required: true - multivalued: false - object_id: - name: object_id - description: The object id (UUID) of the object. - range: text - required: true - multivalued: false - object_type: - name: object_type - description: The data type of the object. - range: text - required: true - multivalued: false - relative_path: - name: relative_path - description: The relative path from the data object with the `object_id` to - the dataset or attribute with the value(s) that is associated with an external - resource. This can be an empty string if the object is a dataset that contains - the value(s) that is associated with an external resource. - range: text - required: true - multivalued: false - field: - name: field - description: The field within the compound data type using an external resource. - This is used only if the dataset or attribute is a compound data type; otherwise - this should be an empty string. - range: text - required: true - multivalued: false - ExternalResources__object_keys: - name: ExternalResources__object_keys - description: A table for identifying which objects use which keys. - is_a: Data - attributes: - name: - name: name - ifabsent: string(object_keys) - range: string - required: true - equals_string: object_keys - objects_idx: - name: objects_idx - description: The row index to the object in the `objects` table that holds - the key - range: uint - required: true - multivalued: false - keys_idx: - name: keys_idx - description: The row index to the key in the `keys` table. - range: uint - required: true - multivalued: false diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_3_0/namespace.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_3_0/namespace.yaml deleted file mode 100644 index fe62e64..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_3_0/namespace.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: hdmf-experimental -annotations: - is_namespace: - tag: is_namespace - value: true - namespace: - tag: namespace - value: hdmf-experimental -description: Experimental data structures provided by HDMF. These are not guaranteed - to be available in the future. -id: hdmf-experimental -version: 0.3.0 -imports: -- hdmf-experimental.experimental -- hdmf-experimental.resources -- hdmf-experimental.nwb.language -default_prefix: hdmf-experimental/ diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_4_0/hdmf-experimental.experimental.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_4_0/hdmf-experimental.experimental.yaml deleted file mode 100644 index 31c2867..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_4_0/hdmf-experimental.experimental.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: hdmf-experimental.experimental -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-experimental -id: hdmf-experimental.experimental -version: 0.4.0 -imports: -- ../../hdmf_common/v1_7_0/namespace -- hdmf-experimental.nwb.language -default_prefix: hdmf-experimental.experimental/ -classes: - EnumData: - name: EnumData - description: Data that come from a fixed set of values. A data value of i corresponds - to the i-th value in the VectorData referenced by the 'elements' attribute. - is_a: VectorData - attributes: - name: - name: name - range: string - required: true - elements: - name: elements - description: Reference to the VectorData object that contains the enumerable - elements - range: VectorData - tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_4_0/hdmf-experimental.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_4_0/hdmf-experimental.nwb.language.yaml deleted file mode 100644 index a884e44..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_4_0/hdmf-experimental.nwb.language.yaml +++ /dev/null @@ -1,109 +0,0 @@ -name: hdmf-experimental.nwb.language -annotations: - is_namespace: - tag: is_namespace - value: 'False' - namespace: - tag: namespace - value: hdmf-experimental -description: Adapter objects to mimic the behavior of elements in the nwb-schema-language -id: nwb.language -imports: -- linkml:types -prefixes: - linkml: - prefix_prefix: linkml - prefix_reference: https://w3id.org/linkml -default_prefix: nwb.language/ -types: - float32: - name: float32 - typeof: float - repr: np.float32 - float64: - name: float64 - typeof: double - repr: np.float64 - long: - name: long - typeof: integer - repr: np.longlong - int64: - name: int64 - typeof: integer - repr: np.int64 - int: - name: int - typeof: integer - int32: - name: int32 - typeof: integer - repr: np.int32 - int16: - name: int16 - typeof: integer - repr: np.int16 - short: - name: short - typeof: integer - repr: np.int16 - int8: - name: int8 - typeof: integer - repr: np.int8 - uint: - name: uint - typeof: integer - repr: np.uint64 - minimum_value: 0 - uint32: - name: uint32 - typeof: integer - repr: np.uint32 - minimum_value: 0 - uint16: - name: uint16 - typeof: integer - repr: np.uint16 - minimum_value: 0 - uint8: - name: uint8 - typeof: integer - repr: np.uint8 - minimum_value: 0 - uint64: - name: uint64 - typeof: integer - repr: np.uint64 - minimum_value: 0 - numeric: - name: numeric - typeof: float - repr: np.number - text: - name: text - typeof: string - utf: - name: utf - typeof: string - utf8: - name: utf8 - typeof: string - utf_8: - name: utf_8 - typeof: string - ascii: - name: ascii - typeof: string - bool: - name: bool - typeof: boolean - isodatetime: - name: isodatetime - typeof: datetime - repr: np.datetime64 -classes: - AnyType: - name: AnyType - description: Needed because some classes in hdmf-common are datasets without dtype - class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_4_0/hdmf-experimental.resources.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_4_0/hdmf-experimental.resources.yaml deleted file mode 100644 index 8768e73..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_4_0/hdmf-experimental.resources.yaml +++ /dev/null @@ -1,222 +0,0 @@ -name: hdmf-experimental.resources -annotations: - is_namespace: - tag: is_namespace - value: false - namespace: - tag: namespace - value: hdmf-experimental -id: hdmf-experimental.resources -version: 0.4.0 -imports: -- ../../hdmf_common/v1_7_0/namespace -- hdmf-experimental.nwb.language -default_prefix: hdmf-experimental.resources/ -classes: - ExternalResources: - name: ExternalResources - description: 'A set of five tables for tracking external resource references in - a file. NOTE: this data type is experimental and is subject to change in a later - version.' - is_a: Container - attributes: - name: - name: name - range: string - required: true - keys: - name: keys - description: A table for storing user terms that are used to refer to external - resources. - range: ExternalResources__keys - required: true - multivalued: false - files: - name: files - description: A table for storing object ids of files used in external resources. - range: ExternalResources__files - required: true - multivalued: false - entities: - name: entities - description: A table for mapping user terms (i.e., keys) to resource entities. - range: ExternalResources__entities - required: true - multivalued: false - objects: - name: objects - description: A table for identifying which objects in a file contain references - to external resources. - range: ExternalResources__objects - required: true - multivalued: false - object_keys: - name: object_keys - description: A table for identifying which objects use which keys. - range: ExternalResources__object_keys - required: true - multivalued: false - entity_keys: - name: entity_keys - description: A table for identifying which keys use which entity. - range: ExternalResources__entity_keys - required: true - multivalued: false - tree_root: true - ExternalResources__keys: - name: ExternalResources__keys - description: A table for storing user terms that are used to refer to external - resources. - is_a: Data - attributes: - name: - name: name - ifabsent: string(keys) - range: string - required: true - equals_string: keys - key: - name: key - description: The user term that maps to one or more resources in the `resources` - table, e.g., "human". - range: text - required: true - multivalued: false - ExternalResources__files: - name: ExternalResources__files - description: A table for storing object ids of files used in external resources. - is_a: Data - attributes: - name: - name: name - ifabsent: string(files) - range: string - required: true - equals_string: files - file_object_id: - name: file_object_id - description: The object id (UUID) of a file that contains objects that refers - to external resources. - range: text - required: true - multivalued: false - ExternalResources__entities: - name: ExternalResources__entities - description: A table for mapping user terms (i.e., keys) to resource entities. - is_a: Data - attributes: - name: - name: name - ifabsent: string(entities) - range: string - required: true - equals_string: entities - entity_id: - name: entity_id - description: The compact uniform resource identifier (CURIE) of the entity, - in the form [prefix]:[unique local identifier], e.g., 'NCBI_TAXON:9606'. - range: text - required: true - multivalued: false - entity_uri: - name: entity_uri - description: The URI for the entity this reference applies to. This can be - an empty string. e.g., https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=info&id=9606 - range: text - required: true - multivalued: false - ExternalResources__objects: - name: ExternalResources__objects - description: A table for identifying which objects in a file contain references - to external resources. - is_a: Data - attributes: - name: - name: name - ifabsent: string(objects) - range: string - required: true - equals_string: objects - files_idx: - name: files_idx - description: The row index to the file in the `files` table containing the - object. - range: uint - required: true - multivalued: false - object_id: - name: object_id - description: The object id (UUID) of the object. - range: text - required: true - multivalued: false - object_type: - name: object_type - description: The data type of the object. - range: text - required: true - multivalued: false - relative_path: - name: relative_path - description: The relative path from the data object with the `object_id` to - the dataset or attribute with the value(s) that is associated with an external - resource. This can be an empty string if the object is a dataset that contains - the value(s) that is associated with an external resource. - range: text - required: true - multivalued: false - field: - name: field - description: The field within the compound data type using an external resource. - This is used only if the dataset or attribute is a compound data type; otherwise - this should be an empty string. - range: text - required: true - multivalued: false - ExternalResources__object_keys: - name: ExternalResources__object_keys - description: A table for identifying which objects use which keys. - is_a: Data - attributes: - name: - name: name - ifabsent: string(object_keys) - range: string - required: true - equals_string: object_keys - objects_idx: - name: objects_idx - description: The row index to the object in the `objects` table that holds - the key - range: uint - required: true - multivalued: false - keys_idx: - name: keys_idx - description: The row index to the key in the `keys` table. - range: uint - required: true - multivalued: false - ExternalResources__entity_keys: - name: ExternalResources__entity_keys - description: A table for identifying which keys use which entity. - is_a: Data - attributes: - name: - name: name - ifabsent: string(entity_keys) - range: string - required: true - equals_string: entity_keys - entities_idx: - name: entities_idx - description: The row index to the entity in the `entities` table. - range: uint - required: true - multivalued: false - keys_idx: - name: keys_idx - description: The row index to the key in the `keys` table. - range: uint - required: true - multivalued: false diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_4_0/namespace.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_4_0/namespace.yaml deleted file mode 100644 index a48814e..0000000 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_4_0/namespace.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: hdmf-experimental -annotations: - is_namespace: - tag: is_namespace - value: true - namespace: - tag: namespace - value: hdmf-experimental -description: Experimental data structures provided by HDMF. These are not guaranteed - to be available in the future. -id: hdmf-experimental -version: 0.4.0 -imports: -- hdmf-experimental.experimental -- hdmf-experimental.resources -- hdmf-experimental.nwb.language -default_prefix: hdmf-experimental/ diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_5_0/hdmf-experimental.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_5_0/hdmf-experimental.nwb.language.yaml index a884e44..bab9ede 100644 --- a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_5_0/hdmf-experimental.nwb.language.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_5_0/hdmf-experimental.nwb.language.yaml @@ -5,7 +5,7 @@ annotations: value: 'False' namespace: tag: namespace - value: hdmf-experimental + value: core description: Adapter objects to mimic the behavior of elements in the nwb-schema-language id: nwb.language imports: @@ -19,67 +19,53 @@ types: float32: name: float32 typeof: float - repr: np.float32 float64: name: float64 typeof: double - repr: np.float64 long: name: long typeof: integer - repr: np.longlong int64: name: int64 typeof: integer - repr: np.int64 int: name: int typeof: integer int32: name: int32 typeof: integer - repr: np.int32 int16: name: int16 typeof: integer - repr: np.int16 short: name: short typeof: integer - repr: np.int16 int8: name: int8 typeof: integer - repr: np.int8 uint: name: uint typeof: integer - repr: np.uint64 minimum_value: 0 uint32: name: uint32 typeof: integer - repr: np.uint32 minimum_value: 0 uint16: name: uint16 typeof: integer - repr: np.uint16 minimum_value: 0 uint8: name: uint8 typeof: integer - repr: np.uint8 minimum_value: 0 uint64: name: uint64 typeof: integer - repr: np.uint64 minimum_value: 0 numeric: name: numeric typeof: float - repr: np.number text: name: text typeof: string @@ -101,7 +87,6 @@ types: isodatetime: name: isodatetime typeof: datetime - repr: np.datetime64 classes: AnyType: name: AnyType