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

Tolerate NaNs in RWD Output #3606

Open
rajadain opened this issue Jan 16, 2024 · 0 comments
Open

Tolerate NaNs in RWD Output #3606

rajadain opened this issue Jan 16, 2024 · 0 comments

Comments

@rajadain
Copy link
Member

I noticed some errors in Staging. In case the cause of these was not apparent in the API responses, I took a look under the hood and it seems like the RWD generated output isn't being serialized to JSON. This is a sample output from RWD:

{
  "input_pt": {
    "geometry": {"coordinates": [-75.657663, 39.878647], "type": "Point"},
    "properties": {"ID": 1, "Lat": 39.878647, "Lon": -75.657663},
    "type": "Feature"
  },
  "watershed": {
    "geometry": {
      "coordinates": [
        [
          [-75.657667, 39.878704],
          [-75.657575, 39.878704],
          [-75.657575, 39.878611],
          [-75.657667, 39.878611],
          [-75.657667, 39.878704]
        ]
      ],
      "type": "Polygon"
    },
    "properties": {
      "Area": 0.000080855,
      "AvgOLF": 0,
      "Avgslp": 0.093968607485294,
      "BR": 0,
      "BasinLen": 0,
      "DrnDen": -405268.69086636574,
      "GRIDCODE": 1,
      "RR": NaN,
      "StrLen": -32.768,
      "Strord": -32768
    },
    "type": "Feature"
  }
}

The "RR": NaN is the problem, since NaNs are not allowed in JSON.

Make it so that NaNs are quoted in the output, to tolerate that break and send the rest to the user.

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

No branches or pull requests

1 participant