keraJLi / rejax

Apache License 2.0
150 stars 7 forks source link

[Bug] AttributeError: '...EnvParams' object has no attribute 'max_steps_in_episode' #9

Closed axelbr closed 5 months ago

axelbr commented 5 months ago

Some part of the code (evaluate.py, line 88), assume that the env params struct has a field max_steps_in_episode.

keraJLi commented 5 months ago

Hi @axelbr!

The field max_steps_in_episode is defined in the base class gymnax.environments.environment.EnvParams, and should therefore be defined in all Gymnax environments. I have thus considered it part of the standard Gymnax interface. If this leads to a bug with your code (e.g. you have defined EnvParams that don't inherit from this base class), a simple workaround would be to add the field to your struct (even if it does not do anything). Would that solve your issue?

axelbr commented 5 months ago

Thanks for the fast reply. Hm, this isn't documented in Gymnax anywhere, but you are right. I did not notice the type bounds for the generic.