Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation about ignored user input #120

Merged
merged 17 commits into from
Sep 5, 2024
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions docs/source/user_guide_pipeline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ Here's how to create a simple pipeline and propagate results from one component
pipe.add_component(ComponentAdd(), "a")
pipe.add_component(ComponentAdd(), "b")

pipe.connect("a", "b", {"number2": "a.result"})
asyncio.run(pipe.run({"a": {"number1": 10, "number2": 1}, "b": {"number1": 4}))
pipe.connect("a", "b", input_config={"number2": "a.result"})
asyncio.run(pipe.run({"a": {"number1": 10, "number2": 1}, "b": {"number1": 4}}))
# result: 10+1+4 = 15

1. First, a pipeline is created, and two components named "a" and "b" are added to it.
Expand All @@ -79,6 +79,20 @@ The data flow is illustrated in the diagram below:
Component "b" -> 15
4 -------------------------/

.. warning::
.. warning:: Cyclic graph

Cycles are not allowed in a Pipeline.


.. warning:: Ignored user inputs

If inputs are provided both by user in the `pipeline.run` method and as
`input_config` in a connect method, the user input will be ignored. Take for
instance the following pipeline, adapted from the previous one:

.. code:: python

pipe.connect("a", "b", input_config={"number2": "a.result"})
asyncio.run(pipe.run({"a": {"number1": 10, "number2": 1}, "b": {"number1": 4, "number2": 42}}))

The result will still be **15** because the user input `"number2": 42` is ignored.