Skip to content

Commit

Permalink
Cleanup docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
markheik committed Aug 22, 2024
1 parent d158950 commit aef0dd9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 52 deletions.
13 changes: 13 additions & 0 deletions src/laboneq_applications/workflow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
"""A sub-package for creating workflows.
This package provides tools and building blocks to define workflows.
# Summary
Workflow is a collection of tasks and other constructs.
To determine and control the execution of an workflow, the tasks
and other constructs do not behave normally within it and a specific
domain specific language (DSL) must be used.
To achieve this behavior, workflow first runs through the code
to build a dependency graph of tasks and constructs used in it. The actual code
within the tasks is not yet executed.
For this reason, regular Python expressions cannot be used within the workflow
and it is recommended to use tasks for any complex logic.
"""

from laboneq_applications.workflow.engine import (
Expand Down
53 changes: 1 addition & 52 deletions src/laboneq_applications/workflow/engine/__init__.py
Original file line number Diff line number Diff line change
@@ -1,55 +1,4 @@
"""Workflow engine for task execution.
# Summary
Workflow is a collection of tasks and other constructs.
To determite and control the execution of the workflow, the tasks
and other constructs do not behave normally within it and a specific
domain specific language (DSL) must be used.
To achieve this behaviour, workflow first runs through the code
to build a dependency graph of tasks and constructs used in it. The actual code
within the tasks is not yet executed.
For this reason, some of the Python expressions cannot be used within the workflow
and it is recommended to use tasks for any complex logic.
## Workflow constructs
* `if_`: Replaces Python's `if` clause
* `for_`: Replaces Python's `for` loop
## Example
### Building and running the workflow
```python
from laboneq.workflow import task, engine
@task
def my_task(x):
return x + 1
@engine.workflow
def my_workflow(x):
if engine.if_(x == 5):
my_task(x)
result = my_workflow(x=5)
```
### Inspecting the results
The results of all tasks are recorded and may be inspected later
using the result object returned by the workflow.
The result object, `WorkflowResult`, has a tasklog which records each task's execution:
```python
>>> result.tasklog["my_task"]
[6]
```
"""
"""Workflow engine objects."""

from laboneq_applications.workflow.engine.core import (
Workflow,
Expand Down

0 comments on commit aef0dd9

Please sign in to comment.