From 652ddb3b4846957f0894b68727e9e1a6bc763353 Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Mon, 5 Aug 2024 17:09:58 -0700 Subject: [PATCH] update hdmf common table --- .../hdmf_common/v1_1_0/hdmf_common_table.py | 18 +++++++++--------- .../hdmf_common/v1_1_2/hdmf_common_table.py | 18 +++++++++--------- .../hdmf_common/v1_1_3/hdmf_common_table.py | 18 +++++++++--------- .../hdmf_common/v1_5_0/hdmf_common_table.py | 18 +++++++++--------- .../hdmf_common/v1_8_0/hdmf_common_table.py | 18 +++++++++--------- 5 files changed, 45 insertions(+), 45 deletions(-) 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 b212cef..93d1574 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 @@ -57,21 +57,21 @@ class VectorDataMixin(BaseModel): _index: Optional["VectorIndex"] = None # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None + value: 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] + return self.value[item] 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 else: - self.array[key] = value + self.value[key] = value class VectorIndexMixin(BaseModel): @@ -80,7 +80,7 @@ class VectorIndexMixin(BaseModel): """ # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None + value: Optional[NDArray] = None target: Optional["VectorData"] = None def _getitem_helper(self, arg: int) -> Union[list, NDArray]: @@ -88,18 +88,18 @@ class VectorIndexMixin(BaseModel): Mimicking :func:`hdmf.common.table.VectorIndex.__getitem_helper` """ - start = 0 if arg == 0 else self.array[arg - 1] - end = self.array[arg] + start = 0 if arg == 0 else self.value[arg - 1] + end = self.value[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] + return self.value[item] elif type(self.target).__name__ == "VectorData": if isinstance(item, int): return self._getitem_helper(item) else: - idx = range(*item.indices(len(self.array))) + idx = range(*item.indices(len(self.value))) return [self._getitem_helper(i) for i in idx] else: raise NotImplementedError("DynamicTableRange not supported yet") @@ -109,7 +109,7 @@ class VectorIndexMixin(BaseModel): # VectorIndex is the thing that knows how to do the slicing self._index[key] = value else: - self.array[key] = value + self.value[key] = value class DynamicTableMixin(BaseModel): 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 9d1bdb6..25748ee 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 @@ -57,21 +57,21 @@ class VectorDataMixin(BaseModel): _index: Optional["VectorIndex"] = None # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None + value: 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] + return self.value[item] 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 else: - self.array[key] = value + self.value[key] = value class VectorIndexMixin(BaseModel): @@ -80,7 +80,7 @@ class VectorIndexMixin(BaseModel): """ # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None + value: Optional[NDArray] = None target: Optional["VectorData"] = None def _getitem_helper(self, arg: int) -> Union[list, NDArray]: @@ -88,18 +88,18 @@ class VectorIndexMixin(BaseModel): Mimicking :func:`hdmf.common.table.VectorIndex.__getitem_helper` """ - start = 0 if arg == 0 else self.array[arg - 1] - end = self.array[arg] + start = 0 if arg == 0 else self.value[arg - 1] + end = self.value[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] + return self.value[item] elif type(self.target).__name__ == "VectorData": if isinstance(item, int): return self._getitem_helper(item) else: - idx = range(*item.indices(len(self.array))) + idx = range(*item.indices(len(self.value))) return [self._getitem_helper(i) for i in idx] else: raise NotImplementedError("DynamicTableRange not supported yet") @@ -109,7 +109,7 @@ class VectorIndexMixin(BaseModel): # VectorIndex is the thing that knows how to do the slicing self._index[key] = value else: - self.array[key] = value + self.value[key] = value class DynamicTableMixin(BaseModel): 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 7ca0724..3d4762c 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 @@ -57,21 +57,21 @@ class VectorDataMixin(BaseModel): _index: Optional["VectorIndex"] = None # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None + value: 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] + return self.value[item] 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 else: - self.array[key] = value + self.value[key] = value class VectorIndexMixin(BaseModel): @@ -80,7 +80,7 @@ class VectorIndexMixin(BaseModel): """ # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None + value: Optional[NDArray] = None target: Optional["VectorData"] = None def _getitem_helper(self, arg: int) -> Union[list, NDArray]: @@ -88,18 +88,18 @@ class VectorIndexMixin(BaseModel): Mimicking :func:`hdmf.common.table.VectorIndex.__getitem_helper` """ - start = 0 if arg == 0 else self.array[arg - 1] - end = self.array[arg] + start = 0 if arg == 0 else self.value[arg - 1] + end = self.value[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] + return self.value[item] elif type(self.target).__name__ == "VectorData": if isinstance(item, int): return self._getitem_helper(item) else: - idx = range(*item.indices(len(self.array))) + idx = range(*item.indices(len(self.value))) return [self._getitem_helper(i) for i in idx] else: raise NotImplementedError("DynamicTableRange not supported yet") @@ -109,7 +109,7 @@ class VectorIndexMixin(BaseModel): # VectorIndex is the thing that knows how to do the slicing self._index[key] = value else: - self.array[key] = value + self.value[key] = value class DynamicTableMixin(BaseModel): 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 7df7183..61e5ba2 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 @@ -58,21 +58,21 @@ class VectorDataMixin(BaseModel): _index: Optional["VectorIndex"] = None # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None + value: 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] + return self.value[item] 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 else: - self.array[key] = value + self.value[key] = value class VectorIndexMixin(BaseModel): @@ -81,7 +81,7 @@ class VectorIndexMixin(BaseModel): """ # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None + value: Optional[NDArray] = None target: Optional["VectorData"] = None def _getitem_helper(self, arg: int) -> Union[list, NDArray]: @@ -89,18 +89,18 @@ class VectorIndexMixin(BaseModel): Mimicking :func:`hdmf.common.table.VectorIndex.__getitem_helper` """ - start = 0 if arg == 0 else self.array[arg - 1] - end = self.array[arg] + start = 0 if arg == 0 else self.value[arg - 1] + end = self.value[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] + return self.value[item] elif type(self.target).__name__ == "VectorData": if isinstance(item, int): return self._getitem_helper(item) else: - idx = range(*item.indices(len(self.array))) + idx = range(*item.indices(len(self.value))) return [self._getitem_helper(i) for i in idx] else: raise NotImplementedError("DynamicTableRange not supported yet") @@ -110,7 +110,7 @@ class VectorIndexMixin(BaseModel): # VectorIndex is the thing that knows how to do the slicing self._index[key] = value else: - self.array[key] = value + self.value[key] = value class DynamicTableMixin(BaseModel): 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 e168269..e1e413c 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 @@ -58,21 +58,21 @@ class VectorDataMixin(BaseModel): _index: Optional["VectorIndex"] = None # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None + value: 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] + return self.value[item] 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 else: - self.array[key] = value + self.value[key] = value class VectorIndexMixin(BaseModel): @@ -81,7 +81,7 @@ class VectorIndexMixin(BaseModel): """ # redefined in `VectorData`, but included here for testing and type checking - array: Optional[NDArray] = None + value: Optional[NDArray] = None target: Optional["VectorData"] = None def _getitem_helper(self, arg: int) -> Union[list, NDArray]: @@ -89,18 +89,18 @@ class VectorIndexMixin(BaseModel): Mimicking :func:`hdmf.common.table.VectorIndex.__getitem_helper` """ - start = 0 if arg == 0 else self.array[arg - 1] - end = self.array[arg] + start = 0 if arg == 0 else self.value[arg - 1] + end = self.value[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] + return self.value[item] elif type(self.target).__name__ == "VectorData": if isinstance(item, int): return self._getitem_helper(item) else: - idx = range(*item.indices(len(self.array))) + idx = range(*item.indices(len(self.value))) return [self._getitem_helper(i) for i in idx] else: raise NotImplementedError("DynamicTableRange not supported yet") @@ -110,7 +110,7 @@ class VectorIndexMixin(BaseModel): # VectorIndex is the thing that knows how to do the slicing self._index[key] = value else: - self.array[key] = value + self.value[key] = value class DynamicTableMixin(BaseModel):