Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MyPy issue #2778

Merged
merged 2 commits into from
Nov 16, 2022
Merged

Fix MyPy issue #2778

merged 2 commits into from
Nov 16, 2022

Conversation

sadra-barikbin
Copy link
Collaborator

Description:
Using new MyPy release(0.991) raises some errors. This PR attempts to resolve them.

@github-actions github-actions bot added module: contrib Contrib module module: engine Engine module module: handlers Core Handlers module labels Nov 16, 2022
@sadra-barikbin
Copy link
Collaborator Author

sadra-barikbin commented Nov 16, 2022

@vfdev-5 , in ignite.handlers.base_logger.BaseHandler and its children why is Union[str, Events] being used as type annotation for the second argument in __call__ method and not Union[str, EventEnum]?

@vfdev-5
Copy link
Collaborator

vfdev-5 commented Nov 16, 2022

Events type is a bit tricky and we need unify the typehints at some point. As a rule of thumb, we have

  • EventEnum = base class for events: built-in and custom
  • Events = built-in event for the Engine
  • EventsList = list of events
  • str = string as event

Let's first fix mypy issues and in a follow-up PR we can tackle typehint for events.

And add a tiny test for wandb_logger
Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @sadra-barikbin !

@vfdev-5
Copy link
Collaborator

vfdev-5 commented Nov 16, 2022

As failing tests are unrelated, merging this PR

@vfdev-5 vfdev-5 merged commit 6b8ebca into pytorch:master Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: contrib Contrib module module: engine Engine module module: handlers Core Handlers module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants