From b422269de417016b53477c8d97b26714b3eb3fc2 Mon Sep 17 00:00:00 2001 From: Steven Palma Date: Tue, 30 Jun 2026 14:33:38 +0200 Subject: [PATCH] fix(style): pre-commit --- src/lerobot/policies/groot/processor_groot.py | 4 ++-- tests/policies/groot/test_groot_n1_7.py | 2 +- tests/policies/groot/utils/dump_original_n1_7.py | 12 +++++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/lerobot/policies/groot/processor_groot.py b/src/lerobot/policies/groot/processor_groot.py index d5f2663e7..1d4c610b2 100644 --- a/src/lerobot/policies/groot/processor_groot.py +++ b/src/lerobot/policies/groot/processor_groot.py @@ -1670,7 +1670,7 @@ class GrootN17PackInputsStep(ProcessorStep): Relative groups normalize with per-chunk-timestep (2D) ``relative_action`` stats, which the flat ``_min_max_norm`` fallback cannot honor, so a relative config that fails grouped - normalization must fail loudly rather than silently mis-scale every timestep. + normalization must fail loudly rather than silently wrongly scale every timestep. """ if not isinstance(self.modality_config, dict): return False @@ -1807,7 +1807,7 @@ class GrootN17PackInputsStep(ProcessorStep): "relative-action chunk: the action layout or horizon does not match the " f"checkpoint relative_action stats (action shape {tuple(action.shape)}). The flat " "min/max fallback cannot honor per-chunk-timestep relative stats, so refusing to " - "silently mis-normalize. Recompute the relative action stats so their horizon and " + "silently wrongly normalize. Recompute the relative action stats so their horizon and " "dimensions match the action chunk." ) else: diff --git a/tests/policies/groot/test_groot_n1_7.py b/tests/policies/groot/test_groot_n1_7.py index 416994018..1db22d5b0 100644 --- a/tests/policies/groot/test_groot_n1_7.py +++ b/tests/policies/groot/test_groot_n1_7.py @@ -1022,7 +1022,7 @@ def test_groot_n1_7_pack_inputs_normalizes_action_chunk_per_dimension_before_pad def test_groot_n1_7_pack_inputs_raises_when_relative_groups_cannot_normalize(): # Relative groups carry per-chunk-timestep stats; if the action horizon exceeds the available - # stat rows, grouped normalization cannot apply and the flat fallback would silently mis-scale. + # stat rows, grouped normalization cannot apply and the flat fallback would silently wrongly scale. step = GrootN17PackInputsStep( action_horizon=3, valid_action_horizon=3, diff --git a/tests/policies/groot/utils/dump_original_n1_7.py b/tests/policies/groot/utils/dump_original_n1_7.py index 26d1cd10c..773f8dfad 100644 --- a/tests/policies/groot/utils/dump_original_n1_7.py +++ b/tests/policies/groot/utils/dump_original_n1_7.py @@ -62,10 +62,7 @@ def make_observation(seed: int, video_keys, lang_key, state_spec): # One ndarray per state key, shape (B, T=1, key_dim); dim taken from statistics. # Keys with dim 0 (e.g. disabled eef on some embodiments) are still emitted as # present-but-empty so the processor's state transform finds every expected key. - state = { - k: rng.standard_normal((BATCH_SIZE, 1, dim)).astype(np.float32) - for k, dim in state_spec - } + state = {k: rng.standard_normal((BATCH_SIZE, 1, dim)).astype(np.float32) for k, dim in state_spec} language = {lang_key: [[PROMPT] for _ in range(BATCH_SIZE)]} return {"video": video, "state": state, "language": language} @@ -181,7 +178,12 @@ def main(): state_spec = [(k, len(v["min"])) for k, v in stats[tag]["state"].items()] try: dump_one_tag( - policy, fair_model, tag, all_modality[tag], state_spec, args, + policy, + fair_model, + tag, + all_modality[tag], + state_spec, + args, out_dir / f"original_n1_7_{tag}.npz", ) done.append(tag)