5 releases

0.0.8 May 17, 2025
0.0.7 Sep 1, 2024
0.0.6 Sep 19, 2023
0.0.5 Jan 25, 2022
0.0.4 Jul 18, 2021

#1614 in Machine learning

Download history 9/week @ 2025-02-05 2/week @ 2025-02-19 3/week @ 2025-02-26 128/week @ 2025-05-14 10/week @ 2025-05-21

138 downloads per month
Used in border-derive

MIT/Apache

210KB
3K SLoC

A wrapper of Gymnasium environments on Python.

GymEnv is a wrapper of Gymnasium based on PyO3. It has been tested on some of classic control and Gymnasium-Robotics environments.

In order to bridge Python and Rust, we need to convert Python objects to Rust objects and vice versa. This crate provides the GymEnvConverter trait to handle these conversions.

Type Conversion

The GymEnvConverter trait provides a unified interface for converting between Python and Rust types:

  • filt_obs: Converts Python observations to Rust types
  • filt_act: Converts Rust actions to Python types

Implementations

This crate provides several implementations of GymEnvConverter:

To use Candle or Tch converters, enable the corresponding feature in your Cargo.toml:

[dependencies]
border-py-gym-env = { version = "0.1.0", features = ["candle"] }  # For Candle support
# or
border-py-gym-env = { version = "0.1.0", features = ["tch"] }     # For Tch support

Each implementation supports different types of observations and actions:

  • Array observations (e.g., CartPole)
  • Dictionary observations (e.g., FetchPickAndPlace)
  • Discrete actions (e.g., CartPole)
  • Continuous actions (e.g., Pendulum)

Dependencies

~13–27MB
~343K SLoC