Reorganizes the deprecation to be on the base classes.#4547
Reorganizes the deprecation to be on the base classes.#4547kellyguo11 merged 15 commits intoisaac-sim:developfrom
Conversation
Greptile OverviewGreptile SummaryThis PR reorganizes deprecated properties and methods by moving them from PhysX-specific subclasses to their respective base classes. This refactoring ensures consistent deprecation warnings across all implementations and eliminates code duplication. Key changes:
Previously reported issues - all fixed:
The refactoring improves maintainability by centralizing deprecation logic in base classes while preserving backward compatibility. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User as User Code
participant PhysxSubclass as PhysX Subclass<br/>(ArticulationData, etc.)
participant BaseClass as Base Class<br/>(BaseArticulationData, etc.)
Note over User,BaseClass: Before PR: Deprecated properties in subclass
User->>PhysxSubclass: Access deprecated property
PhysxSubclass->>PhysxSubclass: Emit deprecation warning
PhysxSubclass->>User: Return value
Note over User,BaseClass: After PR: Deprecated properties in base class
User->>PhysxSubclass: Access deprecated property
PhysxSubclass->>BaseClass: Inherit property from base
BaseClass->>BaseClass: Emit deprecation warning
BaseClass->>BaseClass: Lazy initialize if needed
BaseClass->>User: Return value
Note over User,BaseClass: Initialization Flow
PhysxSubclass->>PhysxSubclass: _create_buffers()
PhysxSubclass->>BaseClass: super()._create_buffers()
BaseClass->>BaseClass: Initialize default value variables<br/>(set to None for lazy loading)
BaseClass-->>PhysxSubclass: Return
PhysxSubclass->>PhysxSubclass: Initialize subclass-specific buffers
|
| logger.warning( | ||
| "The `root_physx_view` property will be deprecated in a future release. Please use `root_view` instead." | ||
| "The `root_physx_view` property will be deprecated in a future release. Please use `root_view` instead.", | ||
| DeprecationWarning, | ||
| stacklevel=2, | ||
| ) |
There was a problem hiding this comment.
Runtime error in warning
logger.warning(...) is being called with DeprecationWarning and stacklevel=2 as extra args (lines 696-700). The logging API treats extra positional args as % formatting parameters; since the message has no formatting placeholders, accessing root_physx_view will raise a TypeError at runtime. This should be warnings.warn(..., DeprecationWarning, stacklevel=2) (like Articulation.root_physx_view) or a plain logger.warning("...") without the extra args.
source/isaaclab/isaaclab/assets/rigid_object_collection/base_rigid_object_collection.py
Show resolved
Hide resolved
|
@greptile can you review again? |
source/isaaclab/isaaclab/assets/articulation/base_articulation_data.py
Outdated
Show resolved
Hide resolved
source/isaaclab/isaaclab/assets/articulation/base_articulation_data.py
Outdated
Show resolved
Hide resolved
source/isaaclab/isaaclab/assets/articulation/base_articulation_data.py
Outdated
Show resolved
Hide resolved
source/isaaclab/isaaclab/assets/articulation/base_articulation_data.py
Outdated
Show resolved
Hide resolved
source/isaaclab/isaaclab/assets/articulation/base_articulation_data.py
Outdated
Show resolved
Hide resolved
source/isaaclab/isaaclab/assets/rigid_object/base_rigid_object_data.py
Outdated
Show resolved
Hide resolved
source/isaaclab/isaaclab/assets/rigid_object/base_rigid_object_data.py
Outdated
Show resolved
Hide resolved
source/isaaclab/isaaclab/assets/rigid_object_collection/base_rigid_object_collection_data.py
Outdated
Show resolved
Hide resolved
source/isaaclab/isaaclab/assets/rigid_object_collection/base_rigid_object_collection_data.py
Outdated
Show resolved
Hide resolved
...isaaclab_physx/isaaclab_physx/assets/rigid_object_collection/rigid_object_collection_data.py
Outdated
Show resolved
Hide resolved
…_data.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Antoine RICHARD <antoiner@nvidia.com>
…_data.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Antoine RICHARD <antoiner@nvidia.com>
…_data.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Antoine RICHARD <antoiner@nvidia.com>
…_data.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Antoine RICHARD <antoiner@nvidia.com>
…_data.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Antoine RICHARD <antoiner@nvidia.com>
…_data.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Antoine RICHARD <antoiner@nvidia.com>
…ction/rigid_object_collection_data.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Antoine RICHARD <antoiner@nvidia.com>
…_data.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Antoine RICHARD <antoiner@nvidia.com>
…igid_object_collection_data.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Antoine RICHARD <antoiner@nvidia.com>
…igid_object_collection_data.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Antoine RICHARD <antoiner@nvidia.com>
|
@greptile Can you take another look? |
Signed-off-by: Kelly Guo <kellyg@nvidia.com>
Description
Moves the deprecated methods to the base classes.
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there.