added files missed from last commit

This commit is contained in:
PatchOfScotland
2023-01-31 17:18:03 +01:00
parent 64452e3f03
commit bb7c4af1e5
2 changed files with 13 additions and 8 deletions

View File

@ -283,7 +283,6 @@ class WatchdogMonitor(BaseMonitor):
created from that pattern will be automatically updated."""
check_type(pattern, FileEventPattern)
self.remove_pattern(pattern.name)
print(f"adding pattern w/ recipe {pattern.recipe}")
self.add_pattern(pattern)
def remove_pattern(self, pattern: Union[str,FileEventPattern])->None:

View File

@ -5,6 +5,7 @@ along with an appropriate handler for said events.
Author(s): David Marchant
"""
import itertools
import nbformat
import sys
@ -103,15 +104,20 @@ class PapermillHandler(BaseHandler):
self.setup_job(event, yaml_dict)
else:
# If parameter sweeps, then many jobs created
values_dict = {}
for var, val in rule.pattern.sweep.items():
values = []
par_val = rule.pattern.sweep[SWEEP_START]
while par_val <= rule.pattern.sweep[SWEEP_STOP]:
values.append(par_val)
par_val += rule.pattern.sweep[SWEEP_JUMP]
values_dict[var] = []
par_val = val[SWEEP_START]
while par_val <= val[SWEEP_STOP]:
values_dict[var].append((var, par_val))
par_val += val[SWEEP_JUMP]
# combine all combinations of sweep values
values_list = list(itertools.product(
*[v for v in values_dict.values()]))
for values in values_list:
for value in values:
yaml_dict[var] = value
yaml_dict[value[0]] = value[1]
self.setup_job(event, yaml_dict)
def valid_event_types(self)->list[str]: