differentiated papermill and python jobs more clearly
This commit is contained in:
@ -1,2 +1,3 @@
|
||||
|
||||
from rules.file_event_jupyter_notebook_rule import FileEventJupyterNotebookRule
|
||||
from rules.file_event_python_rule import FileEventPythonRule
|
30
rules/file_event_python_rule.py
Normal file
30
rules/file_event_python_rule.py
Normal file
@ -0,0 +1,30 @@
|
||||
|
||||
"""
|
||||
This file contains definitions for a MEOW rule connecting the FileEventPattern
|
||||
and PythonRecipe.
|
||||
|
||||
Author(s): David Marchant
|
||||
"""
|
||||
from core.correctness.validation import check_type
|
||||
from core.meow import BaseRule
|
||||
from patterns.file_event_pattern import FileEventPattern
|
||||
from recipes.python_recipe import PythonRecipe
|
||||
|
||||
# TODO potentailly remove this and just invoke BaseRule directly, as does not
|
||||
# add any functionality other than some validation.
|
||||
class FileEventPythonRule(BaseRule):
|
||||
pattern_type = "FileEventPattern"
|
||||
recipe_type = "PythonRecipe"
|
||||
def __init__(self, name: str, pattern:FileEventPattern,
|
||||
recipe:PythonRecipe):
|
||||
super().__init__(name, pattern, recipe)
|
||||
|
||||
def _is_valid_pattern(self, pattern:FileEventPattern)->None:
|
||||
"""Validation check for 'pattern' variable from main constructor. Is
|
||||
automatically called during initialisation."""
|
||||
check_type(pattern, FileEventPattern)
|
||||
|
||||
def _is_valid_recipe(self, recipe:PythonRecipe)->None:
|
||||
"""Validation check for 'recipe' variable from main constructor. Is
|
||||
automatically called during initialisation."""
|
||||
check_type(recipe, PythonRecipe)
|
Reference in New Issue
Block a user