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 PyTorch Lightning 1.6 type hints #487

Merged
merged 1 commit into from
Mar 30, 2022

Conversation

adamjstewart
Copy link
Collaborator

PyTorch Lightning 1.6.0 was released today and includes better type hints, causing our mypy tests to fail. This PR updates some things related to PL 1.6.

The reason that these type ignores are needed (and the try-except is needed) is that all model/datamodule/trainer attributes are optional. We could instead replace the try-except with a hasattr(...) for literally every attribute, but that gets cumbersome pretty quickly. I may do this in the future, but for now, the try-except protects us.

@github-actions github-actions bot added testing Continuous integration testing trainers PyTorch Lightning trainers labels Mar 30, 2022
@adamjstewart adamjstewart merged commit d84e317 into main Mar 30, 2022
@adamjstewart adamjstewart deleted the fixes/pytorch-lightning-types branch March 30, 2022 02:39
remtav pushed a commit to remtav/torchgeo that referenced this pull request May 26, 2022
yichiac pushed a commit to yichiac/torchgeo that referenced this pull request Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Continuous integration testing trainers PyTorch Lightning trainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants