Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jasonmhite/59870a929fac44a925bd5608d6adb465 to your computer and use it in GitHub Desktop.
Save jasonmhite/59870a929fac44a925bd5608d6adb465 to your computer and use it in GitHub Desktop.
Convention for kedro pipelines; pretend dashes are / in the file names for folder structure
"""
This is the pipeline `do_stuff`
generated using kedro <blah>
"""
from .pipeline_do_stuff import create_pipeline
__all__ = ["create_pipeline"]
__version__ = "0.1"
"""
This is the pipeline `do_stuff`
generated using kedro <blah>
"""
from kedro.pipeline import Pipeline, pipeline
from utils import make_node
def create_pipeline(**kwargs) -> Pipeline:
return pipeline([
add_one,
divide_by_two
])
##### nodes #####
@make_node(name="add_one", inputs="x", outputs="y")
def add_one(x):
return x + 1
@make_node(name="divide_by_two", inputs="y", outputs="z")
def divide_by_two(y):
return y / 2.
from .node_decorator import make_node
from kedro.pipeline import node
def make_node(**kwargs):
return lambda func: node(func=func, **kwargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment