From a2ea9ccf9bc33cac900c14170440b6c7e62b6e0f Mon Sep 17 00:00:00 2001 From: Ben Clifford Date: Mon, 27 May 2024 11:41:17 +0200 Subject: [PATCH] Add type annotations to DependencyResolver fields (#3458) --- parsl/dataflow/dependency_resolvers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/parsl/dataflow/dependency_resolvers.py b/parsl/dataflow/dependency_resolvers.py index 60e017a539..a2987cd7ce 100644 --- a/parsl/dataflow/dependency_resolvers.py +++ b/parsl/dataflow/dependency_resolvers.py @@ -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 @@ -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