I see 2 issues with the ObservationStackingFilter object.
The current implementation checks that the input is less than 0, then checks that the input is a number. But if it's not a number, the checks that it is a number will never run. So when this check needs to be failed, the code has already failed earlier on, making it pointless.
Swapping the order fixes this. This should also be a TypeError, not a ValueError.
Secondly, there is no valid case for stacking 0 or 1 frames, so the code should assert >= 2, not >0
I see 2 issues with the ObservationStackingFilter object.
The current implementation checks that the input is less than 0, then checks that the input is a number. But if it's not a number, the checks that it is a number will never run. So when this check needs to be failed, the code has already failed earlier on, making it pointless.
Swapping the order fixes this. This should also be a TypeError, not a ValueError.
Secondly, there is no valid case for stacking 0 or 1 frames, so the code should assert >= 2, not >0