Skip to content

Commit

Permalink
rmc
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian-Belkner committed Jul 1, 2023
2 parents 8390de1 + 488d68b commit 19cffd5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
22 changes: 14 additions & 8 deletions delensalot/config/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class config_handler():
"""

def __init__(self, parser, config_model=None):
sorted_joblist = ['generate_sim', 'QE_lensrec', 'MAP_lensrec', 'OBD_builder']
if config_model is None:
self.configfile = config_handler.load_configfile(parser.config_file, 'configfile')
else:
Expand All @@ -47,7 +48,15 @@ def __init__(self, parser, config_model=None):
if parser.job_id is None:
pass
else:
self.configfile.dlensalot_model.job.__dict__.update({'jobs': [parser.job_id]})
self.configfile.dlensalot_model.job.jobs = []
if parser.job_id != "":
for sortedjob in sorted_joblist:
if sortedjob == parser.job_id:
self.configfile.dlensalot_model.job.jobs.append(sortedjob)
break
else:
self.configfile.dlensalot_model.job.jobs.append(sortedjob)
print(self.configfile.dlensalot_model.job.jobs)
TEMP = transform(self.configfile.dlensalot_model, l2T_Transformer())
if parser.status == '':
if mpi.rank == 0:
Expand Down Expand Up @@ -82,13 +91,10 @@ def collect_models(self, djob_id=''):
Args:
job_id (str, optional): A specific job which should be performed. This one is not necessarily defined in the configuration file. It is handed over via command line or in interactive mode. Defaults to ''.
"""
# TODO to remove job-dependencies: create a list of jobs up to the requested job.
if isinstance(djob_id, str):
if djob_id != "":
self.configfile.dlensalot_model.job.jobs.append(djob_id)
self.djob_ids = self.configfile.dlensalot_model.job.jobs
self.djobmodels = []
for job_id in self.djob_ids:
print(self.configfile.dlensalot_model.job.jobs)
print('-------------------')
for job_id in self.configfile.dlensalot_model.job.jobs:
self.djobmodels.append(transform3d(self.configfile.dlensalot_model, job_id, l2delensalotjob_Transformer()))
return self.djobmodels

Expand All @@ -101,7 +107,7 @@ def run(self):
Args:
job_choice (list, optional): A specific job which should be performed. This one is not necessarily defined in the configuration file. It is handed over via command line or in interactive mode. Defaults to [].
"""
"""
for job in self.djobmodels:
job.collect_jobs()
job.run()
Expand Down
2 changes: 1 addition & 1 deletion delensalot/core/mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def check_MPI_inline():

def isinstalled():
# For illustrative purposes.
name = 'MPI'
name = 'mpi4py'

if name in sys.modules:
print(f"{name!r} already in sys.modules")
Expand Down

0 comments on commit 19cffd5

Please sign in to comment.