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

Generate code from pipeline (pipeline.to_code()) #2214

Merged
merged 26 commits into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6ee9ddc
pipeline.to_code() with jupyter support
tstadel Feb 16, 2022
5474997
Update Documentation & Code Style
github-actions[bot] Feb 16, 2022
4f3d739
add imports
tstadel Feb 16, 2022
fdd6bff
Merge branch 'pipeline_to_code' of github.com:deepset-ai/haystack int…
tstadel Feb 16, 2022
466dca4
refactoring
tstadel Feb 16, 2022
e02e05c
Update Documentation & Code Style
github-actions[bot] Feb 16, 2022
6ed77a0
docstrings added and refactoring
tstadel Feb 17, 2022
578c05a
Merge branch 'pipeline_to_code' of github.com:deepset-ai/haystack int…
tstadel Feb 17, 2022
0c33bc7
Update Documentation & Code Style
github-actions[bot] Feb 17, 2022
896616b
improve imports code generation
tstadel Feb 17, 2022
b27d73b
add comment param
tstadel Feb 17, 2022
f9fea7a
Update Documentation & Code Style
github-actions[bot] Feb 17, 2022
62d77a3
add simple test
tstadel Feb 18, 2022
cf2248f
add to_notebook_cell()
tstadel Feb 21, 2022
9763423
Update Documentation & Code Style
github-actions[bot] Feb 21, 2022
9751194
introduce helper classes for code gen and eval report gen
tstadel Feb 22, 2022
f20b402
add more tests
tstadel Feb 22, 2022
4f63666
Update Documentation & Code Style
github-actions[bot] Feb 22, 2022
2dfb7fe
Merge branch 'master' into pipeline_to_code
tstadel Feb 22, 2022
dec2f96
fix Dict typings
tstadel Feb 22, 2022
14c11fb
Update Documentation & Code Style
github-actions[bot] Feb 22, 2022
1fd94b9
validate user input before code gen
tstadel Feb 22, 2022
53abe8a
enable urls for to_code()
tstadel Feb 23, 2022
f356f92
Update Documentation & Code Style
github-actions[bot] Feb 23, 2022
278358e
remove all chars except colon from validation regex
tstadel Feb 23, 2022
2152060
Merge branch 'master' into pipeline_to_code
tstadel Feb 23, 2022
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
38 changes: 38 additions & 0 deletions docs/_src/api/api/pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,44 @@ Returns a configuration for the Pipeline that can be used with `BasePipeline.loa

- `return_defaults`: whether to output parameters that have the default values.

<a id="base.BasePipeline.to_code"></a>

#### to\_code

```python
def to_code(pipeline_variable_name: str = "pipeline", generate_imports: bool = True, add_comment: bool = False) -> str
```

Returns the code to create this pipeline as string.

**Arguments**:

- `pipeline_variable_name`: The variable name of the generated pipeline.
Default value is 'pipeline'.
- `generate_imports`: Whether to include the required import statements into the code.
Default value is True.
- `add_comment`: Whether to add a preceding comment that this code has been generated.
Default value is False.

<a id="base.BasePipeline.to_notebook_cell"></a>

#### to\_notebook\_cell

```python
def to_notebook_cell(pipeline_variable_name: str = "pipeline", generate_imports: bool = True, add_comment: bool = True)
```

Creates a new notebook cell with the code to create this pipeline.

**Arguments**:

- `pipeline_variable_name`: The variable name of the generated pipeline.
Default value is 'pipeline'.
- `generate_imports`: Whether to include the required import statements into the code.
Default value is True.
- `add_comment`: Whether to add a preceding comment that this code has been generated.
Default value is True.

<a id="base.BasePipeline.load_from_config"></a>

#### load\_from\_config
Expand Down
Loading