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.
Description
Fixes #2106.
Changes
Previously, we improperly handled advanced features of
JSON.stringify()
withinwrappedJsonStringify
, causing the Reproduce in Python page to treatInfinity
asnull
. Further, we had no means of importingnumpy
in the Reproduce in Python output. This PR changeswrappedJsonStringify
to properly handle more than two arguments toJSON.stringify()
and modifiesreformDefinitionCode
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.