Skip to content

NaNs are not standardized when serializing wave to json #57

Description

@t-b

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions