[Backport release/3.0.0] Deprecate legacy physics schema cfgs and writers (#7839) - #7908
Conversation
# Description Marks the legacy physics schema config classes and writers deprecated, with per-symbol migration guidance. **Nothing is removed.** Per `AGENTS.md`, this is the prior-release deprecation that a later removal requires. Best reviewed after isaac-sim#7838, which converts the repo's own call sites to fragments. This PR does not depend on it to build or pass — verified that importing shipped asset configs emits the same 8 `DeprecationWarning`s on this branch and on clean `develop`, so it adds no new import-time noise — but landing the migration first keeps our own configs off the deprecated path. ## Scope **35 classes.** Core: `MassPropertiesCfg`, `RigidBodyBaseCfg`, `CollisionBaseCfg`, `JointDriveBaseCfg`, `ArticulationRootBaseCfg`, `MeshCollisionBaseCfg`, `BoundingCube/BoundingSpherePropertiesCfg`. PhysX: the 9 `Physx*PropertiesCfg` classes plus the 10 2.x aliases. Newton: 8 `Newton*`/`Mujoco*PropertiesCfg`. **13 writers.** `define_`/`modify_` × {articulation_root, rigid_body, collision, mass}, plus `modify_joint_drive_properties`, the two tendon writers, and `define_`/`modify_mesh_collision_properties`. **Excluded: everything deformable.** Its fragment families are still in isaac-sim#6673, so there is nothing to point users at yet. A test asserts the deformable symbols stay undeprecated so this cannot drift. ## Mechanism Uses `typing_extensions.deprecated`, which is already a dependency. A small config-class helper applies it to the generated `__init__` above `@configclass`, so construction warns once for the concrete class while importing and defining subclasses remain silent. Signatures, field aliases, `to_dict()`, `copy()`, `replace()`, and `dataclasses.replace()` remain intact. Writers use the standard decorator above `@apply_nested`. Six internal delegation calls bypass only the deprecation wrapper through `__wrapped__`, retaining subtree traversal and emitting one warning naming the public entry point. There is no custom writer decorator or nesting state. Tests that need the raw per-prim writer use `inspect.unwrap(writer)` to bypass all decorators; `modify_*.__wrapped__` now refers to the traversal wrapper. ## Removal version The legacy cfgs and writers are deprecated in **3.1** and scheduled for removal in **3.2**. ## Documentation New migration-guide section in `docs/source/migration/migrating_to_isaaclab_3-0.rst`: full deprecated→fragment table, before/after code, the two non-USD flags that moved to the spawner (`fix_root_link`, `ensure_drives_exist`), the writer table, and a warning-filter snippet for migrating incrementally. Also corrects that guide's existing "Class moves and renames" section, which still recommended `Physx*PropertiesCfg` / `*BaseCfg` as the "Recommended 3.0 pattern" — exactly what this PR deprecates. ## Type of change - Documentation update - New feature (non-breaking change which adds functionality) ## Testing **292 tests passed** locally: - `test_schemas_deprecation.py`: 88 passed. - `test_schemas_shim.py`: 142 passed. - `test_schemas.py`: 44 passed. - `test_tendon_fragments.py`: 18 passed. Covered warning messages and caller locations, construction without import-time warnings, inherited configs, direct and delegated writers, nested mesh collision, child traversal, and raw-writer access. A regression check rejects the removed custom writer decorator and depth state; it fails on the preceding implementation and passes here. All 13 writer warning messages are unchanged. An AST comparison verified that the writer bodies are unchanged apart from the six delegation calls. `uv run isaaclab -f` passed with the changelog checker configured against the PR base. ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the `pre-commit` checks with `uv run isaaclab -f` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have added a changelog fragment under `source/<pkg>/changelog.d/` for every touched package - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there --------- Co-authored-by: Octi Zhang <zhengyuz@nvidia.com> (cherry picked from commit 5889bae)
|
| * Reworded the deprecation notices on the previously deprecated ``*PropertiesCfg`` schema aliases | ||
| to point at the new fragment replacements instead of the intermediate split classes, so the | ||
| whole legacy schema cfg surface is documented to be removed in the same release as the classes | ||
| it forwards to. The material and tendon aliases are unaffected. |
There was a problem hiding this comment.
Changelog Misstates Alias Changes
The changelog says material and tendon aliases are unaffected, but this PR changes their runtime removal warnings from 3.1 to 3.2. It similarly calls deformable configs unaffected while changing the warnings for three deformable aliases. Please document these schedule changes or revert them so users receive an accurate account of the existing deprecations modified by this release.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Isaac Lab Review Bot
The backport preserves the legacy schema cfg and writer implementations while adding deprecation warnings and fragment migration guidance. Two migration instructions need correction: mesh-collision’s replacement writer does not accept prim-path expressions or preserve subtree traversal, and single-fragment spawner replacements should not be presented as lists.
- Design and architecture: The decorator ordering keeps the existing
apply_nestedtraversal inside deprecated writer wrappers, while internal calls through__wrapped__avoid duplicate warnings. The shared cfg deprecation helper is consistently reused across core, PhysX, and Newton; the remaining concerns are confined to migration guidance rather than the compatibility architecture. - API: The migration guide incorrectly generalizes all replacement
apply_*writers as accepting prim-path expressions:apply_mesh_collision_propertiesresolves one exact path withGetPrimAtPath. Deprecation messages also advertise list-wrapped replacements such as[MassCfg(...)]where the repository contract requires a bare fragment for a single-fragment spawner slot. - Implementation: The compatibility paths retain dataclass constructors and helpers, field-alias forwarding, and legacy subtree traversal, with tests consistently using
inspect.unwrap. Documentation and warning text should be aligned with the actual mesh-collision writer signature and single-fragment slot representation before merge.
Minor fixes needed. Posted 2 actionable findings inline.
Automated review; human maintainers own approval decisions.
| **Schema writers** | ||
|
|
||
| The ``define_*`` and ``modify_*`` writers are deprecated alongside the cfgs and | ||
| will be removed in 3.2. Each has an ``apply_*`` counterpart that takes a |
There was a problem hiding this comment.
🟡 Warning · Api — Mesh-collision writer takes exact prim path
This states every apply_* replacement takes a prim-path expression that can author a whole subtree, and the table lists apply_mesh_collision_properties as the replacement for the mesh-collision writers. That function takes a single prim_path, resolves it with stage.GetPrimAtPath, and raises ValueError on an invalid path, so a migrated regex fails and the legacy subtree traversal is lost. Qualify this writer here and in the changelog.
| """ | ||
|
|
||
|
|
||
| @_deprecated_schema_cfg("[MassCfg(...)]") |
There was a problem hiding this comment.
🟡 Warning · Api — Single-fragment replacements advertised as lists
The new warnings wrap a single replacement fragment in a list ([MassCfg(...)], and likewise for MeshCollisionBaseCfg, ArticulationRootBaseCfg, and the Physx*Mesh cooking classes). The repository fragment rule is a bare fragment for a single instance and a list only for multiple fragments; list form forces callers to select the owning fragment before field access or replace(). This changelog also says "Replace MassPropertiesCfg with MassCfg". Emit the bare form for single-fragment replacements.
|
run-ci |
Description
Backports #7839 to
release/3.0.0. Legacy physics schema configs and writers emit deprecation warnings naming their schema-fragment replacements, while the existing APIs continue to work. Includes the migration guide, the standardtyping_extensions.deprecatedimplementation, and the original changelog fragments. The fragment-consumer migration from #7838 is already in the release through #7904.Exact cherry-pick of
5889bae6e8de7a2b5a6e3ff099f82236d251cd19onto release commitff22c52891, with no conflicts or source changes. Preserves the source removal target of 3.2, release package versions, and dependency pins.Validation
292 tests passed locally with PyTorch 2.12:
uv run --no-sync isaaclab -f: all checks passed with changelog validation against the release base.git diff --checkpassed.Kit integration tests ran in separate processes on RTX 5090 with Isaac Sim 6.0.1. Release CI uses its pinned Isaac Sim 6.1 image.
Release backport
Targets
release/3.0.0directly; no further backport requested.