Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
- Use `./isaaclab.sh` only for installer workflows that require it.
- Do not define Warp kernels in `python -c`; write a temporary Python file instead so Warp can inspect the source.

## Code style

- Group imports in PEP 8 order, separated by blank lines: `__future__`, standard library, third-party,
Omniverse runtime packages (`isaacsim`, `omni`, `pxr`, `carb`, ...), Isaac Lab packages, then local relative imports.
Ruff enforces this order through `uv run isaaclab -f`; do not sort imports by hand.
- Import from the same package with relative imports when the target is at most three leading dots away
(e.g. `from ...utils import math as math_utils`). Use absolute imports for deeper targets and for other packages.
- Keep absolute imports in modules that can run as scripts (with an `if __name__ == "__main__":` block),
since relative imports fail there.

## Testing and validation

- Run the narrowest relevant test first.
Expand Down
1 change: 1 addition & 0 deletions source/isaaclab/changelog.d/core-cleanup-imports.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Switched same-package imports in the core package to relative form up to three levels.
2 changes: 1 addition & 1 deletion source/isaaclab/isaaclab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,6 @@ def bootstrap_kernel():

def main():
"""Run the ``isaaclab`` command through its compatibility dispatcher."""
from isaaclab.__main__ import main as _main
from .__main__ import main as _main

sys.exit(_main())
2 changes: 1 addition & 1 deletion source/isaaclab/isaaclab/actuators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
which is exposed through :attr:`isaaclab.assets.Articulation.actuators`.
"""

from isaaclab.utils.module import lazy_export
from ..utils.module import lazy_export

lazy_export()
2 changes: 1 addition & 1 deletion source/isaaclab/isaaclab/actuators/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import torch

from isaaclab.utils.string import _resolve_matching_values_dense
from ..utils.string import _resolve_matching_values_dense

from .actuator_base_cfg import _is_implicit_actuator_cfg

Expand Down
5 changes: 2 additions & 3 deletions source/isaaclab/isaaclab/actuators/actuator_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@

import torch

import isaaclab.utils.string as string_utils
from isaaclab.utils.types import ArticulationActions

from ..utils import string as string_utils
from ..utils.types import ArticulationActions
from ._compat import _limits_equal, _resolve_limit_aliases

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion source/isaaclab/isaaclab/actuators/actuator_base_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from dataclasses import MISSING

from isaaclab.utils import configclass
from ..utils import configclass


def _is_implicit_actuator_cfg(cfg: ActuatorBaseCfg) -> bool:
Expand Down
7 changes: 3 additions & 4 deletions source/isaaclab/isaaclab/actuators/actuator_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
import warp as wp
from prettytable import PrettyTable

from isaaclab.utils.types import ArticulationActions
from isaaclab.utils.warp import ProxyArray
from isaaclab.utils.warp.launch_cache import _WarpLaunchCache

from ..utils.types import ArticulationActions
from ..utils.warp import ProxyArray
from ..utils.warp.launch_cache import _WarpLaunchCache
from . import actuator_kernels
from ._compat import _resolve_limit_aliases
from .actuator_base import ActuatorBase, resolve_joint_parameter
Expand Down
3 changes: 1 addition & 2 deletions source/isaaclab/isaaclab/actuators/actuator_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
import torch
import warp as wp

from isaaclab.utils.warp import ProxyArray

from ..utils.warp import ProxyArray
from .actuator_base_cfg import ActuatorBaseCfg

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion source/isaaclab/isaaclab/actuators/actuator_kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import torch
import warp as wp

from isaaclab.utils.warp.index_kernel import IndexKernelDispatcher
from ..utils.warp.index_kernel import IndexKernelDispatcher


@wp.kernel(enable_backward=False)
Expand Down
5 changes: 2 additions & 3 deletions source/isaaclab/isaaclab/actuators/actuator_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@

import torch

from isaaclab.utils.assets import read_file
from isaaclab.utils.types import ArticulationActions

from ..utils.assets import read_file
from ..utils.types import ArticulationActions
from .actuator_pd import DCMotor

if TYPE_CHECKING:
Expand Down
3 changes: 1 addition & 2 deletions source/isaaclab/isaaclab/actuators/actuator_net_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
from dataclasses import MISSING
from typing import TYPE_CHECKING, Literal

from isaaclab.utils import configclass

from ..utils import configclass
from .actuator_pd_cfg import DCMotorCfg

if TYPE_CHECKING:
Expand Down
5 changes: 2 additions & 3 deletions source/isaaclab/isaaclab/actuators/actuator_pd.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@

import torch

from isaaclab.utils import DelayBuffer, LinearInterpolation
from isaaclab.utils.types import ArticulationActions

from ..utils import DelayBuffer, LinearInterpolation
from ..utils.types import ArticulationActions
from ._compat import _limits_equal
from .actuator_base import ActuatorBase, resolve_joint_parameter

Expand Down
3 changes: 1 addition & 2 deletions source/isaaclab/isaaclab/actuators/actuator_pd_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
from dataclasses import MISSING
from typing import TYPE_CHECKING

from isaaclab.utils import configclass

from ..utils import configclass
from .actuator_base_cfg import ActuatorBaseCfg

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion source/isaaclab/isaaclab/actuators/newton/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
)

if TYPE_CHECKING:
from isaaclab.actuators import ActuatorCollection
from .. import ActuatorCollection

# ---------------------------------------------------------------------------
# Abstract base — backend-independent logic
Expand Down
2 changes: 1 addition & 1 deletion source/isaaclab/isaaclab/actuators/newton/physx_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from .physx_wrapper import PhysxActuatorWrapper

if TYPE_CHECKING:
from isaaclab.actuators import ActuatorCollection
from .. import ActuatorCollection


class PhysxActuatorRuntime:
Expand Down
2 changes: 1 addition & 1 deletion source/isaaclab/isaaclab/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@

"""

from isaaclab.utils.module import lazy_export
from ..utils.module import lazy_export

lazy_export()
14 changes: 7 additions & 7 deletions source/isaaclab/isaaclab/app/app_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@

SimulationApp = getattr(isaacsim, "SimulationApp", None)

from isaaclab.app.loading_screen import report_activity
from isaaclab.app.logging_utils import apply_python_logging_level, resolve_python_logging_level
from isaaclab.app.settings_manager import get_settings_manager, initialize_carb_settings
from isaaclab.paths import ISAACLAB_ROOT
from isaaclab.utils._device import set_cuda_device
from isaaclab.utils.renderers import ISAAC_RTX_SHOW_ALL_PARTITIONS_BY_DEFAULT_SETTING
from ..paths import ISAACLAB_ROOT
from ..utils._device import set_cuda_device
from ..utils.renderers import ISAAC_RTX_SHOW_ALL_PARTITIONS_BY_DEFAULT_SETTING
from .loading_screen import report_activity
from .logging_utils import apply_python_logging_level, resolve_python_logging_level
from .settings_manager import get_settings_manager, initialize_carb_settings

# import logger
logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -345,7 +345,7 @@ def __init__(self, launcher_args: argparse.Namespace | dict | None = None, **kwa
# additional ``pip_prebundle`` or conflicting extension directories onto
# ``sys.path`` during startup. A second pass ensures pip-installed
# packages still take priority over bundled copies.
from isaaclab import _deprioritize_prebundle_paths
from .. import _deprioritize_prebundle_paths

_deprioritize_prebundle_paths()

Expand Down
22 changes: 11 additions & 11 deletions source/isaaclab/isaaclab/app/sim_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
from isaaclab_physx.physics import PhysxCfg
from isaaclab_physx.renderers import IsaacRtxRendererCfg

from isaaclab.app.logging_utils import apply_python_logging_level, resolve_python_logging_level
from isaaclab.physics.physics_manager_cfg import PhysicsCfg, PhysxAutoCfg, _resolve_physx_auto_cfg
from isaaclab.renderers.renderer_cfg import RendererCfg
from isaaclab.sensors.camera.camera_cfg import CameraCfg
from isaaclab.utils._device import set_cuda_device
from ..physics.physics_manager_cfg import PhysicsCfg, PhysxAutoCfg, _resolve_physx_auto_cfg
from ..renderers.renderer_cfg import RendererCfg
from ..sensors.camera.camera_cfg import CameraCfg
from ..utils._device import set_cuda_device
from .logging_utils import apply_python_logging_level, resolve_python_logging_level

logger = logging.getLogger(__name__)

Expand All @@ -47,7 +47,7 @@ def add_launcher_args(parser: argparse.ArgumentParser) -> None:
Delegates to :meth:`AppLauncher.add_app_launcher_args` so that user scripts
do not need to import ``AppLauncher`` directly.
"""
from isaaclab.app import AppLauncher
from . import AppLauncher

AppLauncher.add_app_launcher_args(parser)

Expand Down Expand Up @@ -548,10 +548,10 @@ def launch_simulation(
close_fn: Any = None
if needs_kit:
_ensure_isaac_sim_available()
from isaaclab.utils import has_kit
from ..utils import has_kit

if not has_kit():
from isaaclab.app import AppLauncher
from . import AppLauncher

app_launcher = AppLauncher(launcher_args)
# AppLauncher may refine the device choice; propagate its final value,
Expand All @@ -563,7 +563,7 @@ def launch_simulation(
elif visualizer_types or visualizer_explicit_none:
# Kitless path: AppLauncher is skipped, so persist the visualizer selection in
# SettingsManager so SimulationContext._get_cli_visualizer_types() can find it.
from isaaclab.app import AppLauncher
from . import AppLauncher

disable_all = visualizer_explicit_none or "none" in visualizer_types
base = vars(launcher_args) if isinstance(launcher_args, argparse.Namespace) else launcher_args
Expand All @@ -576,7 +576,7 @@ def launch_simulation(
try:
# The import stays after the Kit launch decision. With no selected profile this is a
# no-op; with one, it installs process-wide OmniClient routing before user code runs.
from isaaclab.utils.assets import configure_storage_profile
from ..utils.assets import configure_storage_profile

configure_storage_profile()
yield physics_cfg
Expand All @@ -596,7 +596,7 @@ def launch_simulation(

def _ensure_isaac_sim_available() -> None:
"""Raise ``SystemExit`` with an actionable hint when Isaac Sim / Kit is missing."""
from isaaclab.app import AppLauncher # noqa: PLC0415
from . import AppLauncher # noqa: PLC0415

if AppLauncher.is_available():
return
Expand Down
2 changes: 1 addition & 1 deletion source/isaaclab/isaaclab/assets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
the corresponding actuator torques.
"""

from isaaclab.utils.module import lazy_export
from ..utils.module import lazy_export

lazy_export()
2 changes: 1 addition & 1 deletion source/isaaclab/isaaclab/assets/articulation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@

"""Sub-module for rigid articulated assets."""

from isaaclab.utils.module import lazy_export
from ...utils.module import lazy_export

lazy_export()
3 changes: 1 addition & 2 deletions source/isaaclab/isaaclab/assets/articulation/articulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

from typing import TYPE_CHECKING

from isaaclab.utils.backend_utils import FactoryBase

from ...utils.backend_utils import FactoryBase
from .base_articulation import BaseArticulation
from .base_articulation_data import BaseArticulationData

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
from dataclasses import MISSING
from typing import TYPE_CHECKING, Any

from isaaclab.actuators import ActuatorBaseCfg
from isaaclab.utils import configclass

from ...actuators import ActuatorBaseCfg
from ...utils import configclass
from ..asset_base_cfg import AssetBaseCfg
from .ordering import ArticulationOrderingConvention

Expand Down Expand Up @@ -122,7 +121,7 @@ def _post_spawn(self, stage: Any) -> None:
"""
if self.actuators is MISSING:
return
from isaaclab.sim.schemas.schemas_actuators import define_actuator_properties # noqa: PLC0415
from ...sim.schemas.schemas_actuators import define_actuator_properties # noqa: PLC0415

# In InteractiveScene, articulated assets are often spawned first under
# a template path (for example ``/World/template/Robot``) and cloned
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

from typing import TYPE_CHECKING

from isaaclab.utils.backend_utils import FactoryBase

from ...utils.backend_utils import FactoryBase
from .base_articulation_data import BaseArticulationData

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@
from .ordering_resolvers import _resolve_articulation_ordering_names

if TYPE_CHECKING:
from isaaclab.actuators import ActuatorCollection
from isaaclab.utils.wrench_composer import WrenchComposer

from ...actuators import ActuatorCollection
from ...utils.wrench_composer import WrenchComposer
from .articulation_cfg import ArticulationCfg
from .base_articulation_data import BaseArticulationData

Expand Down Expand Up @@ -1684,7 +1683,7 @@ def _write_deprecated_native_actuator_gain(
joint_ids: torch.Tensor,
) -> None:
"""Warn and forward a legacy native-controller gain write."""
from isaaclab.actuators.newton import write_group_parameter # noqa: PLC0415
from ...actuators.newton import write_group_parameter # noqa: PLC0415

warnings.warn(
f"{writer_name} is deprecated in 3.x and will be removed in 3.1. Use "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import warp as wp

from isaaclab.utils.leapp import (
from ...utils.leapp import (
POSE6_ELEMENT_NAMES,
POSE7_ELEMENT_NAMES,
QUAT_XYZW_ELEMENT_NAMES,
Expand All @@ -24,14 +24,12 @@
joint_names_resolver,
leapp_tensor_semantics,
)
from isaaclab.utils.warp import ProxyArray

from ...utils.warp import ProxyArray
from . import ordering_kernels

if TYPE_CHECKING:
from isaaclab.actuators import ActuatorCollection
from isaaclab.utils.buffers import TimestampedBufferWarp

from ...actuators import ActuatorCollection
from ...utils.buffers import TimestampedBufferWarp
from .ordering import ArticulationNameMap


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

import warp as wp

from isaaclab.utils.warp.index_kernel import IndexKernelDispatcher
from ...utils.warp.index_kernel import IndexKernelDispatcher

if TYPE_CHECKING:
import torch
Expand Down
Loading
Loading