Skip to content

Commit 84c1eee

Browse files
committed
style: apply ruff import formatting across scripts, tests, and envs
1 parent 28fad79 commit 84c1eee

17 files changed

Lines changed: 20 additions & 2 deletions

‎benchmark/benchmark_postprocess.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import mlx.core as mx
1515
import numpy as np
1616
import torch
17+
1718
from unilab.base import registry
1819

1920
try:

‎scripts/train_appo.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def play_appo(args, rl_cfg):
4848
import numpy as np
4949
from rsl_rl.utils import resolve_callable
5050
from tensordict import TensorDict
51+
5152
from unilab.base import registry
5253
from unilab.utils import render_many
5354
from unilab.utils.rsl_rl_compat import convert_config_v3_to_v4, is_rsl_rl_v4, is_rsl_rl_v5

‎scripts/train_mlx_ppo.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ def play_mlx_ppo(args, cfg, dtype, use_fp16, resolved_sim_backend, task_log_root
159159
"""Play mode for MLX PPO."""
160160
import mlx.core as mx
161161
import numpy as np
162+
162163
from unilab.base import registry
163164

164165
play_model_dtype = mx.float32 if use_fp16 else dtype

‎scripts/train_offpolicy.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ def play_offpolicy(algo_name: str, args, cfg) -> None:
212212
import mediapy as media
213213
import numpy as np
214214
import torch
215+
215216
from unilab.base import registry
216217
from unilab.utils import render_many
217218
from unilab.utils.algo_utils import build_actor

‎scripts/train_rsl_rl.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ def step(self, actions):
201201
def play_rsl_rl(args, cfg, device):
202202
"""Play mode for RSL-RL."""
203203
import torch
204+
204205
from unilab.base import registry
205206

206207
env = registry.make(args.task, num_envs=args.play_env_num, sim_backend=args.sim_backend)
@@ -291,6 +292,7 @@ def play_rsl_rl(args, cfg, device):
291292
else:
292293
# MuJoCo backend: render to video
293294
import mediapy as media
295+
294296
from unilab.utils import render_many
295297

296298
output_video = Path(load_path_dir) / "play_video.mp4"

‎scripts/visualization_env.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import time
88

99
import numpy as np
10+
1011
from unilab.base import registry
1112

1213
parser = argparse.ArgumentParser(description="Visualize robot tasks")

‎src/unilab/envs/manipulation/inhand_rot_allegro/base.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import gymnasium as gym
66
import mujoco
77
import numpy as np
8+
89
from unilab.base.backend import SimBackend
910
from unilab.base.base import EnvCfg
1011
from unilab.base.dtype_config import get_global_dtype

‎src/unilab/envs/manipulation/inhand_rot_allegro/rotation_sac.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@ def _quat_to_axis_angle(q: np.ndarray) -> np.ndarray:
5252
return np.asarray(xyz / sin_half_over_angle) # (N, 3)
5353

5454

55-
from unilab.base import registry
5655
from unilab.envs.backend import create_backend
57-
from unilab.envs.manipulation.inhand_rot_allegro.base import AllegroBaseCfg, AllegroBaseMjEnv
5856
from unilab.envs.np_env import NpEnvState
5957

58+
from unilab.base import registry
59+
from unilab.envs.manipulation.inhand_rot_allegro.base import AllegroBaseCfg, AllegroBaseMjEnv
60+
6061
# ─────────────────────────── Configuration ────────────────────────────
6162

6263

‎tests/algos/test_mlx_ppo.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import mlx.core as mx
2222
import numpy as np
23+
2324
from unilab.algos.mlx.common import RolloutBuffer
2425
from unilab.algos.mlx.ppo import MLPActorCritic, PPOConfig, PPOTrainer
2526

‎tests/base/test_registry.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import gymnasium as gym
99
import numpy as np
1010
import pytest
11+
1112
import unilab.base.registry as registry_mod
1213
from unilab.base.base import ABEnv, EnvCfg
1314

0 commit comments

Comments
 (0)