Remove RLFramework enum, replace with plain string#544
Conversation
The isaaclab_arena.reinforcement_learning module existed solely for an RLFramework enum whose only method produced strings like "rsl_rl_cfg_entry_point". This is an IsaacLab gym registration convention, not a core Arena concept. Replace rl_framework: RLFramework with rl_framework_entry_point: str on IsaacLabArenaEnvironment. The constructor now validates that both rl_framework_entry_point and rl_policy_cfg are set together or not at all. The reinforcement_learning module is deleted. Signed-off-by: Clemens Volk <cvolk@nvidia.com>
Greptile SummaryThis PR removes the Confidence Score: 5/5Safe to merge — clean simplification with no remaining references to the deleted module and proper paired-None validation on the new parameters. All findings are P2 or lower; no correctness, data-integrity, or reliability issues were found. The deletion is complete (no dangling imports), the new string-based API is well-documented, and the paired validation guard prevents misuse. No files require special attention.
|
| Filename | Overview |
|---|---|
| isaaclab_arena/environments/isaaclab_arena_environment.py | Replaces rl_framework: RLFramework with rl_framework_entry_point: str; adds paired-None validation and updated docstring. Clean. |
| isaaclab_arena/environments/arena_env_builder.py | Updated build_registered to use the new rl_framework_entry_point string directly as a kwargs key; removes the old enum import. No issues. |
| isaaclab_arena_environments/dexsuite_lift_environment.py | Updated to pass rl_framework_entry_point="rsl_rl_cfg_entry_point" directly; old RLFramework import removed. Clean. |
| isaaclab_arena_environments/lift_object_environment.py | Updated to pass rl_framework_entry_point="rsl_rl_cfg_entry_point" directly; old RLFramework import removed. Clean. |
| docs/pages/example_workflows/dexsuite_lift/step_1_environment_setup.rst | Documentation code snippet updated to reflect the new rl_framework_entry_point plain-string API. |
| isaaclab_arena/reinforcement_learning/frameworks.py | File deleted — was the sole content of the reinforcement_learning module. No remaining references in the codebase. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["User code creates IsaacLabArenaEnvironment"] --> B["rl_framework_entry_point: str\ne.g. 'rsl_rl_cfg_entry_point'"]
B --> C["ArenaEnvBuilder.build_registered()"]
C --> D["kwargs = {'env_cfg_entry_point': cfg}"]
D --> E{"rl_framework_entry_point\nset?"}
E -- Yes --> F["kwargs[rl_framework_entry_point] = rl_policy_cfg"]
E -- No --> G["Skip RL kwargs"]
F --> H["gym.register(id=name, kwargs=kwargs)"]
G --> H
Reviews (1): Last reviewed commit: "Merge branch 'main' into cvolk/remove-rl..." | Re-trigger Greptile
There was a problem hiding this comment.
Clean simplification — the RLFramework enum was unnecessary indirection over what are just well-known string constants.
What's good:
- Replacing the enum with a plain
strremoves a module, an import, and a layer of abstraction while keeping the same functionality. - The new
ValueErrorguard inIsaacLabArenaEnvironment.__init__that enforcesrl_framework_entry_pointandrl_policy_cfgare set/unset together is strictly better than the oldassertinbuild_registered— it fails earlier, gives a clear message, and isn't stripped by-O. - Docstring additions clearly explain what values
rl_framework_entry_pointexpects, which the enum never surfaced to the user. - All call-sites and docs are updated consistently. No stale references to
RLFrameworkremain in the repo.
One minor note (non-blocking):
- The
reinforcement_learning/directory only containedframeworks.py(no__init__.py). With that file deleted, the empty directory is gone from git, which is fine — just noting it was never a proper Python package to begin with.
LGTM 👍
Summary
isaaclab_arena/reinforcement_learning/: A module that existed solely for anRLFrameworkenum whose only method produced strings like"rsl_rl_cfg_entry_point"rl_framework: RLFrameworkwithrl_framework_entry_point: stronIsaacLabArenaEnvironmentand let the user pass in the correct string directly