Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type annotations to DependencyResolver fields #3458

Merged
merged 2 commits into from
May 27, 2024
Merged
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
8 changes: 4 additions & 4 deletions parsl/dataflow/dependency_resolvers.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from concurrent.futures import Future
from dataclasses import dataclass
from functools import singledispatch
from typing import Callable
from typing import Callable, Sequence


@dataclass
class DependencyResolver:
"""A DependencyResolver describes how app dependencies can be resolved.
It is specified as two functions: `traverse_to_gather` which turns an
app parameter into a list of futures which must be waited for before
app parameter into a sequence of futures which must be waited for before
the task can be executed (for example, in the case of
`DEEP_DEPENDENCY_RESOLVER` this traverses structures such as lists to
find every contained ``Future``), and `traverse_to_unwrap` which turns an
Expand All @@ -20,8 +20,8 @@ class DependencyResolver:
By default, Parsl will use `SHALLOW_DEPENDENCY_RESOLVER` which only
resolves Futures passed directly as arguments.
"""
traverse_to_gather: Callable
traverse_to_unwrap: Callable
traverse_to_gather: Callable[[object], Sequence[Future]]
traverse_to_unwrap: Callable[[object], object]


@singledispatch
Expand Down
Loading