Skip to content

Add Gymnasium integration spike under roboeval/integrations/gymnasium/ - #2

Merged
SouravBeraAkaSpeed merged 1 commit into
mainfrom
spike/gymnasium-integration
May 29, 2026
Merged

Add Gymnasium integration spike under roboeval/integrations/gymnasium/#2
SouravBeraAkaSpeed merged 1 commit into
mainfrom
spike/gymnasium-integration

Conversation

@arryan0112

Copy link
Copy Markdown
Contributor

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

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
@SouravBeraAkaSpeed
SouravBeraAkaSpeed merged commit 353800c into main May 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants