stable-baselines3
stable-baselines3 copied to clipboard
Logger values have only a single type, and if no type is recognized, …
…the user is warned rather than silently ignored.
Description
Right now logged values can be silently ignored or logged as two different types (unlikely).
Motivation and Context
I keep losing data when forgetting to cast values as
Something like: scalar_value = float(scalar_value) would be great but changes the functionality too much, this PR adds a warning rather than silently fail to avoid people making the same mistake.
side effect is to remove the possibility of a value being of several types
- [ ] I have raised an issue to propose this change (required for new features and bug fixes)
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation (update in the documentation)
Checklist:
- [ ] I've read the CONTRIBUTION guide (required)
- [ ] I have updated the changelog accordingly (required).
- [ ] My change requires a change to the documentation.
- [ ] I have updated the tests accordingly (required for a bug fix or a new feature).
- [ ] I have updated the documentation accordingly.
- [ ] I have reformatted the code using
make format(required) - [ ] I have checked the codestyle using
make check-codestyleandmake lint(required) - [ ] I have ensured
make pytestandmake typeboth pass. (required) - [ ] I have checked that the documentation builds using
make doc(required)
Note: You can run most of the checks using make commit-checks.
Note: we are using a maximum length of 127 characters per line
Hello,
what were you trying to log? (a minimal code to reproduce the issue would be appreciated ;))
PS: Please open an issue first next time (as mentioned in our contribution guide and PR template)