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

Repair wrappedJsonStringify, modify reformDefinitionCode #2178

Merged

Conversation

anth-volk
Copy link
Collaborator

Description

Fixes #2106.

Changes

Previously, we improperly handled advanced features of JSON.stringify() within wrappedJsonStringify, causing the Reproduce in Python page to treat Infinity as null. Further, we had no means of importing numpy in the Reproduce in Python output. This PR changes wrappedJsonStringify to properly handle more than two arguments to JSON.stringify() and modifies reformDefinitionCode to check if any baseline or reform values are infinite, at which point it adds a line to import numpy.

Screenshots

AwesomeScreenshot-10_31_2024.9_15_43PM.webm

Tests

The code output was tested within a local run of -us and appears to work correctly.

@anth-volk
Copy link
Collaborator Author

@nikhilwoodruff This is one of the two other issues I mentioned in the standup

@nikhilwoodruff nikhilwoodruff merged commit c2334ea into PolicyEngine:master Nov 4, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Properly display infinite values in "Reproduce in Python pages"
2 participants