Skip to content

Commit 037f296

Browse files
committed
style: fix ruff linting
1 parent 305d9ee commit 037f296

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

python/rcs/envs/creators.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@ def __call__( # type: ignore
137137
cameras: dict[str, SimCameraConfig] | None = None,
138138
hand_cfg: rcs.sim.SimTilburgHandConfig | None = None,
139139
gripper_cfg: rcs.sim.SimGripperConfig | None = None,
140-
random_pos_args: dict = {}
140+
random_pos_args: dict | None = None,
141141
) -> gym.Env:
142+
if random_pos_args is None:
143+
random_pos_args = {}
142144
mode = "gripper"
143145
if gripper_cfg is None and hand_cfg is None:
144146
_gripper_cfg = default_sim_gripper_cfg()
@@ -192,8 +194,10 @@ def __call__( # type: ignore
192194
resolution: tuple[int, int] | None = None,
193195
frame_rate: int = 0,
194196
delta_actions: bool = True,
195-
cam_list: list[str] = ["wrist", "bird_eye", "side", "right_side", "left_side", "front"],
197+
cam_list: list[str] | None = None,
196198
) -> gym.Env:
199+
if cam_list is None:
200+
cam_list = [],
197201
if resolution is None:
198202
resolution = (256, 256)
199203
cameras = {
@@ -219,9 +223,11 @@ def __call__( # type: ignore
219223
resolution: tuple[int, int] | None = None,
220224
frame_rate: int = 0,
221225
delta_actions: bool = True,
222-
cam_list: list[str] = [],
226+
cam_list: list[str] | None = None,
223227
mjcf_path: str = "",
224228
) -> gym.Env:
229+
if cam_list is None:
230+
cam_list = []
225231
if resolution is None:
226232
resolution = (256, 256)
227233
if cam_list is None or len(cam_list) == 0:

python/rcs/envs/sim.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def __init__(
309309
def reset(
310310
self, seed: int | None = None, options: dict[str, Any] | None = None
311311
) -> tuple[dict[str, Any], dict[str, Any]]:
312-
if options is not None and "RandomObjectPos.init_object_pose" in options.keys():
312+
if options is not None and "RandomObjectPos.init_object_pose" in options:
313313
assert isinstance(
314314
options["RandomObjectPos.init_object_pose"], rcs.common.Pose
315315
), "RandomObjectPos.init_object_pose must be a rcs.common.Pose"

0 commit comments

Comments
 (0)