-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
❓ Question
Hey SB3 team!
I was experimenting the last days with rewriting my working custom python environment in rust and exposing it to python via pyo3 and maturin.
Doing so I came about a couple of issues, most of them I could solve. However, I needed to disable one or two isintance(env,Env) checks within my local stable_baselines3 package, as inheritance from non built-ins seems not to be possible in pyo3 at the moment. I also could not find a solution to patch sb3 or "inject" the base type into my custom environment class imported from rust.
I therefore have two questions:
- Is there interest in this topic? Currently all i have is mixed into my own codebase, but i could produce a minimal standalone repository demonstrating how this would be feasible.
- Could you imagine a contribution that includes a mechanism to disables certain "safety checks" (such as the
isintance(env,Env)checks into which advanced users could opt in - allowing them to use environments that come from native code like C++ or rust?
Curious about your thoughts!
Remarks:
- I am aware, that I could just write a thin wrapper in python that capsules my rust environment, but it would just be nice if i wouldn't need that :-)
- For complicated environments, the observation and step function may also cost some computation/performance, so implementing them in native code seems to make sense.
- For applications where there already is a lot of rust code, defining the environment directly in rust would kinda feel natural to me.
Finally a random screenshot to hopefully ignite some curiosity ;-)
Checklist
- I have checked that there is no similar issue in the repo
- I have read the documentation
- If code there is, it is minimal and working
- If code there is, it is formatted using the markdown code blocks for both code and stack traces.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested
