Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/thread/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
4 changes: 1 addition & 3 deletions src/thread/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down