Skip to content

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