Skip to content

Commit 8a39a8f

Browse files
author
Horde
committed
Fix ruff import order; note resolver statefulness
- Apply ruff I001 import-sorting fix in test file - Add comment confirming SchemaResolverMjc/Newton/Physx are stateless so sharing one proto_resolvers list across proto builders is safe
1 parent e752af0 commit 8a39a8f

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

source/isaaclab_newton/isaaclab_newton/cloner/newton_replicate.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ def _build_newton_builder_from_mapping(
105105
)
106106

107107
# Proto resolvers include SchemaResolverMjc so MjcTendon prims are parsed.
108+
# All three resolver classes are stateless (no instance fields); sharing one
109+
# set across proto builders is safe.
108110
proto_resolvers = [SchemaResolverMjc(), SchemaResolverNewton(), SchemaResolverPhysx()]
109111

110112
# The prototype is built from env_0 in absolute world coordinates.

source/isaaclab_newton/test/cloner/test_mjc_tendon_cloner.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@
3232
import unittest
3333

3434
import newton
35-
from newton.solvers import SolverMuJoCo
36-
3735
from isaaclab_newton.cloner.newton_replicate import _scope_custom_frequencies
36+
from newton.solvers import SolverMuJoCo
3837

3938
_TENDON_FREQ = "mujoco:tendon"
4039
_TENDON_JOINT_FREQ = "mujoco:tendon_joint"
@@ -238,7 +237,11 @@ class TestUsdTendonParsing(unittest.TestCase):
238237
ROOT = "/robot"
239238

240239
def _build_proto(self, stiffness: float = 1.5) -> newton.ModelBuilder:
241-
from newton._src.usd.schemas import SchemaResolverMjc, SchemaResolverNewton, SchemaResolverPhysx # noqa: PLC0415
240+
from newton._src.usd.schemas import ( # noqa: PLC0415
241+
SchemaResolverMjc,
242+
SchemaResolverNewton,
243+
SchemaResolverPhysx,
244+
)
242245

243246
stage, _ = _make_minimal_tendon_stage(self.ROOT, stiffness=stiffness)
244247
b = _mjc_builder()

0 commit comments

Comments
 (0)