azavea / temperate

Climate app developed in partnership with ICLEI
Apache License 2.0
0 stars 0 forks source link

Concern value for "max_high_temperature" is NaN for Saipan #1137

Closed maurizi closed 6 years ago

maurizi commented 6 years ago

Error was reported via Rollbar: https://rollbar.com/Azavea/ClimateChange/items/154/

Investigation of the Rollbar raw stacktrace shows that the "max_high_temperature" being calculated as NaN, which can't be serialized to JSON.

We should 1) add more robust error handling so that NaN values do not cause an uncaught 500 error and 2) investigate why the NaN value is being calculated in the first place.

CloudNiner commented 6 years ago

Does this occur when making API requests where dataset=LOCA? Or is it not dataset specific?

maurizi commented 6 years ago

Does this occur when making API requests where dataset=LOCA? Or is it not dataset specific?

Aha! Concern calculations are hardcoded to always use LOCA for the dataset: https://github.com/azavea/temperate/blob/a72225c08bd01b0be668b345aa32634d380da90d/src/django/planit_data/models.py#L311-L324