Skip to content

Rename simple to arithmetic #70

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

Merged
merged 4 commits into from
Apr 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
papermill pyiron_base_qe.ipynb pyiron_base_qe_out.ipynb -k "python3"
papermill universal_workflow_qe.ipynb universal_workflow_qe_out.ipynb -k "python3"

simple:
arithmetic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -86,10 +86,10 @@ jobs:
- name: Tests
shell: bash -l {0}
run: |
papermill aiida_simple.ipynb aiida_simple_out.ipynb -k "python3"
papermill jobflow_simple.ipynb jobflow_simple_out.ipynb -k "python3"
papermill pyiron_base_simple.ipynb pyiron_base_simple_out.ipynb -k "python3"
papermill universal_workflow_simple.ipynb universal_workflow_simple_out.ipynb -k "python3"
papermill aiida_arithmetic.ipynb aiida_arithmetic_out.ipynb -k "python3"
papermill jobflow_arithmetic.ipynb jobflow_arithmetic_out.ipynb -k "python3"
papermill pyiron_base_arithmetic.ipynb pyiron_base_arithmetic_out.ipynb -k "python3"
papermill universal_workflow_arithmetic.ipynb universal_workflow_arithmetic_out.ipynb -k "python3"

book:
runs-on: ubuntu-latest
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ These two Python functions are combined in the following example workflow:
tmp_dict = get_prod_and_div(x=1, y=2)
result = get_sum(x=tmp_dict["prod"], y=tmp_dict["div"])
```
For the workflow representation of these Python functions the Python functions are stored in the [simple_workflow.py](simple_workflow.py)
Python module. The connection of the Python functions are stored in the [workflow_simple.json](workflow_simple.json)
For the workflow representation of these Python functions the Python functions are stored in the [arithmetic_workflow.py](arithmetic_workflow.py)
Python module. The connection of the Python functions are stored in the [workflow_arithmetic.json](workflow_arithmetic.json)
JSON file:
```
{
Expand Down Expand Up @@ -57,12 +57,12 @@ library.

The corresponding Jupyter notebooks demonstrate this functionality:

| Example | Explanation |
|--------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|
| [aiida_simple.ipynb](aiida_simple.ipynb) | Define Workflow with aiida and execute it with jobflow and pyiron_base. |
| [jobflow_simple.ipynb](jobflow_simple.ipynb) | Define Workflow with jobflow and execute it with aiida and pyiron_base. |
| [pyiron_base_simple.ipynb](pyiron_base_simple.ipynb) | Define Workflow with pyiron_base and execute it with aiida and jobflow. |
| [universal_workflow_simple.ipynb](universal_workflow_simple.ipynb) | Execute workflow defined in the Python Workflow Definition with aiida, executorlib, jobflow, pyiron_base and pure Python. |
| Example | Explanation |
|----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|
| [aiida_arithmetic.ipynb](aiida_arithmetic.ipynb) | Define Workflow with aiida and execute it with jobflow and pyiron_base. |
| [jobflow_arithmetic.ipynb](jobflow_arithmetic.ipynb) | Define Workflow with jobflow and execute it with aiida and pyiron_base. |
| [pyiron_base_arithmetic.ipynb](pyiron_base_arithmetic.ipynb) | Define Workflow with pyiron_base and execute it with aiida and jobflow. |
| [universal_workflow_arithmetic.ipynb](universal_workflow_arithmetic.ipynb) | Execute workflow defined in the Python Workflow Definition with aiida, executorlib, jobflow, pyiron_base and pure Python. |

### Quantum Espresso Workflow
The second workflow example is the calculation of an energy volume curve with Quantum Espresso. In the first step the
Expand Down
4 changes: 2 additions & 2 deletions aiida_simple.ipynb → aiida_arithmetic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
{
"cell_type": "code",
"source": [
"from simple_workflow import (\n",
"from arithmetic_workflow import (\n",
" get_sum as _get_sum,\n",
" get_prod_and_div as _get_prod_and_div,\n",
")"
Expand All @@ -56,7 +56,7 @@
},
{
"cell_type": "code",
"source": "wg = WorkGraph(\"wg-simple\")",
"source": "wg = WorkGraph(\"arithmetic\")",
"metadata": {
"trusted": true
},
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions book/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ format: jb-book
root: README
chapters:
- file: intro.md
- file: simple.md
- file: arithmetic.md
sections:
- file: aiida_simple.ipynb
- file: jobflow_simple.ipynb
- file: pyiron_base_simple.ipynb
- file: aiida_arithmetic.ipynb
- file: jobflow_arithmetic.ipynb
- file: pyiron_base_arithmetic.ipynb
- file: evcurve.md
sections:
- file: aiida_qe.ipynb
Expand Down
10 changes: 5 additions & 5 deletions book/simple.md → book/arithmetic.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Simple Workflow
# Arithmetic Workflow
As a first example we define two Python functions which add multiple inputs:
```python
def get_sum(x, y):
Expand All @@ -12,14 +12,14 @@ These two Python functions are combined in the following example workflow:
tmp_dict = get_prod_and_div(x=1, y=2)
result = get_sum(x=tmp_dict["prod"], y=tmp_dict["div"])
```
For the workflow representation of these Python functions the Python functions are stored in the [simple_workflow.py](simple_workflow.py)
Python module. The connection of the Python functions are stored in the [workflow_simple.json](workflow_simple.json)
For the workflow representation of these Python functions the Python functions are stored in the [arithmetic_workflow.py](arithmetic_workflow.py)
Python module. The connection of the Python functions are stored in the [workflow_arithmetic.json](workflow_arithmetic.json)
JSON file:
```
{
"nodes": [
{"id": 0, "function": "simple_workflow.get_prod_and_div"},
{"id": 1, "function": "simple_workflow.get_sum"},
{"id": 0, "function": "arithmetic_workflow.get_prod_and_div"},
{"id": 1, "function": "arithmetic_workflow.get_sum"},
{"id": 2, "value": 1},
{"id": 3, "value": 2}
],
Expand Down
2 changes: 1 addition & 1 deletion jobflow_simple.ipynb → jobflow_arithmetic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"id": "fb847d49-7bf9-4839-9b99-c116d1b0e9ee",
"cell_type": "code",
"source": [
"from simple_workflow import (\n",
"from arithmetic_workflow import (\n",
" get_sum as _get_sum,\n",
" get_prod_and_div as _get_prod_and_div,\n",
")"
Expand Down
4 changes: 2 additions & 2 deletions pyiron_base_simple.ipynb → pyiron_base_arithmetic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"id": "fb847d49-7bf9-4839-9b99-c116d1b0e9ee",
"cell_type": "code",
"source": [
"from simple_workflow import (\n",
"from arithmetic_workflow import (\n",
" get_sum as _get_sum,\n",
" get_prod_and_div as _get_prod_and_div,\n",
")"
Expand All @@ -71,7 +71,7 @@
{
"id": "8f95244e",
"cell_type": "code",
"source": "workflow_json_filename = \"pyiron_base_simple.json\"",
"source": "workflow_json_filename = \"pyiron_arithmetic.json\"",
"metadata": {
"trusted": true
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
{
"cell_type": "code",
"source": "plot(file_name='workflow_simple.json')",
"source": "plot(file_name='workflow_arithmetic.json')",
"metadata": {
"trusted": true
},
Expand Down Expand Up @@ -83,7 +83,7 @@
},
{
"cell_type": "code",
"source": "workgraph = load_workflow_json(file_name='workflow_simple.json')",
"source": "workgraph = load_workflow_json(file_name='workflow_arithmetic.json')",
"metadata": {
"trusted": true
},
Expand Down Expand Up @@ -153,7 +153,7 @@
},
{
"cell_type": "code",
"source": "with SingleNodeExecutor(max_workers=1) as exe:\n result = load_workflow_json(file_name=\"workflow_simple.json\", exe=exe).result()",
"source": "with SingleNodeExecutor(max_workers=1) as exe:\n result = load_workflow_json(file_name=\"workflow_arithmetic.json\", exe=exe).result()",
"metadata": {
"trusted": true
},
Expand Down Expand Up @@ -209,7 +209,7 @@
},
{
"cell_type": "code",
"source": "flow = load_workflow_json(file_name=\"workflow_simple.json\")",
"source": "flow = load_workflow_json(file_name=\"workflow_arithmetic.json\")",
"metadata": {
"trusted": true
},
Expand Down Expand Up @@ -256,7 +256,7 @@
{
"cell_type": "code",
"source": [
"delayed_object_lst = load_workflow_json(file_name=\"workflow_simple.json\")\n",
"delayed_object_lst = load_workflow_json(file_name=\"workflow_arithmetic.json\")\n",
"delayed_object_lst[-1].draw()"
],
"metadata": {
Expand Down Expand Up @@ -313,7 +313,7 @@
},
{
"cell_type": "code",
"source": "load_workflow_json(file_name=\"workflow_simple.json\")",
"source": "load_workflow_json(file_name=\"workflow_arithmetic.json\")",
"metadata": {
"trusted": true
},
Expand Down
4 changes: 2 additions & 2 deletions workflow_simple.json → workflow_arithmetic.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"nodes": [
{"id": 0, "function": "simple_workflow.get_prod_and_div"},
{"id": 1, "function": "simple_workflow.get_sum"},
{"id": 0, "function": "arithmetic_workflow.get_prod_and_div"},
{"id": 1, "function": "arithmetic_workflow.get_sum"},
{"id": 2, "value": 1},
{"id": 3, "value": 2}
],
Expand Down
Loading