Skip to content
Snippets Groups Projects
Commit 29c0284f authored by Karl-Hermann Wieners's avatar Karl-Hermann Wieners
Browse files

Clarified comments in mkexp's module expconfig.

parent 6a5368a1
No related branches found
No related tags found
No related merge requests found
......@@ -42,10 +42,14 @@ class ExpConfig(ConfigObj):
TODO: probably nicer if default experiment is given as argument
'''
#
# Helper functions
#
def split_jobs(config):
'''Post-process job definition to allow for shared configs as [[job1, job2]]'''
if 'jobs' in config:
sep = re.compile(r'\s*,\s')
sep = re.compile(r'\s*,\s*')
for subjobs, subconfig in config['jobs'].iteritems():
if re.search(sep, subjobs):
for subjob in re.split(sep, subjobs):
......@@ -55,13 +59,19 @@ class ExpConfig(ConfigObj):
config['jobs'][subjob] = subconfig.dict()
del config['jobs'][subjobs]
#
# Method body
#
# Pre-read basic experiment settings
pre_config = ConfigObj(experiment_config_name, interpolation=False)
experiment_type = extra_dict.get('EXP_TYPE', pre_config['EXP_TYPE'])
environment = extra_dict.get('ENVIRONMENT',
pre_config.get('ENVIRONMENT',
'local'))
# Backwards compatibility
# Backwards compatibility ENVIRONMENT -> QUEUE_TYPE
if environment == 'local' and 'QUEUE_TYPE' in pre_config:
feedback.warning("found obsolete keyword 'QUEUE_TYPE'; "
"should be replaced by 'ENVIRONMENT'")
......@@ -70,10 +80,12 @@ class ExpConfig(ConfigObj):
pre_config = None
# Start from empty configuration
pre_config = ConfigObj(interpolation=False)
config_versions = []
# Read Environment
env_dict = dict(os.environ)
# Mask literal dollar characters
for key, value in env_dict.iteritems():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment