Skip to content

Commit

Permalink
Mod: Update internal code for base class.
Browse files Browse the repository at this point in the history
  • Loading branch information
Labbeti committed Apr 26, 2024
1 parent f2cab94 commit 3389329
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/aac_datasets/datasets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,14 @@ def at(

if isinstance(index, Iterable):
index = list(index)
if all(isinstance(idx_i, bool) for idx_i in index):
if is_iterable_bool(index):
if len(index) != len(self):
raise IndexError(
f"The length of the mask ({len(index)}) does not match the length of the dataset ({len(self)})."
)
index = [i for i, idx_i in enumerate(index) if idx_i]

elif not all(isinstance(idx_i, int) for idx_i in index):
elif not is_iterable_int(index):
raise TypeError(
f"Invalid input type for index={index}. (expected Iterable[int], not Iterable[{index[0].__class__.__name__}])"
)
Expand Down

0 comments on commit 3389329

Please sign in to comment.