Remove default override for desired_data
authorAlexander Vasarab <alexander@wylark.com>
Thu, 2 Jul 2020 19:28:48 +0000 (12:28 -0700)
committerAlexander Vasarab <alexander@wylark.com>
Thu, 2 Jul 2020 19:28:48 +0000 (12:28 -0700)
We shouldn't be overriding anything implicitly, simply error out and
inform the user, and let them deal with it.

infoex-autowx.py

index 823885c025df8df25af9644c63f7b8055275eb20..a16b7e61e16947bf72a783c745ea81dbf59059c6 100755 (executable)
@@ -88,16 +88,7 @@ def setup_config(config):
         if station['provider'] == 'nrcs':
             station['source'] = 'https://www.wcc.nrcs.usda.gov/awdbWebService/services?WSDL'
             station['station_id'] = config['station']['station_id']
-
-            try:
-                station['desired_data'] = config['station']['desired_data'].split(',')
-            except:
-                # desired_data malformed or missing, setting default
-                station['desired_data'] = [
-                                       'TOBS', # AIR TEMPERATURE OBSERVED (degF)
-                                       'SNWD', # SNOW DEPTH (in)
-                                       'PREC'  # PRECIPITATION ACCUMULATION (in)
-                                       ]
+            station['desired_data'] = config['station']['desired_data'].split(',')
 
             # XXX: For NRCS, we're manually overriding units for now! Once
             #      unit conversion is supported for NRCS, REMOVE THIS!
@@ -108,12 +99,7 @@ def setup_config(config):
             station['source'] = 'https://api.synopticdata.com/v2/stations/timeseries'
             station['station_id'] = config['station']['station_id']
             station['units'] = config['station']['units']
-
-            try:
-                station['desired_data'] = config['station']['desired_data']
-            except:
-                # desired_data malformed or missing, setting default
-                station['desired_data'] = 'air_temp,snow_depth'
+            station['desired_data'] = config['station']['desired_data']
 
             # construct full API URL (sans start/end time, added later)
             station['source'] = station['source'] + '?token=' + config['station']['token'] + '&within=60&units=' + station['units'] + '&stid=' + station['station_id'] + '&vars=' + station['desired_data']