Skip to content

Commit

Permalink
Fixed mypy for reverted code
Browse files Browse the repository at this point in the history
  • Loading branch information
vfdev-5 committed Feb 7, 2021
1 parent 05a8732 commit 5adf3d9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 1 addition & 5 deletions ignite/engine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,11 +812,7 @@ def _run_once_on_dataset(self) -> float:
# Should exit while loop if we can not iterate
if should_exit:
if not self._is_done(self.state):
total_iters = (
self.state.epoch_length * self.state.max_epochs
if self.state.max_epochs is not None
else self.state.max_iters
)
total_iters = self.state.epoch_length * self.state.max_epochs # type: ignore[operator]

warnings.warn(
"Data iterator can not provide data anymore but required total number of "
Expand Down
2 changes: 1 addition & 1 deletion ignite/handlers/checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ def __init__(
self,
dirname: str,
filename_prefix: str,
save_interval: Optional[Callable] = None,
save_interval: Optional[int] = None,
score_function: Optional[Callable] = None,
score_name: Optional[str] = None,
n_saved: Union[int, None] = 1,
Expand Down
3 changes: 3 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,6 @@ ignore_missing_imports = True

[mypy-tqdm.*]
ignore_missing_imports = True

[mypy-ignite.contrib.handlers.custom_events]
ignore_errors = True

0 comments on commit 5adf3d9

Please sign in to comment.