-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Breaks actuator config file into separate files to avoid circular imports #3994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breaks actuator config file into separate files to avoid circular imports #3994
Conversation
Greptile OverviewGreptile SummaryThis PR successfully refactors the actuator configuration structure by splitting the monolithic Key Changes
Issues FoundThe deprecation shim in Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User as User Code
participant OldCfg as actuator_cfg.py<br/>(deprecated)
participant NewBase as actuator_base_cfg.py
participant NewPD as actuator_pd_cfg.py
participant NewNet as actuator_net_cfg.py
participant Init as __init__.py
participant Base as actuator_base.py
Note over User,Base: New Import Path (Recommended)
User->>Init: from isaaclab.actuators import ImplicitActuatorCfg
Init->>NewPD: import from actuator_pd_cfg
NewPD->>Base: import actuator_pd module
Init-->>User: Return config class
Note over User,Base: Legacy Import Path (Deprecated)
User->>OldCfg: from actuator_cfg import ImplicitActuatorCfg
OldCfg->>OldCfg: __getattr__("ImplicitActuatorCfg")
OldCfg->>NewPD: Check if name in dir(actuator_pd_cfg)
OldCfg->>User: warnings.warn(DeprecationWarning)
OldCfg->>NewPD: getattr(actuator_pd_cfg, name)
NewPD-->>OldCfg: Return config class
OldCfg-->>User: Return config class
Note over User,Base: Circular Import Resolution
Base->>NewBase: TYPE_CHECKING import ActuatorBaseCfg
Note over Base: No circular dependency:<br/>actuator_base.py → actuator_base_cfg.py<br/>(previously: actuator_base.py → actuator_cfg.py → actuator_base.py)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
18 files reviewed, no comments
738c478 to
0dfbf47
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (1)
-
source/isaaclab/isaaclab/actuators/actuator_cfg.py, line 1-291 (link)logic: Old
actuator_cfg.pyfile still exists but should be deletedThis file was supposed to be deleted as part of the refactoring to split configs into separate modules. Having both the old monolithic file and the new split files creates:
- Duplicate class definitions (all configs exist in two places)
- Potential for import confusion
- The circular import issue this PR aims to fix could persist through this file
Delete this file since all classes are now properly exported through:
actuator_base_cfg.pyactuator_pd_cfg.pyactuator_net_cfg.py__init__.py
18 files reviewed, 1 comment
Mayankm96
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also make sure the api docs are building correctly?
https://github.com/isaac-sim/IsaacLab/blob/main/docs/source/api/lab/isaaclab.actuators.rst
14f5347 to
d6004fd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
18 files reviewed, no comments
I may not be clear on what the ask is here. The build docs check is completing successfully. I believe the deploy step is skipped until we merge. I don't know if, for example, autoclass directives are correctly displayed in the git rest api preview. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
18 files reviewed, no comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
19 files reviewed, 2 comments
815a22d to
23e95ab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
19 files reviewed, no comments
57155d0 to
1c5ab00
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
19 files reviewed, no comments
1c5ab00 to
c32db68
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
19 files reviewed, no comments
c6af236 to
5014ea8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
19 files reviewed, 2 comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
19 files reviewed, 1 comment
f17f16f to
a332a31
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
20 files reviewed, 1 comment
a332a31 to
dbc2f2d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
20 files reviewed, no comments
dbc2f2d to
44deabe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
20 files reviewed, 1 comment
ooctipus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice refactor! LGTM
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Brian McCann <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
20 files reviewed, 1 comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
20 files reviewed, 1 comment
Signed-off-by: Brian McCann <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
20 files reviewed, 1 comment
Signed-off-by: Kelly Guo <[email protected]>
Signed-off-by: Kelly Guo <[email protected]>
Signed-off-by: Kelly Guo <[email protected]>
Signed-off-by: Kelly Guo <[email protected]>
Signed-off-by: Kelly Guo <[email protected]>
Signed-off-by: Kelly Guo <[email protected]>
Signed-off-by: Kelly Guo <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
20 files reviewed, no comments
Description
This PR breaks the actuator config into separate files in order to avoid a circular import which arises once the configuration is imported into the actuator base class for more than type hinting.
Type of change
.pyfiles and thus modules. They can still be imported directly from theisaaclab.actuatorspackage. External references to these classes through theactuator_cfgmodule will not longer work. Instead, import directly from theisaaclab.actuatorspackage.Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there