Skip to content

Commit 22a00e4

Browse files
authored
Fixes order of imports for added standard modules (isaac-sim#4328)
# Description We now consider: "warp" and "pytest" as a standard library. ## Type of change - New feature (non-breaking change which adds functionality) ## 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` - [ ] 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
1 parent 8ccebfe commit 22a00e4

137 files changed

Lines changed: 195 additions & 201 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.

.pre-commit-config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repos:
88
rev: 24.3.0
99
hooks:
1010
- id: black
11-
args: ["--line-length", "120", "--unstable"]
11+
args: ["--unstable"]
1212
- repo: https://github.com/pycqa/flake8
1313
rev: 7.0.0
1414
hooks:
@@ -36,7 +36,6 @@ repos:
3636
hooks:
3737
- id: isort
3838
name: isort (python)
39-
args: ["--profile", "black", "--filter-files"]
4039
- repo: https://github.com/asottile/pyupgrade
4140
rev: v3.15.1
4241
hooks:

docker/test/test_docker.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
# SPDX-License-Identifier: BSD-3-Clause
55

66
import os
7+
import pytest
78
import subprocess
89
from pathlib import Path
910

10-
import pytest
11-
1211

1312
def start_stop_docker(profile, suffix):
1413
"""Test starting and stopping docker profile with suffix."""

pyproject.toml

Lines changed: 51 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1+
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
2+
# All rights reserved.
3+
#
4+
# SPDX-License-Identifier: BSD-3-Clause
5+
6+
[tool.black]
7+
line-length = 120
8+
target-version = ["py311"]
9+
preview = true
10+
111
[tool.isort]
212

13+
profile = "black"
314
py_version = 310
415
line_length = 120
516
group_by_package = true
@@ -11,6 +22,7 @@ skip_glob = ["docs/*", "logs/*", "_isaac_sim/*", ".vscode/*"]
1122
sections = [
1223
"FUTURE",
1324
"STDLIB",
25+
"OMNIVERSE_EXTENSIONS",
1426
"THIRDPARTY",
1527
"ASSETS_FIRSTPARTY",
1628
"FIRSTPARTY",
@@ -22,44 +34,63 @@ sections = [
2234
# Extra standard libraries considered as part of python (permissive licenses
2335
extra_standard_library = [
2436
"numpy",
25-
"h5py",
26-
"open3d",
2737
"torch",
38+
"einops",
2839
"tensordict",
40+
"warp",
41+
"scipy",
42+
"open3d",
43+
"cv2",
44+
"PIL",
45+
"torchvision",
46+
"transformers",
47+
"h5py",
48+
"yaml",
49+
"toml",
2950
"bpy",
51+
"trimesh",
3052
"matplotlib",
3153
"gymnasium",
3254
"gym",
33-
"scipy",
3455
"hid",
35-
"yaml",
3656
"prettytable",
37-
"toml",
38-
"trimesh",
3957
"tqdm",
40-
"torchvision",
41-
"transformers",
42-
"einops", # Needed for transformers, doesn't always auto-install
58+
"flatdict",
4359
"packaging",
60+
"pytest",
61+
"pytest-mock",
62+
"flaky",
4463
]
45-
# Imports from Isaac Sim and Omniverse
64+
4665
known_third_party = [
47-
"isaacsim.core.api",
48-
"isaacsim.replicator.common",
49-
"omni.replicator.core",
50-
"pxr",
51-
"omni.kit.*",
52-
"warp",
66+
"junitparser",
67+
"pinocchio",
68+
"pink",
69+
"rsl_rl",
70+
"rl_games",
71+
"ray",
72+
"stable_baselines3",
73+
"skrl",
74+
"wandb",
75+
"tensorboard",
76+
"hydra",
77+
"omegaconf",
78+
]
79+
80+
# Imports from Isaac Sim and Omniverse
81+
known_omniverse_extensions = [
5382
"carb",
83+
"omni*",
84+
"isaacsim*",
85+
"pxr",
86+
"usdrt",
5487
"Semantics",
5588
]
89+
5690
# Imports from this repository
5791
known_first_party = "isaaclab"
5892
known_assets_firstparty = "isaaclab_assets"
59-
known_extra_firstparty = [
60-
"isaaclab_rl",
61-
"isaaclab_mimic",
62-
]
93+
known_extra_firstparty = ["isaaclab_rl", "isaaclab_mimic"]
6394
known_task_firstparty = "isaaclab_tasks"
6495
# Imports from the local folder
6596
known_local_folder = "config"

scripts/benchmarks/utils.py

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

1010
from isaacsim.benchmark.services import BaseIsaacBenchmark
1111
from isaacsim.benchmark.services.metrics.measurements import DictMeasurement, ListMeasurement, SingleMeasurement
12+
1213
from tensorboard.backend.event_processing import event_accumulator
1314

1415

scripts/demos/h1_locomotion.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
from omni.kit.viewport.utility import get_viewport_from_window_name
4949
from omni.kit.viewport.utility.camera_state import ViewportCameraState
5050
from pxr import Gf, Sdf
51+
5152
from rsl_rl.runners import OnPolicyRunner
5253

5354
from isaaclab.envs import ManagerBasedRLEnv

scripts/environments/state_machine/lift_cube_sm.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@
4040

4141
import gymnasium as gym
4242
import torch
43-
from collections.abc import Sequence
44-
4543
import warp as wp
44+
from collections.abc import Sequence
4645

4746
from isaaclab.assets.rigid_object.rigid_object_data import RigidObjectData
4847

scripts/environments/state_machine/lift_teddy_bear.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@
4242

4343
import gymnasium as gym
4444
import torch
45-
from collections.abc import Sequence
46-
4745
import warp as wp
46+
from collections.abc import Sequence
4847

4948
from isaaclab.assets.rigid_object.rigid_object_data import RigidObjectData
5049

scripts/environments/state_machine/open_cabinet_sm.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@
4040

4141
import gymnasium as gym
4242
import torch
43-
from collections.abc import Sequence
44-
4543
import warp as wp
44+
from collections.abc import Sequence
4645

4746
from isaaclab.sensors import FrameTransformer
4847

scripts/tools/hdf5_to_mp4.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,12 @@
2121
--framerate Frames per second for the output video. (default: 30)
2222
"""
2323

24-
# Standard library imports
2524
import argparse
25+
import cv2
2626
import h5py
2727
import numpy as np
28-
29-
# Third-party imports
3028
import os
3129

32-
import cv2
33-
3430
# Constants
3531
DEFAULT_VIDEO_HEIGHT = 704
3632
DEFAULT_VIDEO_WIDTH = 1280

scripts/tools/mp4_to_hdf5.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,13 @@
1717
--videos_dir Directory containing the visually augmented MP4 videos.
1818
"""
1919

20-
# Standard library imports
2120
import argparse
21+
import cv2
2222
import glob
2323
import h5py
2424
import numpy as np
25-
26-
# Third-party imports
2725
import os
2826

29-
import cv2
30-
3127

3228
def parse_args():
3329
"""Parse command line arguments."""

0 commit comments

Comments
 (0)