Wrap Your Gym!
Common OpenAI gym wrappers found during my journeys. This repository collects a multitude of wrappers that I needed for my own implementation or extracted from other research repositories.
Why create this repository? As most research implementations opt for changing environment implementations instead of wrappers, it gets very complicated to replace the originally used environment. This repository extracts all modifications to the environment and makes it possible to just plug and play a custom environment with a multitude of wrappers. I hope, that this convinces other researchers of the benefit of wrappers and changes the way we implement environments in the long run.
OpenAI Gym Compatibility
This package uses the new Gym API where it is necessary to use one specific API. While most wrappers should be usable with the old API, an easy fix is the usage of the StepAPICompability wrapper implemented in Gym. E.g.
from gym.wrappers import StepAPICompability
from wrap_your_gym import ResetObs
env = ... # Your Env
env = StepAPICompability(env, truncated_bool=True)
env = ResetObs(env) # or another wrapper
env = StepAPICompability(env, truncated_bool=False) # depending on the API your code was implemented for
Requirements
- Python 3.7.0 or newer
- Gym (obviously)
- Numpy
- For the torch module: PyTorch
Installation
pip install wrap-your-gym
Development
This project uses poetry for packaging and managing all dependencies and pre-commit to run flake8, isort, mypy and black.
Additionally, pdbpp and better-exceptions
are installed to provide a better debugging experience.
To enable better-exceptions you have to run export BETTER_EXCEPTIONS=1 in your current session/terminal.
Clone this repository and run
poetry install
poetry run pre-commit install
to create a virtual environment containing all dependencies. Afterwards, You can run the test suite using
poetry run pytest
This repository follows the Conventional Commits style.
Metadata
Release files for wrap-your-gym 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wrap_your_gym-0.0.2.tar.gz | 5.2 kB | Without provenance | Details for wrap_your_gym-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wrap_your_gym-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for wrap_your_gym-0.0.2-py3-none-any.whl |
Total release size: 10.5 kB
Release files / wrap_your_gym-0.0.2.tar.gz
| Download URL | wrap_your_gym-0.0.2.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e674a251b1a06cc41616dc8151cab214bc9811804b5be550e6be0b9e823742a
|
|
BLAKE2b-256 checksum How to use checksums |
dbf91f035e51b41b5398ba23f67de55f95bab049ce8b351b0008921fbfad782d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.15
|
Release files / wrap_your_gym-0.0.2-py3-none-any.whl
| Download URL | wrap_your_gym-0.0.2-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
46d33071c15a66a6b4f1c9cacd645f2f980359a6d024372d8100cd384db066d3
|
|
BLAKE2b-256 checksum How to use checksums |
d55e46648c6fe8a4dcae05624655135a44f5b3b5a552ecf76ef3c24b4dca9d55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.15
|
Security for wrap-your-gym 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.