Add Gymnasium integration spike under roboeval/integrations/gymnasium/ - #2
Merged
Merged
Conversation
Wraps any gymnasium.Env into the EnvironmentAdapter Protocol so policies
can be evaluated against Gymnasium environments through EvalRunner.
Zero changes to existing SDK files.
The adapter performs six translations between the two worlds
(observation, action, outcome, events, seed, options) with sensible
defaults and override hooks. Constructs StepOutcome directly using the
existing 8 fields; namespaces Gymnasium-specific raw data under
info["gymnasium"]. Refuses gym.vector.VectorEnv at construction since
the runner is single-episode.
Files added:
- roboeval/integrations/__init__.py (namespace marker)
- roboeval/integrations/README.md (subpackage strategy)
- roboeval/integrations/gymnasium/__init__.py (public re-exports)
- roboeval/integrations/gymnasium/adapter.py (adapter + 6 default hooks)
- roboeval/integrations/gymnasium/demo_rollout.py (CartPole-v1 demo)
- roboeval/integrations/gymnasium/README.md (usage and mapping table)
- roboeval/integrations/gymnasium/requirements.txt (gymnasium>=0.29)
- roboeval/integrations/gymnasium/notes.md (design rationale, gotchas, follow-ups)
- roboeval/integrations/gymnasium/tests/__init__.py
- roboeval/integrations/gymnasium/tests/test_adapter.py (39 unit + integration tests)
Validate:
python -m roboeval.integrations.gymnasium.demo_rollout
python -m unittest discover -s roboeval/integrations/gymnasium/tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wraps any gymnasium.Env into the EnvironmentAdapter Protocol so policies can be evaluated against Gymnasium environments through EvalRunner. Zero changes to existing SDK files.
The adapter performs six translations between the two worlds (observation, action, outcome, events, seed, options) with sensible defaults and override hooks. Constructs StepOutcome directly using the existing 8 fields; namespaces Gymnasium-specific raw data under info["gymnasium"]. Refuses gym.vector.VectorEnv at construction since the runner is single-episode.
Files added:
Validate:
python -m roboeval.integrations.gymnasium.demo_rollout
python -m unittest discover -s roboeval/integrations/gymnasium/tests