M3Works / metloom

Location Oriented Observed Meteorology
Other
16 stars 4 forks source link

MesowestPointData.points_from_geometry does not consider zero stations being returned #34

Open micahjohnson150 opened 2 years ago

micahjohnson150 commented 2 years ago

Description

Using a small bounding box to grab mesowest stations and received an error

What I Did

Running this I receive this traceback

File "/home/user/envs/loomenv/lib/python3.9/site-packages/metloom/pointdata/mesowest.py", line 285, in points_from_geometry
  data = jdata['STATION']
KeyError: 'STATION'

It would appear mesowest doesn't consider receiving no stations back. The solution here is to return an empty list instead of trying to index on it.