Repository navigation
fix(lerobot): import every repeated --episode-index - #756
Conversation
Repeating --episode-index kept only the last value and imported that one episode without a warning. Make the option repeatable like --camera, and let import_lerobot_dataset take a sequence of episode indexes, checked for range and duplicates before anything is converted.
[Medium impact] The PR appears safe to merge; the previous finding is fixed and no new actionable issues were found.
|
… or sequence tuple(episode_index) raised TypeError for a float such as 1.5, where the importer used to raise ValueError. Refuse anything that is neither an int nor a non-string sequence with the same ValueError as a negative index.
|
Good catch.
|
kstonekuan
left a comment
There was a problem hiding this comment.
Thanks for the fix. Ruff, ty, the episode-selection regressions, changed-page links, and both Python CI jobs pass. Merging.
Summary
hflow import lerobotnow imports every--episode-indexit is given. Repeating the option, as--cameraalready allows, used to keep only the last value:--episode-index 0 --episode-index 3converted episode 3 alone, with no warning. This is one of the CLI rough edges from #742.import_lerobot_dataset(episode_index=...)accepts a single index, as before, or a sequence of them. Every index is checked before any download or conversion: negative or non-integer values and duplicates raiseValueError, and an index past the last episode raises the existing out-of-range error naming that index.Why
The silent drop is easy to miss: the command reports "converted 1 episode(s)" and the run looks fine. Accepting several values matches how
--cameraworks and keeps a single--episode-indexbehaving exactly as it does today.Validation
uv run pytest tests/test_cli.py tests/test_lerobot_converter.py -k "repeated_episode_index or every_requested_episode_index or invalid_arguments_before_network": 3 passed; all three fail onmain(744166a).test_import_lerobot_cli_passes_every_repeated_episode_index: the CLI passes[0, 4]for two repeats.test_import_converts_every_requested_episode_index:[1, 0]on a two-episode archive converts both, in that order, and[0, 2]names index 2 as out of range.test_import_refuses_invalid_arguments_before_networkgains a negative index in a list, a duplicate, and an empty list.uv run pytest -n 8: 2621 passed, 12 skipped, 2 failed;maingives 2619 passed with the same 2 failures (test_ffmpeg.py::test_linux_unsupported_machine_raises_instead_of_path_fallbackandtest_ffprobe_without_sibling_falls_back_to_path_with_warning, which depend on the local ffmpeg setup).uv run ruff check,uv run ruff format --check,uv run ty check: pass.Checklist
docs/how-to/import-lerobot-v3.md,examples/README.md)uv run ruff check --fix,uv run ruff format, anduv run ty check.Need help on this PR? Tag
@codesmith-botwith what you need.