From 36dda8740308a956bcdbd55138a11c2f267163cd Mon Sep 17 00:00:00 2001 From: Fabio Bonassi Date: Mon, 9 Dec 2024 13:28:43 +0100 Subject: [PATCH] Ignoring comparison-overlap warning from mypy to keep the code simple --- ignite/engine/engine.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ignite/engine/engine.py b/ignite/engine/engine.py index 149812d36bb..dd3ae3db863 100644 --- a/ignite/engine/engine.py +++ b/ignite/engine/engine.py @@ -991,7 +991,7 @@ def _internal_run_as_gen(self) -> Generator[Any, None, State]: # time is available for handlers but must be updated after fire self.state.times[Events.EPOCH_COMPLETED.name] = epoch_time_taken - if self.should_terminate_single_epoch != "skip_epoch_completed": + if self.should_terminate_single_epoch != "skip_epoch_completed": # type: ignore[comparison-overlap] handlers_start_time = time.time() self._fire_event(Events.EPOCH_COMPLETED) epoch_time_taken += time.time() - handlers_start_time @@ -1021,7 +1021,7 @@ def _internal_run_as_gen(self) -> Generator[Any, None, State]: self.state.times[Events.COMPLETED.name] = time_taken # do not fire Events.COMPLETED if we terminated the run with flag `skip_completed=True` - if self.should_terminate != "skip_completed": + if self.should_terminate != "skip_completed": # type: ignore[comparison-overlap] handlers_start_time = time.time() self._fire_event(Events.COMPLETED) time_taken += time.time() - handlers_start_time @@ -1185,7 +1185,7 @@ def _internal_run_legacy(self) -> State: # time is available for handlers but must be updated after fire self.state.times[Events.EPOCH_COMPLETED.name] = epoch_time_taken - if self.should_terminate_single_epoch != "skip_epoch_completed": + if self.should_terminate_single_epoch != "skip_epoch_completed": # type: ignore[comparison-overlap] handlers_start_time = time.time() self._fire_event(Events.EPOCH_COMPLETED) epoch_time_taken += time.time() - handlers_start_time @@ -1215,7 +1215,7 @@ def _internal_run_legacy(self) -> State: self.state.times[Events.COMPLETED.name] = time_taken # do not fire Events.COMPLETED if we terminated the run with flag `skip_completed=True` - if self.should_terminate != "skip_completed": + if self.should_terminate != "skip_completed": # type: ignore[comparison-overlap] handlers_start_time = time.time() self._fire_event(Events.COMPLETED) time_taken += time.time() - handlers_start_time