Open albertwilcox opened 3 months ago
Hey, thanks for the suggestion, I originally included the >1 as I thought you wouldn't need ==1 but your motivation is good counter-argument. If the tests work then I see no reason why we can't relax the assumption. Could you make a PR for this?
Proposal
Hi,
I propose that the framework is updated to allow frame stacks of size 1. This could be helpful for pipelines which might use frame stacks in some settings and omit them in others. By allowing frame stacks of size 1 the frame stack wrapper can be left in the code and automatically add the extra dimension for frame stacking.
To implement this, simply remove these lines: https://github.com/Farama-Foundation/Gymnasium/blob/a4f1a93dc19261049b352d45427c260ecab0f0a7/gymnasium/wrappers/stateful_observation.py#L377-L380
Previous versions of the gym wrapper supported this: https://github.com/openai/gym/blob/master/gym/wrappers/frame_stack.py
Motivation
As described above, this will enable cleaner code for several applications without causing any issues to existing ones. Also, this is consistent with previous versions of the gym frame stack wrapper.
Pitch
Just remove these lines or maybe assert stack-size > 0 instead
https://github.com/Farama-Foundation/Gymnasium/blob/main/gymnasium/wrappers/stateful_observation.py#L377-L380
Alternatives
No response
Additional context
No response
Checklist