added files missed from last commit
This commit is contained in:
@ -283,7 +283,6 @@ class WatchdogMonitor(BaseMonitor):
|
|||||||
created from that pattern will be automatically updated."""
|
created from that pattern will be automatically updated."""
|
||||||
check_type(pattern, FileEventPattern)
|
check_type(pattern, FileEventPattern)
|
||||||
self.remove_pattern(pattern.name)
|
self.remove_pattern(pattern.name)
|
||||||
print(f"adding pattern w/ recipe {pattern.recipe}")
|
|
||||||
self.add_pattern(pattern)
|
self.add_pattern(pattern)
|
||||||
|
|
||||||
def remove_pattern(self, pattern: Union[str,FileEventPattern])->None:
|
def remove_pattern(self, pattern: Union[str,FileEventPattern])->None:
|
||||||
|
@ -5,6 +5,7 @@ along with an appropriate handler for said events.
|
|||||||
|
|
||||||
Author(s): David Marchant
|
Author(s): David Marchant
|
||||||
"""
|
"""
|
||||||
|
import itertools
|
||||||
import nbformat
|
import nbformat
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@ -103,16 +104,21 @@ class PapermillHandler(BaseHandler):
|
|||||||
self.setup_job(event, yaml_dict)
|
self.setup_job(event, yaml_dict)
|
||||||
else:
|
else:
|
||||||
# If parameter sweeps, then many jobs created
|
# If parameter sweeps, then many jobs created
|
||||||
|
values_dict = {}
|
||||||
for var, val in rule.pattern.sweep.items():
|
for var, val in rule.pattern.sweep.items():
|
||||||
values = []
|
values_dict[var] = []
|
||||||
par_val = rule.pattern.sweep[SWEEP_START]
|
par_val = val[SWEEP_START]
|
||||||
while par_val <= rule.pattern.sweep[SWEEP_STOP]:
|
while par_val <= val[SWEEP_STOP]:
|
||||||
values.append(par_val)
|
values_dict[var].append((var, par_val))
|
||||||
par_val += rule.pattern.sweep[SWEEP_JUMP]
|
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:
|
for value in values:
|
||||||
yaml_dict[var] = value
|
yaml_dict[value[0]] = value[1]
|
||||||
self.setup_job(event, yaml_dict)
|
self.setup_job(event, yaml_dict)
|
||||||
|
|
||||||
def valid_event_types(self)->list[str]:
|
def valid_event_types(self)->list[str]:
|
||||||
"""Function to provide a list of the types of events this handler can
|
"""Function to provide a list of the types of events this handler can
|
||||||
|
Reference in New Issue
Block a user