Created
April 27, 2023 13:22
-
-
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This is the pipeline `do_stuff` | |
generated using kedro <blah> | |
""" | |
from .pipeline_do_stuff import create_pipeline | |
__all__ = ["create_pipeline"] | |
__version__ = "0.1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from .node_decorator import make_node |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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