Skip to content

Commit

Permalink
Allow registration overwrite in set_schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
frthjf committed Dec 17, 2020
1 parent e3f31f8 commit 5810cb6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/machinable/execution/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,15 @@ def set_seed(self, seed):

return self

def set_schedule(self, schedule=None):
def set_schedule(self, schedule=None, registration=None):
if schedule is not None:
self.schedule = schedule
return self

_set_registration = registration is not False
if _set_registration:
Registration.reset(registration or self.registration)

self.schedule = Schedule(seed=self.seed)

config = ConfigInterface(
Expand Down Expand Up @@ -288,6 +292,9 @@ def set_schedule(self, schedule=None):
resources=resources,
)

if _set_registration:
Registration.reset()

return self

def set_code_backup(self, enabled=None, exclude=None):
Expand Down Expand Up @@ -407,7 +414,7 @@ def submit(self):
is_submitted = self.is_submitted()
if not is_submitted:
if len(self.schedule) == 0:
self.set_schedule()
self.set_schedule(registration=False)

def set_derived_from_flag(i, component, element):
element[1]["flags"]["DERIVED_FROM_SUBMISSION"] = derived_from
Expand Down

0 comments on commit 5810cb6

Please sign in to comment.