diff --git a/.ci_support/test_with_aiida.py b/.ci_support/test_with_aiida.py deleted file mode 100644 index 67d9b6e..0000000 --- a/.ci_support/test_with_aiida.py +++ /dev/null @@ -1,9 +0,0 @@ -from aiida import load_profile -load_profile() - -from python_workflow_definition.aiida import load_workflow_json - - -if __name__ == "__main__": - workgraph = load_workflow_json(file_name='workflow.json') - workgraph.run() diff --git a/.ci_support/test_with_jobflow.py b/.ci_support/test_with_jobflow.py deleted file mode 100644 index a48e91c..0000000 --- a/.ci_support/test_with_jobflow.py +++ /dev/null @@ -1,7 +0,0 @@ -from jobflow.managers.local import run_locally -from python_workflow_definition.jobflow import load_workflow_json - - -if __name__ == "__main__": - flow = load_workflow_json(file_name="workflow.json") - print(run_locally(flow)) diff --git a/.ci_support/test_with_pyiron.py b/.ci_support/test_with_pyiron.py deleted file mode 100644 index b118c5c..0000000 --- a/.ci_support/test_with_pyiron.py +++ /dev/null @@ -1,6 +0,0 @@ -from python_workflow_definition.pyiron_base import load_workflow_json - - -if __name__ == "__main__": - delayed_object_lst = load_workflow_json(file_name="workflow.json") - print(delayed_object_lst[-1].pull()) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index f6fa88a..6bb0b2a 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -22,7 +22,7 @@ jobs: shell: bash -l {0} run: | verdi presto --profile-name pwd - cp .ci_support/test_with_aiida.py . + echo -e 'from aiida import load_profile\nload_profile()\n\nfrom python_workflow_definition.aiida import load_workflow_json\n\n\nif __name__ == "__main__":\n workgraph = load_workflow_json(file_name="workflow.json")\n workgraph.run()' > test_with_aiida.py python test_with_aiida.py jobflow: @@ -40,7 +40,7 @@ jobs: - name: Test shell: bash -l {0} run: | - cp .ci_support/test_with_jobflow.py . + echo -e 'from jobflow.managers.local import run_locally\nfrom python_workflow_definition.jobflow import load_workflow_json\n\n\nif __name__ == "__main__":\n flow = load_workflow_json(file_name="workflow.json")\n print(run_locally(flow))' > test_with_jobflow.py python test_with_jobflow.py pyiron: @@ -58,5 +58,5 @@ jobs: - name: Test shell: bash -l {0} run: | - cp .ci_support/test_with_pyiron.py . + echo -e 'from python_workflow_definition.pyiron_base import load_workflow_json\n\n\nif __name__ == "__main__":\n delayed_object_lst = load_workflow_json(file_name="workflow.json")\n print(delayed_object_lst[-1].pull())' > test_with_pyiron.py python test_with_pyiron.py diff --git a/README.md b/README.md index dfa835c..2519e0f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,30 @@ # Arithmetic Example Workflow [![Pipeline](https://github.com/pythonworkflow/example-workflow/actions/workflows/pipeline.yml/badge.svg)](https://github.com/pythonworkflow/example-workflow/actions/workflows/pipeline.yml) -Demonstration for publishing an interoperable workflow based on the Python Workflow Definition. The minimal workflow consists of three files: +Template repository for publishing an interoperable workflow based on the Python Workflow Definition. + +## Content +The minimal workflow consists of three files: + +| File | Explanation | +|-------------------|---------------------------------------------------------| +| `environment.yml` | Conda environment for software dependencies | +| `workflow.py` | Python functions representing the nodes of the workflow | +| `workflow.json` | Workflow graph consisting of nodes and edges | + +Additional optional files for the publication of the workflow: + +| File | Explanation | +|----------------------------------|------------------------------------------| +| `README.md` | Readme file to introduce the workflow | +| `.github/workflows/pipeline.yml` | Github Actions to test the workflow | + +## Publish your workflow +You can publish your workflow in five simple steps: +* Fork the repository and clone your fork locally. +* Export your workflow to the Python Workflow Definition using the `python_workflow_definition` Python package, by calling the `write_workflow_json()` function. +* Replace the `environment.yml`, `workflow.py` and `workflow.json` in your local folder with the files for your workflow. In addition, you can add additional files if they are required and update the `README.md` to explain your workflow. +* Commit the files locally using `git add -A` and `git commit -m "add my workflow"` +* Push your workflow to Github `git push` + -| File | Explanation | -|-----------------|---------------------------------------------------------| -| environment.yml | Conda environment for software dependencies | -| workflow.py | Python functions representing the nodes of the workflow | -| workflow.json | Workflow graph consisting of nodes and edges |