Skip to content

Comments

Reorganizes the deprecation to be on the base classes.#4547

Merged
kellyguo11 merged 15 commits intoisaac-sim:developfrom
AntoineRichard:antoiner/rework_assets_deprecations
Feb 7, 2026
Merged

Reorganizes the deprecation to be on the base classes.#4547
kellyguo11 merged 15 commits intoisaac-sim:developfrom
AntoineRichard:antoiner/rework_assets_deprecations

Conversation

@AntoineRichard
Copy link
Collaborator

Description

Moves the deprecated methods to the base classes.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

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 Feb 5, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 5, 2026

Greptile Overview

Greptile Summary

This 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:

  • Moved all deprecated properties (e.g., default_mass, default_inertia, root_pose_w, etc.) from PhysX subclasses to base classes
  • Added proper super()._create_buffers() calls in all PhysX subclasses to initialize base class default value variables
  • Fixed the root_physx_view deprecation warning to use warnings.warn() instead of incorrect logger.warning() call
  • Moved deprecated methods like num_objects, object_names, write_object_state_to_sim to base classes
  • All deprecation warnings properly use warnings.warn() with DeprecationWarning and stacklevel=2
  • Updated version to 3.0.3 and added appropriate changelog entries

Previously reported issues - all fixed:

  • Runtime error in logger.warning() with extra args - fixed to use warnings.warn()
  • Incorrect num_objects deprecation message - fixed to correctly indicate num_objects is deprecated
  • Missing spaces in string concatenation - all fixed
  • Missing parentheses in super() call - fixed

The refactoring improves maintainability by centralizing deprecation logic in base classes while preserving backward compatibility.

Confidence Score: 5/5

  • This PR is safe to merge with no identified issues
  • All previously reported issues have been fixed, the refactoring follows proper OOP principles, deprecation warnings are correctly implemented, super() calls are in place, and all tests pass according to the PR checklist
  • No files require special attention

Important Files Changed

Filename Overview
source/isaaclab/isaaclab/assets/articulation/base_articulation_data.py Added deprecated property implementations to base class with proper warnings, variable initialization, and lazy cloning patterns
source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation_data.py Removed deprecated properties from subclass (moved to base), added proper super() call in _create_buffers
source/isaaclab/isaaclab/assets/rigid_object_collection/base_rigid_object_collection_data.py Added deprecated properties to base class with proper initialization and deprecation warnings
source/isaaclab_physx/isaaclab_physx/assets/rigid_object_collection/rigid_object_collection_data.py Removed deprecated properties from subclass, added super() call (previously missing parentheses - now fixed)
source/isaaclab/isaaclab/assets/rigid_object_collection/base_rigid_object_collection.py Added deprecated methods/properties (num_objects, object_names, write_object_state_to_sim) to base class with proper warnings
source/isaaclab_physx/isaaclab_physx/assets/rigid_object/rigid_object.py Fixed root_physx_view deprecation warning to use warnings.warn() instead of incorrect logger.warning() call

Sequence Diagram

sequenceDiagram
    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
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

11 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines 696 to 700
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,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

@AntoineRichard
Copy link
Collaborator Author

@greptile can you review again?

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

4 files reviewed, 10 comments

Edit Code Review Agent Settings | Greptile

AntoineRichard and others added 10 commits February 5, 2026 14:09
…_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>
@AntoineRichard
Copy link
Collaborator Author

@greptile Can you take another look?

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

6 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@kellyguo11 kellyguo11 changed the title Reorganized the deprecation to be on the base classes. Reorganizes the deprecation to be on the base classes. Feb 6, 2026
Signed-off-by: Kelly Guo <kellyg@nvidia.com>
@kellyguo11 kellyguo11 merged commit 5e3a59c into isaac-sim:develop Feb 7, 2026
7 of 9 checks passed
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

None yet

Development

Successfully merging this pull request may close these issues.

2 participants