-
Notifications
You must be signed in to change notification settings - Fork 488
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
Enable MYPY for tests and fix typing bugs #527
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Skylion007
requested review from
mathfac,
jturner65,
eundersander and
erikwijmans
November 10, 2020 19:28
facebook-github-bot
added
the
CLA Signed
Do not delete this pull request or issue due to inactivity.
label
Nov 10, 2020
erikwijmans
approved these changes
Nov 13, 2020
mathfac
reviewed
Jun 25, 2021
|
||
import attr | ||
import numpy as np | ||
import torch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Skylion007, this is the only line dependent on PyTorch in Hab-Lab core. Is there a way we can guard it under TYPE_CHECKING?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
dannymcy
pushed a commit
to dannymcy/habitat-lab
that referenced
this pull request
Jul 8, 2024
* Tell user to upgrade habitat_sim * run black * typefixes * Fix typing errors * Fix pytest * Fix another typing error * Fix typing even more * Fix do_pause testing * Loosen typing * Fix another obs_transformer typing error * Relax typing * Fix one last tuple error * Fix utils typing * Add longer timeout * Fix int division * Fix episode_id * Fix cyclic import and typing * Remove more type_checking guards * Remove another typeguard * Disable typeguard for now * Fix mypy static testing bugs * Undo unreachable remove * Remove duplicate * Remove typeguard * Simplify registry typing
HHYHRHY
pushed a commit
to SgtVincent/habitat-lab
that referenced
this pull request
Aug 31, 2024
* Tell user to upgrade habitat_sim * run black * typefixes * Fix typing errors * Fix pytest * Fix another typing error * Fix typing even more * Fix do_pause testing * Loosen typing * Fix another obs_transformer typing error * Relax typing * Fix one last tuple error * Fix utils typing * Add longer timeout * Fix int division * Fix episode_id * Fix cyclic import and typing * Remove more type_checking guards * Remove another typeguard * Disable typeguard for now * Fix mypy static testing bugs * Undo unreachable remove * Remove duplicate * Remove typeguard * Simplify registry typing
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Caught quite a few typing bugs by using mypy and typeguard on the test suite. I was considering enabling TypeGuard for Habitat-Lab, but it seemed a bit to strict and I couldn't remove all the cyclic dependencies easily.
This does fix quite a few typing bugs though. The other option is that we could keep typeguard, but only enable it for the habitat-sim package.
I also enabled a few new mypy options that caught quite a few typing bugs especially with ObservationTransformers.
Improved testing
How Has This Been Tested
Pytest
Types of changes
Checklist