-
Notifications
You must be signed in to change notification settings - Fork 2.9k
mypy: Make Policies module MyPy‑compliant (#1719, #1720) #1805
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
base: main
Are you sure you want to change the base?
Conversation
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.
Hey thank you for your contribution, I started the review for Act policy 😄
I will do the next policy later 🤗
- Remove --ignore-missing-imports flag from pre-commit config - Add TypedDict annotations (OptimizerKwargs, ForwardKwargs) - Improve get_optim_params() return type annotation - Add activation function casts for MyPy stub compatibility - Remove device handling code (non-MyPy related) - Maintain parent class method signature compatibility.
…obot into chore/mypy-policies
|
Hey we have merged a big pr #1452. Could you rebase this branch please ? I will finish the review 😄 |
|
Hello @akacmazz Can you ping me whenever this is ready for a review ? Feel free to ping me in discord |
|
Hey @imstevenpmwork, Just wanted to let you know that my PR for Issue #1720 (MyPy compliance for policies module) is ready for review: Thank you. |
What this does
device semantics.
imports in the hook venv to avoid heavy deps). No global behavior change.
How it was tested
backward_compatibility'
How to checkout & try? (for the reviewer)
From repo root
export LEROBOT_TEST_DEVICE=cpu
mkdir -p .cache/hf_datasets .cache/hf_home
export HF_DATASETS_CACHE=$(pwd)/.cache/hf_datasets
export HF_HOME=$(pwd)/.cache/hf_home
Static checks
pre-commit run -a
mypy
SAC tests
PYTHONPATH=src pytest -q tests/policies -k sac
ACT back-compat tests
PYTHONPATH=src pytest -q tests/policies -k 'act and backward_compatibility'
If you’d like me to extend MyPy coverage to the next module (e.g., Datasets) in a follow‑up PR, I can prepare the scoped
config and initial fixes similarly.
cc @CadeRemi @AdilZouitine for review