Skip to content

Commit

Permalink
Ignoring comparison-overlap warning from mypy to keep the code simple
Browse files Browse the repository at this point in the history
  • Loading branch information
bonassifabio committed Dec 9, 2024
1 parent 6eaa12d commit 36dda87
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ignite/engine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 36dda87

Please # to comment.