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

NaNs are not standardized when serializing wave to json #57

Open
t-b opened this issue Apr 18, 2024 · 0 comments
Open

NaNs are not standardized when serializing wave to json #57

t-b opened this issue Apr 18, 2024 · 0 comments
Labels

Comments

@t-b
Copy link
Collaborator

t-b commented Apr 18, 2024

The attached zip has two ibn waves. One with standard NaNs and one with NaNs from CurveFit.

These give different results when serialized:

•print zeromq_test_serializeWave(normalNaN)
  {
    "data": {
        "raw": [
            "nan",
            "nan"
        ]
    },
...
•print zeromq_test_serializeWave(strangeNaN)
  {
    "data": {
        "raw": [
            "-nan(ind)",
            "-nan(ind)"
        ]
    },
...

The "strange" NaN can be created with

•make/D xData = {1, 1}
•make/D yData = {10, 10}
•CurveFit line yData/X=xData 
  y= W_coef[0]+W_coef[1]*x
  W_coef={NaN,NaN}
  V_chisq= NaN;V_npnts= 2;V_numNaNs= 0;V_numINFs= 0;V_startRow= 0;
  V_endRow= 1;V_q= 1;V_Rab= NaN;V_Pr= NaN;V_r2= NaN;
  W_sigma={NaN,NaN}
  Coefficient values ± one standard deviation
  	a	= NaN ± NaN
  	b	= NaN ± NaN
•print zeromq_test_serializeWave(w_coef)

I think we should always standardize the output to nan. Check also the same for inf.

someNaNs.zip

@t-b t-b added the bug label Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant