Skip to content

Commit 1e694e2

Browse files
authored
dynamically create test scripts (#3)
* dynamically create test scripts * fixes * readme * add publishing instructions
1 parent d4d09f0 commit 1e694e2

File tree

5 files changed

+29
-31
lines changed

5 files changed

+29
-31
lines changed

.ci_support/test_with_aiida.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

.ci_support/test_with_jobflow.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

.ci_support/test_with_pyiron.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/pipeline.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
shell: bash -l {0}
2323
run: |
2424
verdi presto --profile-name pwd
25-
cp .ci_support/test_with_aiida.py .
25+
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
2626
python test_with_aiida.py
2727
2828
jobflow:
@@ -40,7 +40,7 @@ jobs:
4040
- name: Test
4141
shell: bash -l {0}
4242
run: |
43-
cp .ci_support/test_with_jobflow.py .
43+
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
4444
python test_with_jobflow.py
4545
4646
pyiron:
@@ -58,5 +58,5 @@ jobs:
5858
- name: Test
5959
shell: bash -l {0}
6060
run: |
61-
cp .ci_support/test_with_pyiron.py .
61+
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
6262
python test_with_pyiron.py

README.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
11
# Arithmetic Example Workflow
22
[![Pipeline](https://github.com/pythonworkflow/example-workflow/actions/workflows/pipeline.yml/badge.svg)](https://github.com/pythonworkflow/example-workflow/actions/workflows/pipeline.yml)
33

4-
Demonstration for publishing an interoperable workflow based on the Python Workflow Definition. The minimal workflow consists of three files:
4+
Template repository for publishing an interoperable workflow based on the Python Workflow Definition.
5+
6+
## Content
7+
The minimal workflow consists of three files:
8+
9+
| File | Explanation |
10+
|-------------------|---------------------------------------------------------|
11+
| `environment.yml` | Conda environment for software dependencies |
12+
| `workflow.py` | Python functions representing the nodes of the workflow |
13+
| `workflow.json` | Workflow graph consisting of nodes and edges |
14+
15+
Additional optional files for the publication of the workflow:
16+
17+
| File | Explanation |
18+
|----------------------------------|------------------------------------------|
19+
| `README.md` | Readme file to introduce the workflow |
20+
| `.github/workflows/pipeline.yml` | Github Actions to test the workflow |
21+
22+
## Publish your workflow
23+
You can publish your workflow in five simple steps:
24+
* Fork the repository and clone your fork locally.
25+
* Export your workflow to the Python Workflow Definition using the `python_workflow_definition` Python package, by calling the `write_workflow_json()` function.
26+
* 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.
27+
* Commit the files locally using `git add -A` and `git commit -m "add my workflow"`
28+
* Push your workflow to Github `git push`
29+
530

6-
| File | Explanation |
7-
|-----------------|---------------------------------------------------------|
8-
| environment.yml | Conda environment for software dependencies |
9-
| workflow.py | Python functions representing the nodes of the workflow |
10-
| workflow.json | Workflow graph consisting of nodes and edges |

0 commit comments

Comments
 (0)