Skip to content

dynamically create test scripts #3

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 25, 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
9 changes: 0 additions & 9 deletions .ci_support/test_with_aiida.py

This file was deleted.

7 changes: 0 additions & 7 deletions .ci_support/test_with_jobflow.py

This file was deleted.

6 changes: 0 additions & 6 deletions .ci_support/test_with_pyiron.py

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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
32 changes: 26 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 |
Loading