Commit d6e8a21
committed
Delegate shim cfg resolution to resolve_presets
Replace the custom flat-getattr + nested-setattr default resolution
inside deprecated_task_alias with a single call to
isaaclab_tasks.utils.hydra.resolve_presets(cls(), selected). The
resolver already walks every nested PresetCfg in the cfg tree and
picks the variant matching one of the selected names (falling back
to each preset's default field), which is exactly what the canonical
task's Hydra path does. The shim now returns bit-for-bit what the
canonical task plus presets=<name> would have produced.
Side effects:
* Drop the cfg_factory parameter from deprecated_task_alias -- the
generic resolver handles the 2-axis (nested) case that previously
required a custom callable.
* Delete the local _resolve_camera_variant helper from
direct/cartpole/__init__.py and the cfg_factory= argument from
its 5 deprecated-shim call sites.
* selected is now the union of every presets=NAME[,...] token's
names, so a future caller passing presets=a,b correctly resolves
both rather than truncating to the first.
No measurable startup-time delta: instantiation of the consolidated
PresetCfg (~22 ms, dominated by configclass deepcopy of a ~1400-node
tree) is the shared cost; the tree walk on top is sub-millisecond.
73 cartpole deprecation tests still pass.1 parent 7e355b9 commit d6e8a21
2 files changed
Lines changed: 23 additions & 51 deletions
Lines changed: 4 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
70 | 52 | | |
71 | 53 | | |
72 | 54 | | |
| |||
77 | 59 | | |
78 | 60 | | |
79 | 61 | | |
80 | | - | |
81 | 62 | | |
82 | 63 | | |
83 | 64 | | |
| |||
93 | 74 | | |
94 | 75 | | |
95 | 76 | | |
96 | | - | |
97 | 77 | | |
98 | 78 | | |
99 | 79 | | |
| |||
109 | 89 | | |
110 | 90 | | |
111 | 91 | | |
112 | | - | |
113 | 92 | | |
114 | 93 | | |
115 | 94 | | |
| |||
125 | 104 | | |
126 | 105 | | |
127 | 106 | | |
128 | | - | |
129 | 107 | | |
130 | 108 | | |
131 | 109 | | |
| |||
141 | 119 | | |
142 | 120 | | |
143 | 121 | | |
144 | | - | |
145 | 122 | | |
146 | 123 | | |
147 | 124 | | |
| |||
157 | 134 | | |
158 | 135 | | |
159 | 136 | | |
160 | | - | |
161 | 137 | | |
162 | 138 | | |
163 | 139 | | |
| |||
Lines changed: 19 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
53 | | - | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
79 | 83 | | |
80 | 84 | | |
81 | 85 | | |
| |||
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | 92 | | |
94 | 93 | | |
95 | 94 | | |
| |||
102 | 101 | | |
103 | 102 | | |
104 | 103 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
113 | 109 | | |
114 | 110 | | |
115 | | - | |
| 111 | + | |
116 | 112 | | |
117 | 113 | | |
0 commit comments