Skip to content

Conversation

@brentyi
Copy link
Collaborator

@brentyi brentyi commented Aug 29, 2025

I added Pyright and started fixing type errors.

On main:

~/mjlab uv run pyright
[...]
434 errors, 0 warnings, 0 informations

On this branch:

~/mjlab uv run pyright
0 errors, 0 warnings, 0 informations

It seems like most of these were real issues. I tried my best to fix, but there were a few things I wasn't sure about:

  • The correct type for indexing when resetting. We sometimes had torch.Tensor | slice | None in the type signature, but didn't actually support all of them at runtime. Should we standardize?
  • The .func attribute. This was generally annotated as func: Callable, but we sometimes also call .func.reset(env_ids).
  • Incompatible overrides of gym.Env, for example returning tensors instead of ints. I see why this makes sense, I guess the only solutions is type: ignore?

@kevinzakka kevinzakka force-pushed the brent/20250828_pyright branch from d76c8dd to 315fa70 Compare August 30, 2025 15:55
@kevinzakka
Copy link
Collaborator

Nice, pyright passes for me too now!

@kevinzakka kevinzakka merged commit 647ded4 into main Aug 31, 2025
7 checks passed
@kevinzakka kevinzakka deleted the brent/20250828_pyright branch August 31, 2025 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants