Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling NaN/Inf in JSON Output #969

Merged
merged 2 commits into from
Nov 16, 2022
Merged

Handling NaN/Inf in JSON Output #969

merged 2 commits into from
Nov 16, 2022

Conversation

mondus
Copy link
Member

@mondus mondus commented Nov 10, 2022

Closes #762

Uses RapidJSONs write and parse flags to relax the JSON standard and output nan and inf type values. Not technically part of the JSON spec but this is the way in which RapidJSON deals with it. Alternative would be two write nan and inf as 0 but this would prevent fully serializing and loading a model.

Requires changes to and test for;

  • State agent variables
  • State Environment Variables
  • Logging: Wont implement (see below)

NOTE: Testing json log outputs is very involved and requires writing a new JSON parser so it wont be done as part of this fix. Currently non out of logging tests test the actual file contents. A new issue (#970 ) for loading logs from JSON in log objects has been opened as a future feature than would then permit this to be tested.

@mondus mondus self-assigned this Nov 10, 2022
@mondus mondus marked this pull request as ready for review November 10, 2022 16:08
@mondus mondus requested a review from Robadob November 10, 2022 17:57
Copy link
Member

@Robadob Robadob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look as I would expect, haven't tested it though.

@ptheywood
Copy link
Member

This should include a change to the docblocks / documentation statign that output JSON is RapdiJson's "relaxed" and can include nan etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handling NaN/Inf in JSON Output
3 participants