From a78b95d6666b6833eee50efd0e2fdd177075b691 Mon Sep 17 00:00:00 2001 From: Tim Pillinger <26465611+wxtim@users.noreply.github.com> Date: Thu, 31 Oct 2024 09:25:14 +0000 Subject: [PATCH] Review suggestions Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com> --- cylc/flow/prerequisite.py | 2 +- cylc/flow/task_pool.py | 2 +- cylc/flow/task_proxy.py | 4 +++- cylc/flow/task_state.py | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cylc/flow/prerequisite.py b/cylc/flow/prerequisite.py index 4dbb4001dc..94221fd790 100644 --- a/cylc/flow/prerequisite.py +++ b/cylc/flow/prerequisite.py @@ -264,7 +264,7 @@ def _eval_satisfied(self) -> bool: def satisfy_me( self, outputs: Iterable['Tokens'], - mode: "Optional[Union[RunMode, str]]" = RunMode.LIVE + mode: Optional[RunMode] = RunMode.LIVE ) -> 'Set[Tokens]': """Attempt to satisfy me with given outputs. diff --git a/cylc/flow/task_pool.py b/cylc/flow/task_pool.py index 0ef87e4a79..4543a22991 100644 --- a/cylc/flow/task_pool.py +++ b/cylc/flow/task_pool.py @@ -1553,7 +1553,7 @@ def spawn_on_all_outputs( if completed_only: c_task.satisfy_me( [itask.tokens.duplicate(task_sel=message)], - mode=itask.run_mode # type: ignore + mode=itask.run_mode ) self.data_store_mgr.delta_task_prerequisite(c_task) self.add_to_pool(c_task) diff --git a/cylc/flow/task_proxy.py b/cylc/flow/task_proxy.py index 270ac35307..45012c378d 100644 --- a/cylc/flow/task_proxy.py +++ b/cylc/flow/task_proxy.py @@ -550,7 +550,9 @@ def state_reset( return False def satisfy_me( - self, task_messages: 'Iterable[Tokens]', mode: "RunMode" = RunMode.LIVE + self, + task_messages: 'Iterable[Tokens]', + mode: Optional[RunMode] = RunMode.LIVE, ) -> 'Set[Tokens]': """Try to satisfy my prerequisites with given output messages. diff --git a/cylc/flow/task_state.py b/cylc/flow/task_state.py index bea07204cc..6314719a25 100644 --- a/cylc/flow/task_state.py +++ b/cylc/flow/task_state.py @@ -19,6 +19,7 @@ from typing import ( TYPE_CHECKING, Dict, + Optional, Iterable, List, Set, @@ -325,7 +326,7 @@ def __call__( def satisfy_me( self, outputs: Iterable['Tokens'], - mode: "RunMode", + mode: "Optional[RunMode]", ) -> Set['Tokens']: """Try to satisfy my prerequisites with given outputs.