Skip to content

Removes kit dependency at runtime for asset configuration - #3756

Merged
Mayankm96 merged 2 commits into
isaac-sim:mainfrom
nv-rgresia:type-checking-cfg-imports
Dec 28, 2025
Merged

Mayankm96 merged 2 commits into
isaac-sim:mainfrom
nv-rgresia:type-checking-cfg-imports

Conversation

@nv-rgresia

@nv-rgresia nv-rgresia commented Oct 17, 2025 •

Copy link
Copy Markdown
Contributor

Description

This quality of life upgrade adds the ability to use the configuration classes without needing to load the kit dependencies.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • 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
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Oct 17, 2025
@nv-rgresia nv-rgresia self-assigned this Oct 17, 2025
@nv-rgresia
nv-rgresia force-pushed the type-checking-cfg-imports branch 3 times, most recently from a37d32c to db7d2cd Compare October 17, 2025 22:04
@nv-rgresia
nv-rgresia force-pushed the type-checking-cfg-imports branch from db7d2cd to 7dd771e Compare October 17, 2025 22:06

@ooctipus ooctipus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kellyguo11

Copy link
Copy Markdown
Contributor

@greptileai

@greptile-apps greptile-apps Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This PR refactors imports in configuration classes to use Python's TYPE_CHECKING guard pattern, allowing configuration classes to be imported without loading heavyweight Isaac Sim kit dependencies at runtime. The changes move imports like AssetBase, Articulation, RigidObject, RigidObjectCollection, and InteractiveScene into TYPE_CHECKING blocks, making them available only for static type analysis while deferring their runtime loading. The from __future__ import annotations statement enables deferred evaluation of type hints, which is essential for this pattern to work. This optimization improves import performance and enables using configuration classes in contexts where the full simulator isn't needed, such as configuration definition or manipulation without spinning up the simulation environment.

Critical Issue: In action_manager.py line 54, the code uses self._asset: AssetBase as a runtime type annotation, but AssetBase is now only imported in the TYPE_CHECKING block. This will cause a NameError at runtime when this line executes. The annotation should be stringified as self._asset: "AssetBase" or the import strategy needs adjustment to keep AssetBase available at runtime.

Confidence: 2/5 - The core pattern is sound, but the runtime annotation bug in action_manager.py is a blocking issue that will cause failures. Once fixed, this would be a clean optimization. The other files (scene_entity_cfg.py and CONTRIBUTORS.md) appear correct.

Additional Comments (1)

  1. source/isaaclab/isaaclab/managers/action_manager.py, line 54 (link)

    logic: Runtime type annotation without string quotes may cause NameError if AssetBase isn't imported at runtime. Consider using string annotation self._asset: "AssetBase" or importing conditionally.

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

from dataclasses import MISSING
from typing import TYPE_CHECKING

if TYPE_CHECKING:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move this logic to the end of the imports?

@kellyguo11 kellyguo11 moved this to In progress in Isaac Lab Nov 8, 2025
@Mayankm96
Mayankm96 merged this pull request into isaac-sim:main Dec 28, 2025
@github-project-automation github-project-automation Bot moved this from In progress to Done in Isaac Lab Dec 28, 2025
Mayankm96 pushed a commit that referenced this pull request Dec 28, 2025
This quality of life upgrade adds the ability to use the configuration
classes without needing to load the kit dependencies.

- [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
thiagolages pushed a commit to thiagolages/isaac-lab that referenced this pull request Jan 6, 2026
…3756)

This quality of life upgrade adds the ability to use the configuration
classes without needing to load the kit dependencies.

- [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
Edify0991 pushed a commit to Edify0991/IsaacLab that referenced this pull request Jan 14, 2026
…3756)

This quality of life upgrade adds the ability to use the configuration
classes without needing to load the kit dependencies.

- [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
nitesh-subedi pushed a commit to nitesh-subedi/IsaacLab that referenced this pull request Feb 5, 2026
…3756)

This quality of life upgrade adds the ability to use the configuration
classes without needing to load the kit dependencies.

- [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
csj-275 pushed a commit to csj-275/IsaacLab that referenced this pull request Jul 8, 2026
…3756)

This quality of life upgrade adds the ability to use the configuration
classes without needing to load the kit dependencies.

- [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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isaac-lab Related to Isaac Lab team

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants