refactor(streaming): split episode data plane

This commit is contained in:
Pepijn
2026-07-24 13:26:36 +02:00
parent ee06d1005f
commit 85086fed7a
13 changed files with 1572 additions and 1487 deletions
@@ -16,12 +16,8 @@ from concurrent.futures import ThreadPoolExecutor
import numpy as np
import pytest
from lerobot.streaming.episode_video import (
EpisodeByteCache,
EpisodeVideoManifest,
ThreadLocalRangeFetcher,
_log_http_failure,
)
from lerobot.streaming.episode_cache import EpisodeByteCache
from lerobot.streaming.manifest import EpisodeVideoManifest
from lerobot.streaming.mp4 import (
_box,
_co64,
@@ -40,6 +36,7 @@ from lerobot.streaming.mp4 import (
synthesize_mp4,
synthesized_mp4_size,
)
from lerobot.streaming.range_fetch import ThreadLocalRangeFetcher, _log_http_failure
def _minimal_mp4(sample_offsets: list[int], *, use_co64: bool = False) -> bytes:
@@ -155,7 +152,7 @@ def test_decoder_count_has_independent_limit(monkeypatch, tmp_path):
opened.append(decoder)
return decoder
monkeypatch.setattr("lerobot.streaming.episode_video.open_video_decoder", open_decoder)
monkeypatch.setattr("lerobot.streaming.episode_cache.open_video_decoder", open_decoder)
with _fake_cache(monkeypatch, tmp_path, byte_budget=20, max_open_decoders=1) as cache:
first = cache.get_decoder(0, "camera")
second = cache.get_decoder(1, "camera")
+1 -1
View File
@@ -18,7 +18,7 @@ from collections import Counter
import pytest
from lerobot.streaming.episode_video import ExactCoveragePool
from lerobot.streaming.episode_pool import ExactCoveragePool
EPISODES = [(0, 5), (1, 3), (2, 8), (3, 1), (4, 6), (5, 4), (6, 7), (7, 2)]
TOTAL = sum(n for _, n in EPISODES)
+15 -1
View File
@@ -26,7 +26,9 @@ class BlockDatasets(importlib.abc.MetaPathFinder):
return None
sys.meta_path.insert(0, BlockDatasets())
from lerobot.streaming.episode_video import EpisodeByteCache, ExactCoveragePool
from lerobot.streaming.episode_cache import EpisodeByteCache
from lerobot.streaming.episode_pool import ExactCoveragePool
from lerobot.streaming.manifest import EpisodeVideoManifest
from lerobot.streaming.mp4 import Mp4Index
"""
result = subprocess.run(
@@ -37,3 +39,15 @@ from lerobot.streaming.mp4 import Mp4Index
)
assert result.returncode == 0, result.stderr
def test_episode_video_compatibility_imports() -> None:
from lerobot.streaming.episode_cache import EpisodeByteCache
from lerobot.streaming.episode_pool import ExactCoveragePool
from lerobot.streaming.episode_video import (
EpisodeByteCache as CompatibilityEpisodeByteCache,
ExactCoveragePool as CompatibilityExactCoveragePool,
)
assert CompatibilityEpisodeByteCache is EpisodeByteCache
assert CompatibilityExactCoveragePool is ExactCoveragePool
+1 -1
View File
@@ -19,7 +19,7 @@ import numpy as np
import pytest
from filelock import FileLock
from lerobot.streaming.episode_video import EpisodeVideoManifest, VideoFileRecord
from lerobot.streaming.manifest import EpisodeVideoManifest, VideoFileRecord
from lerobot.streaming.mp4 import Mp4Index
from lerobot.streaming.sidecar import (
SidecarLockTimeoutError,