Skip to content

Commit e089347

Browse files
committed
Use plural
1 parent da279ac commit e089347

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/optimagic/optimization/history.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -403,17 +403,17 @@ def _batch_apply(
403403
other values of that batch are set to zero.
404404
405405
"""
406-
batch_start = _get_batch_start(batch_ids)
407-
batch_stop = [*batch_start, len(data)][1:]
406+
batch_starts = _get_batch_start(batch_ids)
407+
batch_stops = [*batch_starts, len(data)][1:]
408408

409-
batch_result = []
409+
batch_results = []
410410
for batch, (start, stop) in zip(
411-
batch_ids, zip(batch_start, batch_stop, strict=False), strict=False
411+
batch_ids, zip(batch_starts, batch_stops, strict=False), strict=False
412412
):
413413
try:
414414
batch_data = data[start:stop]
415415
reduced = func(batch_data)
416-
batch_result.append(reduced)
416+
batch_results.append(reduced)
417417
except Exception as e:
418418
msg = (
419419
f"Calling function {func.__name__} on batch {batch} of the History "
@@ -423,7 +423,7 @@ def _batch_apply(
423423
raise ValueError(msg) from e
424424

425425
out = np.zeros_like(data)
426-
out[batch_start] = batch_result
426+
out[batch_starts] = batch_results
427427
return out
428428

429429

0 commit comments

Comments
 (0)