Skip to content

Commit

Permalink
remove break
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasloveday committed Jan 29, 2025
1 parent bd1294d commit 54b5510
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/scores/processing/block_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,15 @@ def _block_bootstrap( # pylint: disable=too-many-locals
raise ValueError(f"Block dimension {d} is not the same size on all input arrays")

# Retrieve sizes of the bootstrap dimensions from arrays_list
sizes = None
for obj in arrays_list:
try:
sizes = OrderedDict(
{d: (obj.sizes[d], b) for d, b in blocks.items()},
)
break
except KeyError:
pass
# Iterate over the arrays until we find one that contains all dimensions
sizes = next(
(
OrderedDict([(d, (obj.sizes[d], b)) for d, b in blocks.items()])
for obj in arrays_list
if all(d in obj.sizes for d in blocks)
),
None,
)
if sizes is None:
raise ValueError(
"At least one input array must contain all dimensions in blocks.keys()",
Expand Down

0 comments on commit 54b5510

Please sign in to comment.