Repository navigation
Reorganize Relation Folder - #1534
Conversation
Signed-off-by: zhx06 <zihaox@nvidia.com>
Signed-off-by: zhx06 <zihaox@nvidia.com>
75f4aaa to
a47929b
Compare
[Medium impact] This PR appears safe to merge. SummaryReorganizes placement code into
Acknowledged by Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
API["User-facing relations and placers"] --> OPT["optimization: seed and solve layouts"]
OPT --> GEO["geometry: collision shapes and bounds"]
API --> VAL["validation: check layouts"]
VAL --> GEO
API --> LAYOUT["Finished layouts"]
LAYOUT --> RUN["runtime: choose layouts and write poses"]
Reviews (1) · Last reviewed commit: "describe relations subpackages" · Reviewed by Greptile |
🤖 Isaac Lab-Arena Review BotSummaryThis PR moves 21 modules out of the flat Design, Boundaries & Scope
Findings🔵 Improvement: isaaclab_arena/relations/validation/pre_physics.py:22: Test Coverage and CI CostI couldn't confirm CI results for this head: the test jobs show as skipped and pre-commit as queued. The description reports local Phase 1 runs (PhysX and Newton) and the relations tests. It also says the cuRobo validator tests were not run. The PR doesn't add or change test logic, so I have no coverage concern beyond that. VerdictShip it |
Reorganize
isaaclab_arena/relations/so that its top level holds only what users write and receive, and move the code that solves and applies placements into subpackages by responsibility. Only module paths and imports change.Why this change?
relations/kept 30 modules in one flat folder. Only 10 of them are what users write or receive: the relation types, the placers, their settings and results. The other 20 sat beside them: the solver, its losses, collision geometry, build-time checks and reset-time code. Finding the user API, or the code behind a placement behavior, meant scanning the whole folder, and the flat layout said nothing about how the modules depend on each other.What changes?
One rule decides where each module goes: it stays at the top level only if users construct or receive it. Every other module moves to the subpackage for the stage of placement it serves.
Before:
After:
The folders read in the order placement runs. When the environment is built,
optimization/solves candidate layouts againstgeometry/, andvalidation/checks them. At each reset,runtime/applies one; it imports nothing fromoptimization/orvalidation/, because it only needs finished layouts. This is the same build-time and run-time split Arena uses for variations.__init__.pyhas a one-line docstring saying what it owns.Old to new module paths
Replace whole module names only:
relation_solveris a prefix ofrelation_solver_params, which stays at the top level. Theinitializersline covers that package's modules.Known couplings, left for follow-ups because fixing them moves functions rather than files:
RelationSolverParamsmaps each relation type to its loss strategy, so the top-level settings importoptimization/losses/.PlaceableAssetimportsruntime/placement_poses.pyfor its method that writes poses to the simulation.ObjectPlacerParamstakesInitializerType, a user choice, fromoptimization/initializers/.validation/pre_physics.pyimports theNextToandNotNextTochecks fromoptimization/losses/relation_loss_strategies.py.physics_settle_params.pyis used only byoffline_placement/; moving it there would reach outsiderelations/.Validation
ObjectPlacerrun gives identical positions, yaws, losses and verdicts onmainand on this branch. It covers both initializers, with and without random yaw, over 3 environments, plus aPooledObjectPlacer.isaaclab_arena.relationsimport andpatchtarget resolves (958 names in 119 files), and no old module path remains.pre-commitpasses.curobo. Their imports resolve.