Skip to content

Commit

Permalink
bump minor
Browse files Browse the repository at this point in the history
  • Loading branch information
andycasey committed Jan 25, 2024
1 parent 6dab20a commit f7dd19a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/sdss_semaphore/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.2.3"
__version__ = "0.2.4"

import numpy as np
import warnings
Expand Down Expand Up @@ -69,6 +69,11 @@ def __init__(self, array: Optional[Union[np.ndarray, Iterable[Iterable[int]], It
self.array = np.atleast_2d(array).astype(self.dtype)
return None

def __getitem__(self, index: int):
if isinstance(index, tuple):
raise IndexError("too many indices for array; you can only slice on items")
return self.__class__(self.array[[index]])

@property
def dtype(self):
raise NotImplementedError(f"`dtype` must be defined in subclass")
Expand Down Expand Up @@ -345,4 +350,4 @@ def __repr__(self):

def __len__(self):
N, B = self.array.shape
return N
return N

0 comments on commit f7dd19a

Please sign in to comment.