Skip to content

Fix mypy issues with mypy==0.920 #2361

@vfdev-5

Description

@vfdev-5

🐛 Bug description

Our code base mypy check is failing:

ignite/handlers/time_profilers.py:638: error: Incompatible return value type
(got
"List[List[Union[Any, str, float, Tuple[Union[str, float], Union[str, float]]]]]",
expected "List[List[Union[str, float]]]")  [return-value]
            return event_handler_stats
                   ^
ignite/handlers/param_scheduler.py:829: error: unused "type: ignore" comment
                scheduler = cls(save_history=False, lr_scheduler=lr_schedu...
                ^
ignite/handlers/checkpoint.py:721: error: unused "type: ignore" comment
                    tmp_file = tmp.file  # type: ignore
                    ^
ignite/contrib/handlers/neptune_logger.py:588: error: unused "type: ignore"
comment
                torch.save(checkpoint, tmp.file)  # type: ignore[attr-defi...
                ^
Found 4 errors in 4 files (checked 103 source files)

for mypy==0.920

Let's make our codebase compatible.

Environment

  • PyTorch Version (e.g., 1.4):
  • Ignite Version (e.g., 0.3.0):
  • OS (e.g., Linux):
  • How you installed Ignite (conda, pip, source):
  • Python version:
  • Any other relevant information:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions