Skip to content

Commit c0c4c96

Browse files
committed
Final cleaning up.
1 parent bb59cff commit c0c4c96

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

crazyflow/sim/visualize.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ def change_material(
9191
raise ValueError(f"drone_ids must be in range [0, {sim.n_drones - 1}], got {drone_ids}")
9292

9393
if rgba is not None:
94-
# this returns itself if rgba is already the right shape
9594
rgba = np.broadcast_to(rgba, (len(drone_ids), 4))
9695

9796
if emission is not None:
@@ -107,7 +106,7 @@ def change_material(
107106
mat_ids.append(mat_id)
108107

109108
if rgba is not None:
110-
mj_model.mat_rgba[mat_ids, :] = rgba
109+
mj_model.mat_rgba[mat_ids] = rgba
111110

112111
if emission is not None:
113112
mj_model.mat_emission[mat_ids] = emission

tests/unit/test_sim.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ def test_change_material_errors(device: str):
538538
sim, mat_name="bad_mat", drone_ids=drone_ids, rgba=rgba, emission=emission
539539
)
540540

541-
with pytest.raises(ValueError, match=r"drone_ids must be 1D array"):
541+
with pytest.raises(ValueError, match="drone_ids must be 1D array"):
542542
change_material(
543543
sim,
544544
mat_name="led_top",

0 commit comments

Comments
 (0)