diff --git a/src/thread/_types.py b/src/thread/_types.py index 8040d78..6a50a1e 100644 --- a/src/thread/_types.py +++ b/src/thread/_types.py @@ -5,7 +5,7 @@ """ from typing import Any, Literal, Callable, Union -from typing_extensions import ParamSpec, TypeVar +from typing_extensions import ParamSpec, TypeVar, Concatenate # Descriptive Types @@ -34,4 +34,4 @@ HookFunction = Callable[[_Target_T], Union[Any, None]] _Dataset_T = TypeVar('_Dataset_T') -DatasetFunction = Callable[[_Dataset_T], _Target_T] +DatasetFunction = Callable[Concatenate[_Dataset_T, _Target_P], _Target_T] diff --git a/src/thread/thread.py b/src/thread/thread.py index a0017a6..325374e 100644 --- a/src/thread/thread.py +++ b/src/thread/thread.py @@ -346,7 +346,7 @@ class ParallelProcessing(Generic[_Target_P, _Target_T, _Dataset_T]): def __init__( self, - function: DatasetFunction[_Dataset_T, _Target_T], + function: DatasetFunction[_Dataset_T, _Target_P, _Target_T], dataset: Sequence[_Dataset_T], max_threads: int = 8, *overflow_args: Overflow_In, @@ -507,8 +507,6 @@ def start(self) -> None: i: v for i, v in self.overflow_kwargs.items() if i != 'name' and i != 'args' } - print(parsed_args, self.overflow_args) - for i, data_chunk in enumerate(chunk_split(self.dataset, max_threads)): chunk_thread = Thread( target=self.function,