diff --git a/src/jaxsim/mujoco/model.py b/src/jaxsim/mujoco/model.py index 6b61177ff..bb11d6399 100644 --- a/src/jaxsim/mujoco/model.py +++ b/src/jaxsim/mujoco/model.py @@ -378,7 +378,7 @@ def _mask_qpos(self, joint_names: tuple[str, ...]) -> npt.NDArray: for i in range(self.joint_dofs(joint_name=joint_name)) ] ) - for idx, joint_name in zip(idxs, joint_names) + for idx, joint_name in zip(idxs, joint_names, strict=True) ] ).squeeze() ) diff --git a/src/jaxsim/parsers/kinematic_graph.py b/src/jaxsim/parsers/kinematic_graph.py index 9edf811b4..5073894f1 100644 --- a/src/jaxsim/parsers/kinematic_graph.py +++ b/src/jaxsim/parsers/kinematic_graph.py @@ -797,7 +797,7 @@ def initial_joint_positions( self._transform_cache.clear() # Update initial joint positions. - for joint_name, position in zip(joint_names, s): + for joint_name, position in zip(joint_names, s, strict=True): self._initial_joint_positions[joint_name] = position def transform(self, name: str) -> npt.NDArray: diff --git a/tests/test_api_frame.py b/tests/test_api_frame.py index f721c80fa..7d2e6322d 100644 --- a/tests/test_api_frame.py +++ b/tests/test_api_frame.py @@ -163,7 +163,7 @@ def test_frame_jacobians( assert len(frame_indices) == len(frame_names) - for frame_name, frame_index in zip(frame_names, frame_indices): + for frame_name, frame_index in zip(frame_names, frame_indices, strict=True): J_WL_js = js.frame.jacobian(model=model, data=data, frame_index=frame_index) J_WL_idt = kin_dyn.jacobian_frame(frame_name=frame_name) diff --git a/tests/test_api_link.py b/tests/test_api_link.py index 1e808687d..418f78a99 100644 --- a/tests/test_api_link.py +++ b/tests/test_api_link.py @@ -75,6 +75,7 @@ def test_link_inertial_properties( for link_name, link_idx in zip( model.link_names(), js.link.names_to_idxs(model=model, link_names=model.link_names()), + strict=True, ): if link_name == model.base_link(): continue @@ -118,7 +119,7 @@ def test_link_transforms( assert W_H_LL_model == pytest.approx(W_H_LL_links) - for W_H_L, link_name in zip(W_H_LL_links, model.link_names()): + for W_H_L, link_name in zip(W_H_LL_links, model.link_names(), strict=True): assert W_H_L == pytest.approx( kin_dyn.frame_transform(frame_name=link_name) @@ -152,7 +153,7 @@ def test_link_jacobians( lambda idx: js.link.jacobian(model=model, data=data, link_index=idx) )(jnp.arange(model.number_of_links())) - for J_WL, link_name in zip(J_WL_links, model.link_names()): + for J_WL, link_name in zip(J_WL_links, model.link_names(), strict=True): assert J_WL == pytest.approx( kin_dyn.jacobian_frame(frame_name=link_name), abs=1e-9 ), link_name @@ -164,6 +165,7 @@ def test_link_jacobians( for link_name, link_idx in zip( model.link_names(), js.link.names_to_idxs(model=model, link_names=model.link_names()), + strict=True, ): v_WL_idt = kin_dyn.frame_velocity(frame_name=link_name) v_WL_js = js.link.velocity(model=model, data=data, link_index=link_idx) @@ -184,6 +186,7 @@ def test_link_jacobians( for link_name, link_idx in zip( model.link_names(), js.link.names_to_idxs(model=model, link_names=model.link_names()), + strict=True, ): v_WL_idt = kin_dyn_other_repr.frame_velocity(frame_name=link_name) v_WL_js = js.link.velocity( @@ -218,6 +221,7 @@ def test_link_bias_acceleration( for name, index in zip( model.link_names(), js.link.names_to_idxs(model=model, link_names=model.link_names()), + strict=True, ): Jν_idt = kin_dyn.frame_bias_acc(frame_name=name) Jν_js = js.link.bias_acceleration(model=model, data=data, link_index=index) diff --git a/tests/test_api_model.py b/tests/test_api_model.py index 24654f726..a0fe49db5 100644 --- a/tests/test_api_model.py +++ b/tests/test_api_model.py @@ -84,6 +84,7 @@ def test_model_creation_and_reduction( data_full.joint_positions( model=model_full, joint_names=model_full.joint_names() ).tolist(), + strict=True, ) ), ) diff --git a/tests/utils_idyntree.py b/tests/utils_idyntree.py index 3dc0df833..5376a82ef 100644 --- a/tests/utils_idyntree.py +++ b/tests/utils_idyntree.py @@ -64,6 +64,7 @@ def build_kindyncomputations_from_jaxsim_model( zip( model.joint_names(), data.joint_positions(model=model, joint_names=model.joint_names()), + strict=True, ) ) )