[python #DCS-251943]: MetPy time series plots
- Subject: [python #DCS-251943]: MetPy time series plots
- Date: Wed, 28 Oct 2020 15:19:50 -0600
We appreciate the feedback. We really want that code map to be able to handle
everything and so I consider it a bug that it fails for that--but I do think
it's valuable that it fails since that led you to let us know it's broken. :)
Fortunately, you can already get the behavior you're looking for. `wx_code_map`
is a regular python dictionary, so you can us it's built-in `get` method:
wxcode_num = wx_code_map.get(wxcodes.split(), 0)
Hope this helps,
> One last thing about MetPy . . .
> If a bad weather code is fed to your 'wx_code_map' method, it crashes.
> Traceback (most recent call last):
> File "./ASOS_plot_data_for_archive_hourly_ISU.py", line 437, in <module>
> File "./ASOS_plot_data_for_archive_hourly_ISU.py", line 375, in
> wxcode_num = wx_code_map[wxcodes.split()]
> KeyError: '-FZRAGR'
> Might be nice to have a more graceful exit (like returning 0) when that
Ticket ID: DCS-251943
Department: Support Python
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata
inquiry tracking system and then made publicly available through the web. If
you do not want to have your interactions made available in this way, you must
let us know in each email you send to us.