Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add nbstripout via pre-commit and strip all notebooks
  • Loading branch information
GeigerJ2 committed Oct 23, 2025
commit 1ecb3f5baa422bf46e806f4b74d0c53e6d2ada77
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
- id: nbstripout
name: nbstripout - Strip outputs from notebooks
args:
- --extra-keys
- "metadata.kernelspec metadata.language_info"
302 changes: 134 additions & 168 deletions example_workflows/arithmetic/aiida.ipynb

Large diffs are not rendered by default.

113 changes: 41 additions & 72 deletions example_workflows/arithmetic/cwl.ipynb
Original file line number Diff line number Diff line change
@@ -1,97 +1,66 @@
{
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"name": "python",
"version": "3.12.8",
"mimetype": "text/x-python",
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"pygments_lexer": "ipython3",
"nbconvert_exporter": "python",
"file_extension": ".py"
}
},
"nbformat_minor": 5,
"nbformat": 4,
"cells": [
{
"id": "377fef56-484d-491c-b19e-1be6931e44eb",
"cell_type": "code",
"source": "import pickle",
"metadata": {
"trusted": true
},
"execution_count": null,
"id": "0",
"metadata": {},
"outputs": [],
"execution_count": 1
"source": [
"import pickle"
]
},
{
"id": "92e3921b-2bb8-4333-8cfe-4bd27f785d24",
"cell_type": "code",
"source": "from python_workflow_definition.cwl import write_workflow",
"metadata": {
"trusted": true
},
"execution_count": null,
"id": "1",
"metadata": {},
"outputs": [],
"execution_count": 2
"source": [
"from python_workflow_definition.cwl import write_workflow"
]
},
{
"id": "5303c059-8ae4-4557-858e-b4bd64eac711",
"cell_type": "code",
"source": "write_workflow(file_name=\"workflow.json\")",
"metadata": {
"trusted": true
},
"execution_count": null,
"id": "2",
"metadata": {},
"outputs": [],
"execution_count": 3
"source": [
"write_workflow(file_name=\"workflow.json\")"
]
},
{
"id": "df302bd2-e9b6-4595-979c-67c46414d986",
"cell_type": "code",
"source": "! cwltool workflow.cwl workflow.yml",
"metadata": {
"trusted": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": "/srv/conda/envs/notebook/bin/cwltool:11: DeprecationWarning: Nesting argument groups is deprecated.\n sys.exit(run())\n\u001B[1;30mINFO\u001B[0m /srv/conda/envs/notebook/bin/cwltool 3.1.20250110105449\n\u001B[1;30mINFO\u001B[0m Resolved 'workflow.cwl' to 'file:///home/jovyan/example_workflows/arithmetic/workflow.cwl'\n\u001B[1;30mINFO\u001B[0m [workflow ] start\n\u001B[1;30mINFO\u001B[0m [workflow ] starting step get_prod_and_div_0\n\u001B[1;30mINFO\u001B[0m [step get_prod_and_div_0] start\n\u001B[1;30mINFO\u001B[0m [job get_prod_and_div_0] /tmp/_1apt559$ python \\\n -m \\\n python_workflow_definition.cwl \\\n --workflowfile=/tmp/dyuxg6ka/stgf337bac5-2f8e-4489-bd51-83491b1d5f0e/workflow.py \\\n --function=workflow.get_prod_and_div \\\n --arg_x=/tmp/dyuxg6ka/stgd87c2fe4-ca8e-4031-9af0-751d6944cbe7/x.pickle \\\n --arg_y=/tmp/dyuxg6ka/stg7bcb8ced-0e5b-442e-a0e0-2b3117afe2d8/y.pickle\n\u001B[1;30mINFO\u001B[0m [job get_prod_and_div_0] completed success\n\u001B[1;30mINFO\u001B[0m [step get_prod_and_div_0] completed success\n\u001B[1;30mINFO\u001B[0m [workflow ] starting step get_sum_1\n\u001B[1;30mINFO\u001B[0m [step get_sum_1] start\n\u001B[1;30mINFO\u001B[0m [job get_sum_1] /tmp/ysau_yra$ python \\\n -m \\\n python_workflow_definition.cwl \\\n --workflowfile=/tmp/rm6c9qek/stgfef68b90-5d69-4da9-a952-b9c2f2a1eb76/workflow.py \\\n --function=workflow.get_sum \\\n --arg_x=/tmp/rm6c9qek/stg35728be7-5a6d-487b-bd02-345581007663/prod.pickle \\\n --arg_y=/tmp/rm6c9qek/stgc0992786-237e-4308-9d9e-814ebbfb0319/div.pickle\n\u001B[1;30mINFO\u001B[0m [job get_sum_1] completed success\n\u001B[1;30mINFO\u001B[0m [step get_sum_1] completed success\n\u001B[1;30mINFO\u001B[0m [workflow ] starting step get_square_2\n\u001B[1;30mINFO\u001B[0m [step get_square_2] start\n\u001B[1;30mINFO\u001B[0m [job get_square_2] /tmp/o3gzya8t$ python \\\n -m \\\n python_workflow_definition.cwl \\\n --workflowfile=/tmp/6a3sltnz/stg58ccf048-a5c3-4ba3-a24f-c64adfff84cd/workflow.py \\\n --function=workflow.get_square \\\n --arg_x=/tmp/6a3sltnz/stg70203cec-cbd4-4fea-a3de-70e9373d9c9d/result.pickle\n\u001B[1;30mINFO\u001B[0m [job get_square_2] completed success\n\u001B[1;30mINFO\u001B[0m [step get_square_2] completed success\n\u001B[1;30mINFO\u001B[0m [workflow ] completed success\n{\n \"result_file\": {\n \"location\": \"file:///home/jovyan/example_workflows/arithmetic/result.pickle\",\n \"basename\": \"result.pickle\",\n \"class\": \"File\",\n \"checksum\": \"sha1$1fd8f217331336b1226b84e351c56fb9a8d93685\",\n \"size\": 21,\n \"path\": \"/home/jovyan/example_workflows/arithmetic/result.pickle\"\n }\n}\u001B[1;30mINFO\u001B[0m Final process status is success\n"
}
],
"execution_count": 4
"execution_count": null,
"id": "3",
"metadata": {},
"outputs": [],
"source": [
"! cwltool workflow.cwl workflow.yml"
]
},
{
"id": "2942dbba-ea0a-4d20-be5c-ed9992d09ff8",
"cell_type": "code",
"source": "with open(\"result.pickle\", \"rb\") as f:\n print(pickle.load(f))",
"metadata": {
"trusted": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": "6.25\n"
}
],
"execution_count": 5
"execution_count": null,
"id": "4",
"metadata": {},
"outputs": [],
"source": [
"with open(\"result.pickle\", \"rb\") as f:\n",
" print(pickle.load(f))"
]
},
{
"id": "60e909ee-d0d0-4bd1-81c8-dd5274ae5834",
"cell_type": "code",
"source": "",
"metadata": {
"trusted": true
},
"execution_count": null,
"id": "5",
"metadata": {},
"outputs": [],
"execution_count": null
"source": []
}
]
],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}
Loading
Loading