stable-baselines3 icon indicating copy to clipboard operation
stable-baselines3 copied to clipboard

Logger values have only a single type, and if no type is recognized, …

Open manuel-delverme opened this issue 3 years ago • 1 comments

…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-codestyle and make lint (required)
  • [ ] I have ensured make pytest and make type both 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

manuel-delverme avatar Feb 14 '22 20:02 manuel-delverme

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)

araffin avatar Feb 23 '22 10:02 araffin