Commit a757802c authored by Eva Schiffer's avatar Eva Schiffer
Browse files

adding option to turn off lon/lat matching in the config file

parent 4dbb4011
......@@ -41,6 +41,12 @@ settings[constants.DO_TEST_PASSFAIL_KEY] = False
# warnings on the command line and when doing pass/fail testing they will be considered
# failing variables and will be reported on any report pages that you generate
settings[constants.WARN_MISSING_KEY] = True
# should we avoid trying to match lon/lat to our data?
# when you set this to True, it WILL NOT attempt to load or match lon/lat data
# when you set this to False, it WILL attempt to load or match lon/lat data
# by default Glance will try to load lon/lat data if you do not include this entry
# in the settings dictionary
settings[constants.USE_NO_LON_OR_LAT_VARS_KEY] = False
# the names of the latitude and longitude variables that will be used
lat_lon_info = {}
......
......@@ -397,7 +397,7 @@ _STOMPABLE_OPTIONS = {
DO_MAKE_FORKS_KEY: False,
DO_TEST_PASSFAIL_KEY: True,
WARN_MISSING_KEY: False,
# TODO add nolonlat to this
USE_NO_LON_OR_LAT_VARS_KEY: False,
}
def _warn_for_stomped_commandline_options(optionSet) :
"""
......@@ -425,8 +425,6 @@ def load_config_or_options(aPath, bPath, optionsSet, requestedVars = [ ]) :
# basic defaults for stuff we will need to return
runInfo = {}
runInfo.update(glance_setting_defaults) # get the default settings
if (USE_NO_LON_OR_LAT_VARS_KEY not in optionsSet) or (not optionsSet[USE_NO_LON_OR_LAT_VARS_KEY]):
runInfo.update(glance_lon_lat_defaults) # get the default lon/lat info
# by default, we don't have any particular variables to analyze
desiredVariables = { }
......@@ -482,16 +480,19 @@ def load_config_or_options(aPath, bPath, optionsSet, requestedVars = [ ]) :
#glanceRunConfig = imp.load_module(fileBaseName, open(requestedConfigFile, 'U'),
# requestedConfigFile, ('.py' , 'U', 1))
# update our lon lat settings with the defaults if we're using lon/lat
if (USE_NO_LON_OR_LAT_VARS_KEY not in glanceRunConfig.settings) or (not glanceRunConfig.settings[USE_NO_LON_OR_LAT_VARS_KEY]):
runInfo.update(glance_lon_lat_defaults) # get the default lon/lat info
# this is an exception, since these are not advertised to the user as being available in the config
# we don't expect them to be in the file (at least not at the moment, these could be added to the docs
# later and if the user did happen to put any of them in the config file, it would override the command
# line derived value that we set here)
runInfo[DO_MAKE_REPORT_KEY] = not optionsSet[OPTIONS_NO_REPORT_KEY] if OPTIONS_NO_REPORT_KEY in optionsSet else False
runInfo[USE_NO_LON_OR_LAT_VARS_KEY] = optionsSet[USE_NO_LON_OR_LAT_VARS_KEY] if USE_NO_LON_OR_LAT_VARS_KEY in optionsSet else False
# get everything from the config file
runInfo.update(glanceRunConfig.settings)
if (USE_NO_LON_OR_LAT_VARS_KEY not in runInfo) or (not runInfo[USE_NO_LON_OR_LAT_VARS_KEY]) :
if not runInfo[USE_NO_LON_OR_LAT_VARS_KEY] :
runInfo.update(glanceRunConfig.lat_lon_info) # get info on the lat/lon variables
# get any requested names
......@@ -506,7 +507,11 @@ def load_config_or_options(aPath, bPath, optionsSet, requestedVars = [ ]) :
if not usedConfigFile:
LOG.info ('Using Command Line Settings')
# update our runInfo with the lon/lat defaults if appropriate
if (USE_NO_LON_OR_LAT_VARS_KEY not in optionsSet) or (not optionsSet[USE_NO_LON_OR_LAT_VARS_KEY]):
runInfo.update(glance_lon_lat_defaults) # get the default lon/lat info
# so get everything from the options directly
runInfo[DO_MAKE_REPORT_KEY] = not optionsSet[OPTIONS_NO_REPORT_KEY]
runInfo[DO_MAKE_IMAGES_KEY] = not optionsSet[OPTIONS_NO_IMAGES_KEY]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment