diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 1ace8ce..307ace9 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -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 @@ -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 diff --git a/README.md b/README.md index b3688ce..ec7a72d 100644 --- a/README.md +++ b/README.md @@ -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: ``` { @@ -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 diff --git a/aiida_simple.ipynb b/aiida_arithmetic.ipynb similarity index 99% rename from aiida_simple.ipynb rename to aiida_arithmetic.ipynb index 6968ad6..508d3af 100644 --- a/aiida_simple.ipynb +++ b/aiida_arithmetic.ipynb @@ -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", ")" @@ -56,7 +56,7 @@ }, { "cell_type": "code", - "source": "wg = WorkGraph(\"wg-simple\")", + "source": "wg = WorkGraph(\"arithmetic\")", "metadata": { "trusted": true }, diff --git a/simple_workflow.py b/arithmetic_workflow.py similarity index 100% rename from simple_workflow.py rename to arithmetic_workflow.py diff --git a/book/_toc.yml b/book/_toc.yml index d910700..f6cf550 100644 --- a/book/_toc.yml +++ b/book/_toc.yml @@ -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 diff --git a/book/simple.md b/book/arithmetic.md similarity index 83% rename from book/simple.md rename to book/arithmetic.md index 8514a9a..ba33a3c 100644 --- a/book/simple.md +++ b/book/arithmetic.md @@ -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): @@ -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} ], diff --git a/jobflow_simple.ipynb b/jobflow_arithmetic.ipynb similarity index 99% rename from jobflow_simple.ipynb rename to jobflow_arithmetic.ipynb index 7614eec..f367c6f 100644 --- a/jobflow_simple.ipynb +++ b/jobflow_arithmetic.ipynb @@ -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", ")" diff --git a/pyiron_base_simple.ipynb b/pyiron_base_arithmetic.ipynb similarity index 98% rename from pyiron_base_simple.ipynb rename to pyiron_base_arithmetic.ipynb index 2b34f9a..308bd09 100644 --- a/pyiron_base_simple.ipynb +++ b/pyiron_base_arithmetic.ipynb @@ -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", ")" @@ -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 }, diff --git a/universal_workflow_simple.ipynb b/universal_workflow_arithmetic.ipynb similarity index 97% rename from universal_workflow_simple.ipynb rename to universal_workflow_arithmetic.ipynb index 34181b1..087b9f2 100644 --- a/universal_workflow_simple.ipynb +++ b/universal_workflow_arithmetic.ipynb @@ -42,7 +42,7 @@ }, { "cell_type": "code", - "source": "plot(file_name='workflow_simple.json')", + "source": "plot(file_name='workflow_arithmetic.json')", "metadata": { "trusted": true }, @@ -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 }, @@ -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 }, @@ -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 }, @@ -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": { @@ -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 }, diff --git a/workflow_simple.json b/workflow_arithmetic.json similarity index 75% rename from workflow_simple.json rename to workflow_arithmetic.json index 3e19d16..1f29a65 100644 --- a/workflow_simple.json +++ b/workflow_arithmetic.json @@ -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} ],