Skip to content

Commit 3d42bff

Browse files
Ensures the code follows the line-length requirements (isaac-sim#4401)
# Description Previously, we were using black formatter which only checked that the code followed the desired number of characters. However, this skipped the docstrings. This MR now enables this feature for ruff and fixes the docs wherever applicable. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there --------- Signed-off-by: Kelly Guo <kellyg@nvidia.com> Co-authored-by: Kelly Guo <kellyg@nvidia.com>
1 parent a21ec0a commit 3d42bff

137 files changed

Lines changed: 803 additions & 483 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docker/utils/container_interface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ def config(self, output_yaml: Path | None = None):
298298
"""
299299

300300
def _resolve_image_extension(self, yamls: list[str] | None = None, envs: list[str] | None = None):
301-
"""
302-
Resolve the image extension by setting up YAML files, profiles, and environment files for the Docker compose command.
301+
"""Resolve the image extension by setting up YAML files, profiles, and environment files for the
302+
Docker compose command.
303303
304304
Args:
305305
yamls: A list of yaml files to extend ``docker-compose.yaml`` settings. These are extended in the order

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ select = [
3333
# Ignore specific rules (matching your flake8 config)
3434
ignore = [
3535
"E402", # Module level import not at top of file
36-
"E501", # Line too long (handled by formatter)
37-
"E203", # Whitespace before ':' (conflicts with formatter)
3836
"D401", # First line should be in imperative mood
3937
"RET504", # Unnecessary variable assignment before return statement
4038
"RET505", # Unnecessary elif after return statement

scripts/demos/sensors/tacsl_sensor.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@
1212
.. code-block:: bash
1313
1414
# Usage
15-
python tacsl_sensor.py --use_tactile_rgb --use_tactile_ff --tactile_compliance_stiffness 100.0 --num_envs 16 --contact_object_type nut --save_viz --enable_cameras
15+
python scripts/demos/sensors/tacsl_sensor.py \
16+
--use_tactile_rgb \
17+
--use_tactile_ff \
18+
--tactile_compliance_stiffness 100.0 \
19+
--num_envs 16 \
20+
--contact_object_type nut \
21+
--save_viz \
22+
--enable_cameras
1623
1724
"""
1825

@@ -146,12 +153,14 @@ class TactileSensorsSceneCfg(InteractiveSceneCfg):
146153
friction_coefficient=args_cli.friction_coefficient,
147154
tangential_stiffness=args_cli.tangential_stiffness,
148155
# Camera configuration
156+
# Note: the camera is already spawned in the scene, properties are set in the
157+
# 'gelsight_r15_finger.usd' USD file
149158
camera_cfg=TiledCameraCfg(
150159
prim_path="{ENV_REGEX_NS}/Robot/elastomer_tip/cam",
151160
height=GELSIGHT_R15_CFG.image_height,
152161
width=GELSIGHT_R15_CFG.image_width,
153162
data_types=["distance_to_image_plane"],
154-
spawn=None, # the camera is already spawned in the scene, properties are set in the gelsight_r15_finger.usd file
163+
spawn=None,
155164
),
156165
# Debug Visualization
157166
trimesh_vis_tactile_points=args_cli.trimesh_vis_tactile_points,
@@ -362,12 +371,11 @@ def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene):
362371
def main():
363372
"""Main function."""
364373
# Initialize simulation
374+
# Note: We set the gpu_collision_stack_size to prevent buffer overflow in contact-rich environments.
365375
sim_cfg = sim_utils.SimulationCfg(
366376
dt=0.005,
367377
device=args_cli.device,
368-
physx=sim_utils.PhysxCfg(
369-
gpu_collision_stack_size=2**30, # Prevent collisionStackSize buffer overflow in contact-rich environments.
370-
),
378+
physx=sim_utils.PhysxCfg(gpu_collision_stack_size=2**30),
371379
)
372380
sim = sim_utils.SimulationContext(sim_cfg)
373381

@@ -377,7 +385,8 @@ def main():
377385
# Create scene based on contact object type
378386
if args_cli.contact_object_type == "cube":
379387
scene_cfg = CubeTactileSceneCfg(num_envs=args_cli.num_envs, env_spacing=0.2)
380-
# disabled force field for cube contact object because a SDF collision mesh cannot be created for the Shape Prims
388+
# disabled force field for cube contact object because a SDF collision mesh cannot
389+
# be created for the Shape Prims
381390
scene_cfg.tactile_sensor.enable_force_field = False
382391
elif args_cli.contact_object_type == "nut":
383392
scene_cfg = NutTactileSceneCfg(num_envs=args_cli.num_envs, env_spacing=0.2)

scripts/imitation_learning/isaaclab_mimic/annotate_demos.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
args_cli = parser.parse_args()
4848

4949
if args_cli.enable_pinocchio:
50-
# Import pinocchio before AppLauncher to force the use of the version installed by IsaacLab and not the one installed by Isaac Sim
50+
# Import pinocchio before AppLauncher to force the use of the version installed
51+
# by IsaacLab and not the one installed by Isaac Sim.
5152
# pinocchio is required by the Pink IK controllers and the GR1T2 retargeter
5253
import pinocchio # noqa: F401
5354

scripts/imitation_learning/isaaclab_mimic/generate_dataset.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
args_cli = parser.parse_args()
5151

5252
if args_cli.enable_pinocchio:
53-
# Import pinocchio before AppLauncher to force the use of the version installed by IsaacLab and not the one installed by Isaac Sim
53+
# Import pinocchio before AppLauncher to force the use of the version
54+
# installed by IsaacLab and not the one installed by Isaac Sim.
5455
# pinocchio is required by the Pink IK controllers and the GR1T2 retargeter
5556
import pinocchio # noqa: F401
5657

scripts/imitation_learning/locomanipulation_sdg/generate_data.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@
102102
args_cli = parser.parse_args()
103103

104104
if args_cli.enable_pinocchio:
105-
# Import pinocchio before AppLauncher to force the use of the version installed by IsaacLab and not the one installed by Isaac Sim
105+
# Import pinocchio before AppLauncher to force the use of the version
106+
# installed by IsaacLab and not the one installed by Isaac Sim.
106107
# pinocchio is required by the Pink IK controllers and the GR1T2 retargeter
107108
import pinocchio # noqa: F401
108109

scripts/imitation_learning/robomimic/play.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
args_cli = parser.parse_args()
5050

5151
if args_cli.enable_pinocchio:
52-
# Import pinocchio before AppLauncher to force the use of the version installed by IsaacLab and not the one installed by Isaac Sim
52+
# Import pinocchio before AppLauncher to force the use of the version
53+
# installed by IsaacLab and not the one installed by Isaac Sim.
5354
# pinocchio is required by the Pink IK controllers and the GR1T2 retargeter
5455
import pinocchio # noqa: F401
5556

scripts/imitation_learning/robomimic/robust_eval.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@
6565
args_cli = parser.parse_args()
6666

6767
if args_cli.enable_pinocchio:
68-
# Import pinocchio before AppLauncher to force the use of the version installed by IsaacLab and not the one installed by Isaac Sim
68+
# Import pinocchio before AppLauncher to force the use of the version installed
69+
# by IsaacLab and not the one installed by Isaac Sim.
6970
# pinocchio is required by the Pink IK controllers and the GR1T2 retargeter
7071
import pinocchio # noqa: F401
7172

scripts/reinforcement_learning/ray/grok_cluster_with_kubectl.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,12 @@ def process_cluster(cluster_info: dict, ray_head_name: str = "head") -> str:
164164
For each cluster, check that it is running, and get the Ray head address that will accept jobs.
165165
166166
Args:
167-
cluster_info (dict): A dictionary containing cluster information with keys 'cluster', 'pods', and 'namespace'.
168-
ray_head_name (str, optional): The name of the ray head container. Defaults to "head".
167+
cluster_info: A dictionary containing cluster information with keys 'cluster', 'pods', and 'namespace'.
168+
ray_head_name: The name of the ray head container. Defaults to "head".
169169
170170
Returns:
171-
str: A string containing the cluster name and its Ray head address, or an error message if the head pod or Ray address is not found.
171+
A string containing the cluster name and its Ray head address, or an error message if
172+
the head pod or Ray address is not found.
172173
"""
173174
cluster, pods, namespace = cluster_info
174175
head_pod = None

scripts/reinforcement_learning/ray/submit_job.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
python3 scripts/reinforcement_learning/ray/submit_job.py --aggregate_jobs wrap_resources.py --test
4747
4848
# Example: submitting tasks with specific resources, and supporting pip packages and py_modules
49-
# You may use relative paths for task_cfg and py_modules, placing them in the scripts/reinforcement_learning/ray directory, which will be uploaded to the cluster.
49+
# You may use relative paths for task_cfg and py_modules, placing them in the
50+
# "scripts/reinforcement_learning/ray" directory, which will be uploaded to the cluster.
5051
python3 scripts/reinforcement_learning/ray/submit_job.py --aggregate_jobs task_runner.py --task_cfg tasks.yaml
5152
5253
# For all command line arguments

0 commit comments

Comments
 (0)