Skip to content

Commit

Permalink
warning descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrichman committed Nov 27, 2016
1 parent df37ad7 commit 061b1d5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tawhiri/warnings.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,19 @@ cdef class WarningCounts:

def to_dict(self):
res = \
{ "altitude_too_low": self.altitude_too_low
, "altitude_too_high": self.altitude_too_high
{ "altitude_too_low":
{ "count": self.altitude_too_low
, "description": "The altitude went too low: wind data may be unreliable"
}
, "altitude_too_high":
{ "count": self.altitude_too_high
, "description": "The altitude went too high, above the max forecast wind. \
Wind data will be unreliable"
}
}

for key in list(res.keys()):
if res[key] == 0:
if res[key]["count"] == 0:
del res[key]

return res

0 comments on commit 061b1d5

Please sign in to comment.