Skip to content

Commit a86772e

Browse files
fix: Utilise parsed length
1 parent c4eb1f5 commit a86772e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/thread/thread.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ def _wrap_function(self, function: TargetFunction) -> TargetFunction:
387387
@wraps(function)
388388
def wrapper(
389389
index: int,
390+
length: int,
390391
data_chunk: Generator[_Dataset_T, None, None],
391392
*args: _Target_P.args,
392393
**kwargs: _Target_P.kwargs,
@@ -397,7 +398,7 @@ def wrapper(
397398
for data_entry in data_chunk:
398399
v = function(data_entry, *args, **kwargs)
399400
computed.append(v)
400-
self._threads[index].progress = round((i + 1) / len(data_chunk), 5)
401+
self._threads[index].progress = round((i + 1) / length, 5)
401402
i += 1
402403

403404
self._completed += 1

0 commit comments

Comments
 (0)