lerobot icon indicating copy to clipboard operation
lerobot copied to clipboard

fix(config): typing correction on config.py

Open LumenYoung opened this issue 6 months ago • 0 comments

Although not affecting the execution, the typing in some of the fields in config.py are actually wrong.

For example, the task field in subclass of EnvConfig are typed inconsistently, leading the basedpyright warning:

basedpyright: "task" overrides symbol of same name in class "EnvConfig"
Variable is mutable so its type is invariant
Override type "str" is not the same as base type "str | None"
[reportIncompatibleVariableOverride]

Secondly, the override of gym_kwargs in HILSerlRobotEnvConfig miss the property decorator, leading the following linter problem:

basedpyright: "gym_kwargs" incorrectly overrides property of same name
in class "EnvConfig" [reportIncompatibleMethodOverride]

This commit enforces more strict typing on this file.

LumenYoung avatar Jun 16 '25 09:06 LumenYoung