# AUTOGENERATED! DO NOT EDIT! File to edit: function_to_config.ipynb (unless otherwise specified).

__all__ = ["add_one", "cfg_node_recorder", "add_one", "add_one_output", "config", "lookup", "pipeline"]

# Cell
import inspect

from roheboam.engine.pipeline import ConfigurationNodeRecorder, Pipeline
from roheboam.engine.pipeline.config_loader import replace_config_variables
from roheboam.engine.pipeline.yaml_loader import RoheboamYamlDumper, RoheboamYamlLoader, Variable


# Cell
def add_one(x):
    return x + 1


cfg_node_recorder = ConfigurationNodeRecorder()
add_one = cfg_node_recorder.record(add_one)
add_one_output = add_one(2)
assert add_one_output == 3

config = cfg_node_recorder.config
lookup = cfg_node_recorder.lookup

pipeline = Pipeline.create_from_config(config, lookup)
pipeline.run()
assert pipeline.get_node_output("add_one_0") == 3
