env-ssl-wrapper
One line turns any simulator's environment — gymnasium, dm_control, isaac, maniskill, pybullet, robosuite, pufferlib — into the same torch-native interface.
Install
pip install env-ssl-wrapper
Usage
import torch
from env_ssl_wrapper import compose_env
env = compose_env(
any_env, # any env from any sim
('tensor', dict(device='cpu')), # wrap with whatever you need
'done_tracker',
)
obs, info = env.reset() # torch.float32, batched
while not env.all_done:
actions = torch.randint(0, 2, (8,))
obs, reward, terminated, truncated, info = env.step(actions)
Works identically for every simulator.
Wrappers
Pass wrappers as strings (default config) or (name, dict) tuples (custom config), in any order.
| Wrapper | What it does |
|---|---|
standardize |
Normalizes any sim's step/reset signatures, vectorization, and autoreset into (obs, reward, terminated, truncated, info). Applied automatically. |
time_limit |
Caps episodes, sets truncated=True. ('time_limit', dict(max_timesteps=200)) |
done_tracker |
Tracks per-env episode_lengths, exposes env.all_done / env.needs_reset. |
auto_batch |
Gives single envs a leading batch dim: (4,) → (1, 4). |
action_transform |
Rescales actions from a canonical (0, 1) range to the env's bounds. |
tensor |
NumPy → torch on a device, torch actions → numpy for the sim. |
flatten_obs |
Flattens dict/tuple observations into a single vector. |
Every env emits the same contract: obs torch.float32, rewards torch.float32, terminated/truncated torch.bool. env.seed(n) works on every sim.
Mock sims
env_ssl_wrapper.mocks ships dependency-free stand-ins emulating each simulator's quirks (GymnasiumMockEnv, IsaacMockEnv, DMControlMockEnv, ...) for testing your code without installing the real sims.
from env_ssl_wrapper.mocks import IsaacMockEnv
env = compose_env(IsaacMockEnv(), 'tensor', 'done_tracker')
Tests
uv sync --extra test
uv run pytest tests/test_real_envs.py
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file env_ssl_wrapper-0.1.1.tar.gz.
File metadata
- Download URL: env_ssl_wrapper-0.1.1.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bb142231155d2d4e24d5f89104cdb526331791b2fb7083812ed1ceafcebf46f
|
|
| MD5 |
76a542a327272c7edaf3af9331486611
|
|
| BLAKE2b-256 |
b8a1d7bc115830ebd34f28eac310d330e51cb9eeca452480012391316e3c12ab
|
File details
Details for the file env_ssl_wrapper-0.1.1-py3-none-any.whl.
File metadata
- Download URL: env_ssl_wrapper-0.1.1-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b5081ff0b6322eb22610ed6e5a703080f490ec1f3de1c64cb4321d87fc09981
|
|
| MD5 |
a1cbbf4b093770133cec0d76778a6f28
|
|
| BLAKE2b-256 |
9d95e3fc5474a5198816ad1b05d62b457d1b966152d51f7cb3f0ac2f24df7be4
|