Skip to content

Commit

Permalink
add support to run_missing_simulations
Browse files Browse the repository at this point in the history
  • Loading branch information
Thecave3 committed Apr 25, 2023
1 parent 8dffbc9 commit f9e9329
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sem/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@ def run_simulations(self, param_list, show_progress=True, callbacks: list = [],
can be either a string or a number).
show_progress (bool): whether or not to show a progress bar with
percentage and expected remaining time.
callbacks (list): list of objects extending CallbackBase to be
triggered during the run.
stop_on_errors (bool): whether or not to stop the execution of the simulations
if an error occurs.
"""

# Make sure we have a runner to run simulations with.
Expand Down Expand Up @@ -452,6 +456,7 @@ def get_missing_simulations(self, param_list, runs=None, with_time_estimate=Fals

def run_missing_simulations(self, param_list, runs=None,
condition_checking_function=None,
callbacks=[],
stop_on_errors=True):
"""
Run the simulations from the parameter list that are not yet available
Expand All @@ -471,6 +476,10 @@ def run_missing_simulations(self, param_list, runs=None,
runs (int): the number of runs to perform for each parameter
combination. This parameter is only allowed if the param_list
specification doesn't feature an 'RngRun' key already.
callbacks (list): list of objects extending CallbackBase to be
triggered during the run.
stop_on_errors (bool): whether or not to stop the execution of the simulations
if an error occurs.
"""
# Expand the parameter specification
param_list = list_param_combinations(param_list)
Expand Down Expand Up @@ -504,10 +513,12 @@ def run_missing_simulations(self, param_list, runs=None,
self.get_missing_simulations(param_list,
runs,
with_time_estimate=True),
callbacks=callbacks,
stop_on_errors=stop_on_errors)
else:
self.run_simulations(
self.get_missing_simulations(param_list, runs),
callbacks=callbacks,
stop_on_errors=stop_on_errors)

#####################
Expand Down

0 comments on commit f9e9329

Please sign in to comment.